Merge pull request #1461 from akallabeth/clang_warning_fixes

Fixes clang warnings ```Allocator sizeof operand mismatch```
This commit is contained in:
Bernhard Miklautz 2013-09-09 01:22:16 -07:00
commit 952a2a4245

View File

@ -35,56 +35,68 @@
static wMessage* freerdp_cliprdr_event_new(UINT16 event_type) static wMessage* freerdp_cliprdr_event_new(UINT16 event_type)
{ {
wMessage* event = NULL; union
{
wMessage* m;
void *v;
} event;
event.m = NULL;
switch (event_type) switch (event_type)
{ {
case CliprdrChannel_MonitorReady: case CliprdrChannel_MonitorReady:
event = (wMessage*) malloc(sizeof(RDP_CB_MONITOR_READY_EVENT)); event.v = malloc(sizeof(RDP_CB_MONITOR_READY_EVENT));
ZeroMemory(event, sizeof(RDP_CB_MONITOR_READY_EVENT)); ZeroMemory(event.v, sizeof(RDP_CB_MONITOR_READY_EVENT));
event->id = MakeMessageId(CliprdrChannel, MonitorReady); event.m->id = MakeMessageId(CliprdrChannel, MonitorReady);
break; break;
case CliprdrChannel_FormatList: case CliprdrChannel_FormatList:
event = (wMessage*) malloc(sizeof(RDP_CB_FORMAT_LIST_EVENT)); event.v = malloc(sizeof(RDP_CB_FORMAT_LIST_EVENT));
ZeroMemory(event, sizeof(RDP_CB_FORMAT_LIST_EVENT)); ZeroMemory(event.v, sizeof(RDP_CB_FORMAT_LIST_EVENT));
event->id = MakeMessageId(CliprdrChannel, FormatList); event.m->id = MakeMessageId(CliprdrChannel, FormatList);
break; break;
case CliprdrChannel_DataRequest: case CliprdrChannel_DataRequest:
event = (wMessage*) malloc(sizeof(RDP_CB_DATA_REQUEST_EVENT)); event.v = malloc(sizeof(RDP_CB_DATA_REQUEST_EVENT));
ZeroMemory(event, sizeof(RDP_CB_DATA_REQUEST_EVENT)); ZeroMemory(event.v, sizeof(RDP_CB_DATA_REQUEST_EVENT));
event->id = MakeMessageId(CliprdrChannel, DataRequest); event.m->id = MakeMessageId(CliprdrChannel, DataRequest);
break; break;
case CliprdrChannel_DataResponse: case CliprdrChannel_DataResponse:
event = (wMessage*) malloc(sizeof(RDP_CB_DATA_RESPONSE_EVENT)); event.v = malloc(sizeof(RDP_CB_DATA_RESPONSE_EVENT));
ZeroMemory(event, sizeof(RDP_CB_DATA_RESPONSE_EVENT)); ZeroMemory(event.v, sizeof(RDP_CB_DATA_RESPONSE_EVENT));
event->id = MakeMessageId(CliprdrChannel, DataResponse); event.m->id = MakeMessageId(CliprdrChannel, DataResponse);
break; break;
} }
return event; return event.v;
} }
static wMessage* freerdp_tsmf_event_new(UINT16 event_type) static wMessage* freerdp_tsmf_event_new(UINT16 event_type)
{ {
wMessage* event = NULL; union
{
void *v;
wMessage* m;
} event;
event.m = NULL;
switch (event_type) switch (event_type)
{ {
case TsmfChannel_VideoFrame: case TsmfChannel_VideoFrame:
event = (wMessage*) malloc(sizeof(RDP_VIDEO_FRAME_EVENT)); event.v = malloc(sizeof(RDP_VIDEO_FRAME_EVENT));
ZeroMemory(event, sizeof(RDP_VIDEO_FRAME_EVENT)); ZeroMemory(event.v, sizeof(RDP_VIDEO_FRAME_EVENT));
event.m->id = MakeMessageId(TsmfChannel, VideoFrame);
break; break;
case TsmfChannel_Redraw: case TsmfChannel_Redraw:
event = (wMessage*) malloc(sizeof(RDP_REDRAW_EVENT)); event.v = malloc(sizeof(RDP_REDRAW_EVENT));
ZeroMemory(event, sizeof(RDP_REDRAW_EVENT)); ZeroMemory(event.v, sizeof(RDP_REDRAW_EVENT));
event.m->id = MakeMessageId(TsmfChannel, Redraw);
break; break;
} }
return event; return event.v;
} }
static wMessage* freerdp_rail_event_new(UINT16 event_type) static wMessage* freerdp_rail_event_new(UINT16 event_type)