diff --git a/channels/audin/client/audin_main.c b/channels/audin/client/audin_main.c index 44bc3a2d0..5be763e7b 100644 --- a/channels/audin/client/audin_main.c +++ b/channels/audin/client/audin_main.c @@ -480,7 +480,7 @@ static UINT audin_process_open(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* call if (initialFormat >= callback->formats_count) { - WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %d)", + WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %" PRIu32 ")", initialFormat, callback->formats_count); return ERROR_INVALID_DATA; } @@ -521,8 +521,8 @@ static UINT audin_process_format_change(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLB if (NewFormat >= callback->formats_count) { - WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %d)", NewFormat, - callback->formats_count); + WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %" PRIu32 ")", + NewFormat, callback->formats_count); return ERROR_INVALID_DATA; } diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c index 0f585440b..f37aeef0e 100644 --- a/channels/audin/client/oss/audin_oss.c +++ b/channels/audin/client/oss/audin_oss.c @@ -365,7 +365,7 @@ static UINT audin_oss_free(IAudinDevice* device) if ((error = audin_oss_close(device))) { - WLog_ERR(TAG, "audin_oss_close failed with error code %d!", error); + WLog_ERR(TAG, "audin_oss_close failed with error code %" PRIu32 "!", error); } free(oss); diff --git a/channels/audin/server/audin.c b/channels/audin/server/audin.c index fc14d6094..5d223b694 100644 --- a/channels/audin/server/audin.c +++ b/channels/audin/server/audin.c @@ -209,7 +209,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 le if (audin->context.num_client_formats <= 0) { - WLog_ERR(TAG, "num_client_formats expected > 0 but got %d", + WLog_ERR(TAG, "num_client_formats expected > 0 but got %" PRIuz, audin->context.num_client_formats); return ERROR_INVALID_DATA; } @@ -254,7 +254,7 @@ static UINT audin_server_send_open(audin_server* audin, wStream* s) WINPR_ASSERT(audin); if (audin->context.selected_client_format < 0) { - WLog_ERR(TAG, "audin->context.selected_client_format = %d", + WLog_ERR(TAG, "audin->context.selected_client_format = %" PRIdz, audin->context.selected_client_format); return ERROR_INVALID_DATA; } @@ -330,7 +330,7 @@ static UINT audin_server_recv_data(audin_server* audin, wStream* s, UINT32 lengt WINPR_ASSERT(audin); if (audin->context.selected_client_format < 0) { - WLog_ERR(TAG, "audin->context.selected_client_format = %d", + WLog_ERR(TAG, "audin->context.selected_client_format = %" PRIdz, audin->context.selected_client_format); return ERROR_INVALID_DATA; } diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index a1aed67aa..fd3ac303b 100644 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -130,8 +130,8 @@ disp_send_display_control_monitor_layout_pdu(GENERIC_CHANNEL_CALLBACK* callback, Stream_Write_UINT32(s, current.DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */ Stream_Write_UINT32(s, current.DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */ WLog_DBG(TAG, - "\t%d : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 ") W/H=%" PRIu32 - "x%" PRIu32 ")", + "\t%" PRIu32 " : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 + ") W/H=%" PRIu32 "x%" PRIu32 ")", index, current.Flags, current.Left, current.Top, current.Width, current.Height); WLog_DBG(TAG, "\t PhysicalWidth: %" PRIu32 " PhysicalHeight: %" PRIu32 " Orientation: %" PRIu32 diff --git a/channels/disp/server/disp_main.c b/channels/disp/server/disp_main.c index adbb6f046..4bbf14e9a 100644 --- a/channels/disp/server/disp_main.c +++ b/channels/disp/server/disp_main.c @@ -187,8 +187,8 @@ static UINT disp_recv_display_control_monitor_layout_pdu(wStream* s, DispServerC disp_server_sanitize_monitor_layout(monitor); WLog_DBG(TAG, - "\t%d : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 ") W/H=%" PRIu32 - "x%" PRIu32 ")", + "\t%" PRIu32 " : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 + ") W/H=%" PRIu32 "x%" PRIu32 ")", index, monitor->Flags, monitor->Left, monitor->Top, monitor->Width, monitor->Height); WLog_DBG(TAG, @@ -249,7 +249,7 @@ static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s) if (end != (beg + header.length)) { - WLog_ERR(TAG, "Unexpected DISP pdu end: Actual: %d, Expected: %" PRIu32 "", end, + WLog_ERR(TAG, "Unexpected DISP pdu end: Actual: %" PRIuz ", Expected: %" PRIuz "", end, (beg + header.length)); Stream_SetPosition(s, (beg + header.length)); } diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 0a39430cb..1b9afae21 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -68,7 +68,7 @@ static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, DVCMAN* dvcman = (DVCMAN*)pChannelMgr; DVCMAN_LISTENER* listener; - WLog_DBG(TAG, "create_listener: %d.%s.", HashTable_Count(dvcman->listeners) + 1, + WLog_DBG(TAG, "create_listener: %" PRIuz ".%s.", HashTable_Count(dvcman->listeners) + 1, pszChannelName); listener = (DVCMAN_LISTENER*)calloc(1, sizeof(DVCMAN_LISTENER)); @@ -132,7 +132,7 @@ static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const ch if (!ArrayList_Append(dvcman->plugins, pPlugin)) return ERROR_INTERNAL_ERROR; - WLog_DBG(TAG, "register_plugin: num_plugins %d", ArrayList_Count(dvcman->plugins)); + WLog_DBG(TAG, "register_plugin: num_plugins %" PRIuz, ArrayList_Count(dvcman->plugins)); return CHANNEL_RC_OK; } diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index 79cf3ed24..652f6ee92 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -658,8 +658,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN if (!SetFilePointerEx(file->file_handle, liSize, NULL, FILE_BEGIN)) { - WLog_ERR(TAG, "Unable to truncate %s to %d (%" PRId32 ")", file->fullpath, size, - GetLastError()); + WLog_ERR(TAG, "Unable to truncate %s to %" PRId64 " (%" PRId32 ")", file->fullpath, + size, GetLastError()); return FALSE; } @@ -667,8 +667,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN if (SetEndOfFile(file->file_handle) == 0) { - WLog_ERR(TAG, "Unable to truncate %s to %d (%" PRId32 ")", file->fullpath, size, - GetLastError()); + WLog_ERR(TAG, "Unable to truncate %s to %" PRId64 " (%" PRId32 ")", file->fullpath, + size, GetLastError()); return FALSE; } diff --git a/channels/rdpdr/server/rdpdr_main.c b/channels/rdpdr/server/rdpdr_main.c index 540202160..3a8183664 100644 --- a/channels/rdpdr/server/rdpdr_main.c +++ b/channels/rdpdr/server/rdpdr_main.c @@ -856,7 +856,7 @@ static UINT rdpdr_server_receive_device_list_announce_request(RdpdrServerContext if (!Stream_CheckAndLogRequiredLength(TAG, s, DeviceDataLength)) return ERROR_INVALID_DATA; - WLog_DBG(TAG, "Device %d Name: %s Id: 0x%08" PRIX32 " DataLength: %" PRIu32 "", i, + WLog_DBG(TAG, "Device %" PRIu32 " Name: %s Id: 0x%08" PRIX32 " DataLength: %" PRIu32 "", i, PreferredDosName, DeviceId, DeviceDataLength); switch (DeviceType) @@ -933,7 +933,7 @@ static UINT rdpdr_server_receive_device_list_remove_request(RdpdrServerContext* return ERROR_INVALID_DATA; Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */ - WLog_DBG(TAG, "Device %d Id: 0x%08" PRIX32 "", i, DeviceId); + WLog_DBG(TAG, "Device %" PRIu32 " Id: 0x%08" PRIX32 "", i, DeviceId); DeviceType = 0; /* TODO: Save the device type on the announce request. */ switch (DeviceType) diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index a6f4a3c83..801a22b9e 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -2050,7 +2050,7 @@ static UINT rdpgfx_recv_pdu(GENERIC_CHANNEL_CALLBACK* callback, wStream* s) if (end != (beg + header.pduLength)) { WLog_Print(gfx->log, WLOG_ERROR, - "Unexpected gfx pdu end: Actual: %d, Expected: %" PRIu32 "", end, + "Unexpected gfx pdu end: Actual: %" PRIuz ", Expected: %" PRIuz, end, (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength)); } diff --git a/channels/rdpgfx/server/rdpgfx_main.c b/channels/rdpgfx/server/rdpgfx_main.c index e2695c2e0..a0a2dca6a 100644 --- a/channels/rdpgfx/server/rdpgfx_main.c +++ b/channels/rdpgfx/server/rdpgfx_main.c @@ -1350,7 +1350,7 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if (end != (beg + header.pduLength)) { - WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %" PRIu32 "", end, + WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %" PRIuz ", Expected: %" PRIuz "", end, (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength)); } diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 20f055c79..24f5d12e3 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -347,7 +347,7 @@ static UINT rdpsnd_server_select_format(RdpsndServerContext* context, UINT16 cli if ((client_format_index >= context->num_client_formats) || (!context->src_format)) { - WLog_ERR(TAG, "index %d is not correct.", client_format_index); + WLog_ERR(TAG, "index %" PRIu16 " is not correct.", client_format_index); return ERROR_INVALID_DATA; } diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index 9edef8f6d..0a1fc6f8b 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -51,17 +51,19 @@ static void smartcard_context_free(void* pCtx); static UINT smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp); static SMARTCARD_DEVICE* cast_device_from(DEVICE* device, const char* fkt, const char* file, - int line) + size_t line) { if (!device) { - WLog_ERR(TAG, "%s [%s:%d] Called smartcard channel with NULL device", fkt, file, line); + WLog_ERR(TAG, "%s [%s:%" PRIuz "] Called smartcard channel with NULL device", fkt, file, + line); return NULL; } if (device->type != RDPDR_DTYP_SMARTCARD) { - WLog_ERR(TAG, "%s [%s:%d] Called smartcard channel with invalid device of type %" PRIx32, + WLog_ERR(TAG, + "%s [%s:%" PRIuz "] Called smartcard channel with invalid device of type %" PRIx32, fkt, file, line, device->type); return NULL; } diff --git a/channels/urbdrc/common/msusb.c b/channels/urbdrc/common/msusb.c index 12fceeefc..79769632a 100644 --- a/channels/urbdrc/common/msusb.c +++ b/channels/urbdrc/common/msusb.c @@ -385,7 +385,7 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig) for (pnum = 0; pnum < MsInterface->NumberOfPipes; pnum++) { MsPipe = MsPipes[pnum]; - WLog_INFO(TAG, " Pipe: %d", pnum); + WLog_INFO(TAG, " Pipe: %" PRIu32, pnum); WLog_INFO(TAG, " MaximumPacketSize: 0x%04" PRIx16 "", MsPipe->MaximumPacketSize); WLog_INFO(TAG, " MaximumTransferSize: 0x%08" PRIx32 "", MsPipe->MaximumTransferSize); diff --git a/channels/video/client/video_main.c b/channels/video/client/video_main.c index 373f9f839..07a893ae7 100644 --- a/channels/video/client/video_main.c +++ b/channels/video/client/video_main.c @@ -378,7 +378,10 @@ static BOOL video_onMappedGeometryUpdate(MAPPED_GEOMETRY* geometry) WINPR_ASSERT(presentation); r = &geometry->geometry.boundingRect; - WLog_DBG(TAG, "geometry updated topGeom=(%d,%d-%dx%d) geom=(%d,%d-%dx%d) rects=(%d,%d-%dx%d)", + WLog_DBG(TAG, + "geometry updated topGeom=(%" PRId32 ",%" PRId32 "-%" PRId32 "x%" PRId32 + ") geom=(%" PRId32 ",%" PRId32 "-%" PRId32 "x%" PRId32 ") rects=(%" PRId16 ",%" PRId16 + "-%" PRId16 "x%" PRId16 ")", geometry->topLevelLeft, geometry->topLevelTop, geometry->topLevelRight - geometry->topLevelLeft, geometry->topLevelBottom - geometry->topLevelTop, @@ -435,12 +438,12 @@ static UINT video_PresentationRequest(VideoClientContext* video, { if (presentation->PresentationId == req->PresentationId) { - WLog_ERR(TAG, "ignoring start request for existing presentation %d", + WLog_ERR(TAG, "ignoring start request for existing presentation %" PRIu8, req->PresentationId); return CHANNEL_RC_OK; } - WLog_ERR(TAG, "releasing current presentation %d", req->PresentationId); + WLog_ERR(TAG, "releasing current presentation %" PRIu8, req->PresentationId); PresentationContext_unref(presentation); presentation = priv->currentPresentation = NULL; } @@ -489,7 +492,7 @@ static UINT video_PresentationRequest(VideoClientContext* video, WLog_DBG(TAG, "stopping presentation 0x%x", req->PresentationId); if (!presentation) { - WLog_ERR(TAG, "unknown presentation to stop %d", req->PresentationId); + WLog_ERR(TAG, "unknown presentation to stop %" PRIu8, req->PresentationId); return CHANNEL_RC_OK; } @@ -765,15 +768,17 @@ treat_feedback: video_control_send_client_notification(video, ¬if); priv->lastSentRate = computedRate; - WLog_DBG(TAG, "server notified with rate %d published=%d dropped=%d", + WLog_DBG(TAG, + "server notified with rate %" PRIu32 " published=%" PRIu32 + " dropped=%" PRIu32, priv->lastSentRate, priv->publishedFrames, priv->droppedFrames); } PresentationContext_unref(priv->currentPresentation); } - WLog_DBG(TAG, "currentRate=%d published=%d dropped=%d", priv->lastSentRate, - priv->publishedFrames, priv->droppedFrames); + WLog_DBG(TAG, "currentRate=%" PRIu32 " published=%" PRIu32 " dropped=%" PRIu32, + priv->lastSentRate, priv->publishedFrames, priv->droppedFrames); priv->droppedFrames = 0; priv->publishedFrames = 0; @@ -802,7 +807,7 @@ static UINT video_VideoData(VideoClientContext* context, const TSMM_VIDEO_DATA* if (presentation->PresentationId != data->PresentationId) { - WLog_ERR(TAG, "current presentation id=%d doesn't match data id=%d", + WLog_ERR(TAG, "current presentation id=%" PRIu8 " doesn't match data id=%" PRIu8, presentation->PresentationId, data->PresentationId); return CHANNEL_RC_OK; } diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index 0c843babd..a7686264e 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -2157,7 +2157,7 @@ static BOOL xf_cliprdr_fuse_generate_list(xfClipboard* clipboard, const BYTE* da if (size < 4) { - WLog_ERR(TAG, "size of format data response invalid : %d", size); + WLog_ERR(TAG, "size of format data response invalid : %" PRIu32, size); return FALSE; } size_t count = (size - 4) / sizeof(FILEDESCRIPTORW); @@ -3047,7 +3047,7 @@ static DWORD WINAPI xf_cliprdr_fuse_thread(LPVOID arg) free(tmpPath); return 0; } - _snprintf(&basePath[0], basePathSize, "%s/.xfreerdp.cliprdr.%d", tmpPath, + _snprintf(&basePath[0], basePathSize, "%s/.xfreerdp.cliprdr.%" PRIu32, tmpPath, GetCurrentProcessId()); free(tmpPath); diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index d029e9ae2..ddc79faaa 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -692,7 +692,8 @@ int xf_input_event(xfContext* xfc, const XEvent* xevent, XIDeviceEvent* event, i } break; default: - WLog_WARN(TAG, "[%s] Unhandled event %d: Event was registered but is not handled!"); + WLog_WARN(TAG, "[%s] Unhandled event %d: Event was registered but is not handled!", + __FUNCTION__, evtype); break; } diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index 30eebddf7..07de55d56 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -562,8 +562,8 @@ static xfRailIconCache* RailIconCache_New(rdpSettings* settings) if (!cache->entries) { - WLog_ERR(TAG, "failed to allocate icon cache %d x %d entries", cache->numCaches, - cache->numCacheEntries); + WLog_ERR(TAG, "failed to allocate icon cache %" PRIu32 " x %" PRIu32 " entries", + cache->numCaches, cache->numCacheEntries); free(cache); return NULL; } diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 889bc5295..9a46cd223 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -1410,8 +1410,8 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* fla *flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; } - WLog_DBG(TAG, "windows: %d/%d posix: %d/%d", windows_cli_status, windows_cli_count, - posix_cli_status, posix_cli_count); + WLog_DBG(TAG, "windows: %d/%" PRIuz " posix: %d/%" PRIuz "", windows_cli_status, + windows_cli_count, posix_cli_status, posix_cli_count); if ((posix_cli_count == 0) && (windows_cli_count == 0)) { if ((posix_cli_status == COMMAND_LINE_ERROR) && (windows_cli_status == COMMAND_LINE_ERROR)) diff --git a/client/common/file.c b/client/common/file.c index 3456e1f1d..791b87746 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -229,7 +229,7 @@ static BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, const char* name, { BOOL standard = TRUE; #ifdef DEBUG_CLIENT_FILE - WLog_DBG(TAG, "%s:i:%d", name, value); + WLog_DBG(TAG, "%s:i:%ld", name, value); #endif if (value < 0) diff --git a/client/common/smartcard_cli.c b/client/common/smartcard_cli.c index f499f9358..5e53cc716 100644 --- a/client/common/smartcard_cli.c +++ b/client/common/smartcard_cli.c @@ -37,7 +37,7 @@ BOOL freerdp_smartcard_list(const rdpSettings* settings) WINPR_ASSERT(info); - printf("%d: %s\n", i, info->subject); + printf("%" PRIu32 ": %s\n", i, info->subject); if (WideCharToMultiByte(CP_UTF8, 0, info->reader, -1, readerName, sizeof(readerName), NULL, NULL) > 0) diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 4b32b7bb6..d550e8d35 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -235,7 +235,7 @@ BOOL freerdp_image_copy_from_icon_data(BYTE* pDstData, UINT32 DstFormat, UINT32 break; default: - WLog_WARN(TAG, "invalid icon bpp: %d", bpp); + WLog_WARN(TAG, "invalid icon bpp: %" PRIu32, bpp); return FALSE; } diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 1073ba174..b9b433a9c 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -697,8 +697,8 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, RFX_MESSAGE* messag Stream_Read_UINT16(s, rect->width); /* width (2 bytes) */ Stream_Read_UINT16(s, rect->height); /* height (2 bytes) */ WLog_Print(context->priv->log, WLOG_DEBUG, - "rect %d (x,y=%" PRIu16 ",%" PRIu16 " w,h=%" PRIu16 " %" PRIu16 ").", i, rect->x, - rect->y, rect->width, rect->height); + "rect %" PRIu16 " (x,y=%" PRIu16 ",%" PRIu16 " w,h=%" PRIu16 " %" PRIu16 ").", i, + rect->x, rect->y, rect->width, rect->height); } if (!Stream_CheckAndLogRequiredLength(TAG, s, 4)) diff --git a/libfreerdp/core/activation.c b/libfreerdp/core/activation.c index 9278784f5..58e9af719 100644 --- a/libfreerdp/core/activation.c +++ b/libfreerdp/core/activation.c @@ -336,7 +336,8 @@ BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp) keyCount = rdp_load_persistent_key_list(rdp, &keyList); - WLog_DBG(TAG, "Persistent Key List: TotalKeyCount: %d MaxKeyFrag: %d", keyCount, keyMaxFrag); + WLog_DBG(TAG, "Persistent Key List: TotalKeyCount: %" PRIu32 " MaxKeyFrag: %" PRIu32, keyCount, + keyMaxFrag); // MS-RDPBCGR recommends sending no more than 169 entries at once. // In practice, sending more than 2042 entries at once triggers an error. @@ -376,13 +377,17 @@ BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp) info.keyCount = keyCount; info.keyList = keyList; - WLog_DBG(TAG, "persistentKeyList count: %d", info.keyCount); + WLog_DBG(TAG, "persistentKeyList count: %" PRIu32, info.keyCount); - WLog_DBG(TAG, "numEntriesCache: [0]: %d [1]: %d [2]: %d [3]: %d [4]: %d", info.numEntriesCache0, - info.numEntriesCache1, info.numEntriesCache2, info.numEntriesCache3, - info.numEntriesCache4); + WLog_DBG(TAG, + "numEntriesCache: [0]: %" PRIu16 " [1]: %" PRIu16 " [2]: %" PRIu16 " [3]: %" PRIu16 + " [4]: %" PRIu16, + info.numEntriesCache0, info.numEntriesCache1, info.numEntriesCache2, + info.numEntriesCache3, info.numEntriesCache4); - WLog_DBG(TAG, "totalEntriesCache: [0]: %d [1]: %d [2]: %d [3]: %d [4]: %d", + WLog_DBG(TAG, + "totalEntriesCache: [0]: %" PRIu16 " [1]: %" PRIu16 " [2]: %" PRIu16 " [3]: %" PRIu16 + " [4]: %" PRIu16, info.totalEntriesCache0, info.totalEntriesCache1, info.totalEntriesCache2, info.totalEntriesCache3, info.totalEntriesCache4); diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index 1593e1749..17adb3d75 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -3857,7 +3857,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 t if (numberCapabilities) { WLog_ERR(TAG, - "strange we haven't read the number of announced capacity sets, read=%d " + "strange we haven't read the number of announced capacity sets, read=%" PRIu16 " " "expected=%" PRIu16 "", count - numberCapabilities, count); } diff --git a/libfreerdp/core/certificate.c b/libfreerdp/core/certificate.c index 8132d3021..ea29613d6 100644 --- a/libfreerdp/core/certificate.c +++ b/libfreerdp/core/certificate.c @@ -693,7 +693,7 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certi if (!Stream_CheckAndLogRequiredLength(TAG, s, certLength)) return FALSE; - DEBUG_CERTIFICATE("X.509 Certificate #%d, length:%" PRIu32 "", i + 1, certLength); + DEBUG_CERTIFICATE("X.509 Certificate #%" PRIu32 ", length:%" PRIu32 "", i + 1, certLength); certificate->x509_cert_chain->array[i].data = (BYTE*)malloc(certLength); if (!certificate->x509_cert_chain->array[i].data) diff --git a/libfreerdp/core/gateway/http.c b/libfreerdp/core/gateway/http.c index a99474e04..236aaca6d 100644 --- a/libfreerdp/core/gateway/http.c +++ b/libfreerdp/core/gateway/http.c @@ -987,8 +987,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength) if (bodyLength != response->BodyLength) { - WLog_WARN(TAG, "%s: %s unexpected body length: actual: %d, expected: %d", __FUNCTION__, - response->ContentType, response->BodyLength, bodyLength); + WLog_WARN(TAG, "%s: %s unexpected body length: actual: %" PRIuz ", expected: %" PRIuz, + __FUNCTION__, response->ContentType, response->BodyLength, bodyLength); if (bodyLength > 0) response->BodyLength = MIN(bodyLength, response->BodyLength); diff --git a/libfreerdp/core/gateway/ntlm.c b/libfreerdp/core/gateway/ntlm.c index 9d37e2c34..6d73f5165 100644 --- a/libfreerdp/core/gateway/ntlm.c +++ b/libfreerdp/core/gateway/ntlm.c @@ -58,12 +58,12 @@ struct rdp_ntlm SecPkgContext_Bindings* Bindings; }; -static ULONG cast_from_size_(size_t size, const char* fkt, const char* file, int line) +static ULONG cast_from_size_(size_t size, const char* fkt, const char* file, size_t line) { if (size > ULONG_MAX) { - WLog_ERR(TAG, "[%s %s:%d] Size %" PRIdz " is larger than INT_MAX %lu", fkt, file, line, - size, ULONG_MAX); + WLog_ERR(TAG, "[%s %s:%" PRIuz "] Size %" PRIdz " is larger than INT_MAX %lu", fkt, file, + line, size, ULONG_MAX); return 0; } diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index be66c0e7d..61250c60b 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -1756,7 +1756,7 @@ static BOOL rdg_establish_data_connection(rdpRdg* rdg, rdpTls* tls, const char* encoding = http_response_get_transfer_encoding(response); isWebsocket = http_response_is_websocket(rdg->http, response); http_response_free(response); - WLog_DBG(TAG, "%s authorization result: %d", method, statusCode); + WLog_DBG(TAG, "%s authorization result: %ld", method, statusCode); switch (statusCode) { diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index f7b2581a7..48b6ae506 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -476,8 +476,8 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, UINT16 length) if (endPos != (begPos + blockLength)) { WLog_ERR(TAG, - "Error parsing GCC client data block 0x%04" PRIX16 - ": Actual Offset: %d Expected Offset: %d", + "Error parsing GCC client data block 0x%04" PRIX16 ": Actual Offset: %" PRIuz + " Expected Offset: %" PRIuz, type, endPos, begPos + blockLength); } diff --git a/libfreerdp/core/listener.c b/libfreerdp/core/listener.c index 423cd9698..3fb0ef417 100644 --- a/libfreerdp/core/listener.c +++ b/libfreerdp/core/listener.c @@ -142,7 +142,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a WSAEventSelect(sockfd, listener->events[listener->num_sockfds], FD_READ | FD_ACCEPT | FD_CLOSE); listener->num_sockfds++; - WLog_INFO(TAG, "Listening on [%s]:%d", addr, port); + WLog_INFO(TAG, "Listening on [%s]:%" PRIu16, addr, port); } freeaddrinfo(res); diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index de29520ba..391c4a382 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -997,7 +997,7 @@ static int nla_client_init(rdpNla* nla) if (nla->status != SEC_E_OK) return -1; - WLog_DBG(TAG, "%s %" PRIu32 " : packageName=%s ; cbMaxToken=%d", __FUNCTION__, __LINE__, + WLog_DBG(TAG, "%s %" PRIu32 " : packageName=%s ; cbMaxToken=%" PRIu32, __FUNCTION__, __LINE__, nla->packageName, nla->cbMaxToken); nla->status = nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, SECPKG_CRED_OUTBOUND, NULL, nla->identity, NULL, NULL, @@ -1818,9 +1818,9 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla) { WLog_ERR(TAG, "Could not verify server's public key echo"); #if defined(WITH_DEBUG_NLA) - WLog_ERR(TAG, "Expected (length = %d):", public_key_length); + WLog_ERR(TAG, "Expected (length = %" PRIu32 "):", public_key_length); winpr_HexDump(TAG, WLOG_ERROR, public_key1, public_key_length); - WLog_ERR(TAG, "Actual (length = %d):", public_key_length); + WLog_ERR(TAG, "Actual (length = %" PRIu32 "):", public_key_length); winpr_HexDump(TAG, WLOG_ERROR, public_key2, public_key_length); #endif status = SEC_E_MESSAGE_ALTERED; /* DO NOT SEND CREDENTIALS! */ diff --git a/libfreerdp/core/proxy.c b/libfreerdp/core/proxy.c index 4269622f7..e8f22089e 100644 --- a/libfreerdp/core/proxy.c +++ b/libfreerdp/core/proxy.c @@ -440,7 +440,7 @@ BOOL proxy_parse_uri(rdpSettings* settings, const char* uri_in) port = 1080; } - WLog_DBG(TAG, "setting default proxy port: %d", port); + WLog_DBG(TAG, "setting default proxy port: %" PRIu16, port); } if (!freerdp_settings_set_uint16(settings, FreeRDP_ProxyPort, port)) @@ -460,14 +460,14 @@ BOOL proxy_parse_uri(rdpSettings* settings, const char* uri_in) if (freerdp_settings_get_string(settings, FreeRDP_ProxyUsername)) { - WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%s@%s:%d", protocol, + WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%s@%s:%" PRIu16, protocol, freerdp_settings_get_string(settings, FreeRDP_ProxyUsername), "******", freerdp_settings_get_string(settings, FreeRDP_ProxyHostname), freerdp_settings_get_uint16(settings, FreeRDP_ProxyPort)); } else { - WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%d", protocol, + WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%" PRIu16, protocol, freerdp_settings_get_string(settings, FreeRDP_ProxyHostname), freerdp_settings_get_uint16(settings, FreeRDP_ProxyPort)); } @@ -826,14 +826,14 @@ static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, if (buf[1] == 0) { - WLog_INFO(TAG, "Successfully connected to %s:%d", hostname, port); + WLog_INFO(TAG, "Successfully connected to %s:%" PRIu16, hostname, port); return TRUE; } if (buf[1] > 0 && buf[1] < 9) WLog_INFO(TAG, "SOCKS Proxy replied: %s", rplstat[buf[1]]); else - WLog_INFO(TAG, "SOCKS Proxy replied: %d status not listed in rfc1928", buf[1]); + WLog_INFO(TAG, "SOCKS Proxy replied: %" PRIu8 " status not listed in rfc1928", buf[1]); return FALSE; } diff --git a/libfreerdp/core/redirection.c b/libfreerdp/core/redirection.c index c47d60a62..f3b48e3af 100644 --- a/libfreerdp/core/redirection.c +++ b/libfreerdp/core/redirection.c @@ -414,7 +414,8 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) if (!rdp_redirection_read_unicode_string(s, &(redirection->TargetNetAddresses[i]), 80)) return FALSE; - WLog_DBG(TAG, "TargetNetAddresses[%d]: %s", i, redirection->TargetNetAddresses[i]); + WLog_DBG(TAG, "TargetNetAddresses[%" PRIuz "]: %s", i, + redirection->TargetNetAddresses[i]); } } diff --git a/libfreerdp/core/smartcardlogon.c b/libfreerdp/core/smartcardlogon.c index 6623b26de..1147f9b85 100644 --- a/libfreerdp/core/smartcardlogon.c +++ b/libfreerdp/core/smartcardlogon.c @@ -369,7 +369,7 @@ static BOOL smartcard_hw_enumerateCerts(const rdpSettings* settings, LPCWSTR csp certBytes = calloc(1, cbOutput); if (!certBytes) { - WLog_ERR(TAG, "unable to allocate %d certBytes for key %s", cbOutput, + WLog_ERR(TAG, "unable to allocate %" PRIu32 " certBytes for key %s", cbOutput, cert->info.containerName); goto endofloop; } diff --git a/libfreerdp/crypto/ber.c b/libfreerdp/crypto/ber.c index 1f7d1af3a..9e1d55b20 100644 --- a/libfreerdp/crypto/ber.c +++ b/libfreerdp/crypto/ber.c @@ -612,7 +612,7 @@ BOOL ber_read_integer(wStream* s, UINT32* value) } else { - WLog_ERR(TAG, "should implement reading an integer with length=%d", length); + WLog_ERR(TAG, "should implement reading an integer with length=%" PRIuz, length); return FALSE; } diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 294114650..aff6c888b 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -1412,8 +1412,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U accept_cert(tls, pemCert, length); else if (verification_status < 0) { - WLog_ERR(TAG, "VerifyX509Certificate failed: (length = %d) status: [%d] %s", length, - verification_status, pemCert); + WLog_ERR(TAG, "VerifyX509Certificate failed: (length = %" PRIuz ") status: [%d] %s", + length, verification_status, pemCert); goto end; } } @@ -1556,7 +1556,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U hostname, port, pem, certificate_store_get_hosts_file(tls->certificate_store)); if (!stored_data) - WLog_WARN(TAG, "Failed to get certificate entry for %s:%d", hostname, port); + WLog_WARN(TAG, "Failed to get certificate entry for %s:%" PRIu16 "", hostname, + port); if (tls->settings->AutoDenyCertificate) { diff --git a/libfreerdp/utils/smartcard_pack.c b/libfreerdp/utils/smartcard_pack.c index 1ff82b358..bb7d4ccfd 100644 --- a/libfreerdp/utils/smartcard_pack.c +++ b/libfreerdp/utils/smartcard_pack.c @@ -67,7 +67,7 @@ typedef enum #define smartcard_ndr_pointer_read(s, index, ptr) \ smartcard_ndr_pointer_read_((s), (index), (ptr), __FILE__, __FUNCTION__, __LINE__) static BOOL smartcard_ndr_pointer_read_(wStream* s, UINT32* index, UINT32* ptr, const char* file, - const char* fkt, int line) + const char* fkt, size_t line) { const UINT32 expect = 0x20000 + (*index) * 4; UINT32 ndrPtr; @@ -85,8 +85,9 @@ static BOOL smartcard_ndr_pointer_read_(wStream* s, UINT32* index, UINT32* ptr, /* Allow NULL pointer if we read the result */ if (ptr && (ndrPtr == 0)) return TRUE; - WLog_WARN(TAG, "[%s:%d] Read context pointer 0x%08" PRIx32 ", expected 0x%08" PRIx32, fkt, - line, ndrPtr, expect); + WLog_WARN(TAG, + "[%s:%" PRIuz "] Read context pointer 0x%08" PRIx32 ", expected 0x%08" PRIx32, + fkt, line, ndrPtr, expect); return FALSE; } diff --git a/server/proxy/channels/pf_channel_drdynvc.c b/server/proxy/channels/pf_channel_drdynvc.c index a2acf3f64..5a5bb9aa5 100644 --- a/server/proxy/channels/pf_channel_drdynvc.c +++ b/server/proxy/channels/pf_channel_drdynvc.c @@ -138,12 +138,39 @@ static DynvcReadResult dynvc_read_varInt(wStream* s, size_t len, UINT64* varInt, break; case 0x03: default: - WLog_ERR(TAG, "Unknown int len %d", len); + WLog_ERR(TAG, "Unknown int len %" PRIuz, len); return DYNCVC_READ_ERROR; } return DYNCVC_READ_OK; } +static const char* get_packet_type(BYTE cmd) +{ + switch (cmd) + { + case CREATE_REQUEST_PDU: + return "CREATE_REQUEST_PDU"; + case DATA_FIRST_PDU: + return "DATA_FIRST_PDU"; + case DATA_PDU: + return "DATA_PDU"; + case CLOSE_REQUEST_PDU: + return "CLOSE_REQUEST_PDU"; + case CAPABILITY_REQUEST_PDU: + return "CAPABILITY_REQUEST_PDU"; + case DATA_FIRST_COMPRESSED_PDU: + return "DATA_FIRST_COMPRESSED_PDU"; + case DATA_COMPRESSED_PDU: + return "DATA_COMPRESSED_PDU"; + case SOFT_SYNC_REQUEST_PDU: + return "SOFT_SYNC_REQUEST_PDU"; + case SOFT_SYNC_RESPONSE_PDU: + return "SOFT_SYNC_RESPONSE_PDU"; + default: + return "UNKNOWN"; + } +} + static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL firstPacket, BOOL lastPacket) { @@ -371,14 +398,15 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir if (dynChannel->openStatus != CHANNEL_OPENSTATE_OPENED) { - WLog_ERR(TAG, "DynvcTracker(%s): channel is not opened", dynChannel->channel_name); + WLog_ERR(TAG, "DynvcTracker(%s [%s]): channel is not opened", dynChannel->channel_name, + cmd); return PF_CHANNEL_RESULT_ERROR; } if ((cmd == DATA_FIRST_PDU) || (cmd == DATA_FIRST_COMPRESSED_PDU)) { - WLog_DBG(TAG, "DynvcTracker(%s): %s DATA_FIRST currentPacketLength=%d", - dynChannel->channel_name, direction, Length); + WLog_DBG(TAG, "DynvcTracker(%s [%s]): %s DATA_FIRST currentPacketLength=%" PRIu64 "", + dynChannel->channel_name, cmd, direction, Length); trackerState->currentDataLength = Length; trackerState->CurrentDataReceived = 0; trackerState->CurrentDataFragments = 0; @@ -388,8 +416,9 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir { trackerState->CurrentDataFragments++; trackerState->CurrentDataReceived += Stream_GetRemainingLength(s); - WLog_DBG(TAG, "DynvcTracker(%s): %s %s frags=%d received=%d(%d)", dynChannel->channel_name, - direction, cmd == DATA_PDU ? "DATA" : "DATA_FIRST", + WLog_DBG(TAG, + "DynvcTracker(%s [%s]): %s %s frags=%" PRIu32 " received=%" PRIu32 "(%" PRIu32 ")", + dynChannel->channel_name, cmd, direction, cmd == DATA_PDU ? "DATA" : "DATA_FIRST", trackerState->CurrentDataFragments, trackerState->CurrentDataReceived, trackerState->currentDataLength); } @@ -400,10 +429,11 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir { if (trackerState->CurrentDataReceived > trackerState->currentDataLength) { - WLog_ERR( - TAG, - "DynvcTracker: reassembled packet (%d) is bigger than announced length (%d)", - trackerState->CurrentDataReceived, trackerState->currentDataLength); + WLog_ERR(TAG, + "DynvcTracker (%s [%s]): reassembled packet (%" PRIu32 + ") is bigger than announced length (%" PRIu32 ")", + dynChannel->channel_name, cmd, trackerState->CurrentDataReceived, + trackerState->currentDataLength); return PF_CHANNEL_RESULT_ERROR; } } diff --git a/server/proxy/pf_channel.c b/server/proxy/pf_channel.c index 9f6ede13a..5b84d8e2f 100644 --- a/server/proxy/pf_channel.c +++ b/server/proxy/pf_channel.c @@ -55,7 +55,7 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE* WINPR_ASSERT(tracker); - WLog_VRB(TAG, "channelTracker_update(%s): sz=%d first=%d last=%d", + WLog_VRB(TAG, "channelTracker_update(%s): sz=%" PRIuz " first=%d last=%d", tracker->channel->channel_name, xsize, firstPacket, lastPacket); if (flags & CHANNEL_FLAG_FIRST) { @@ -81,7 +81,7 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE* } if (tracker->currentPacketReceived + xsize > tracker->currentPacketSize) - WLog_INFO(TAG, "cumulated size is bigger (%d) than total size (%d)", + WLog_INFO(TAG, "cumulated size is bigger (%" PRIuz ") than total size (%" PRIuz ")", tracker->currentPacketReceived + xsize, tracker->currentPacketSize); tracker->currentPacketReceived += xsize; @@ -110,7 +110,7 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE* { tracker->mode = CHANNEL_TRACKER_PEEK; if (tracker->currentPacketReceived != tracker->currentPacketSize) - WLog_INFO(TAG, "cumulated size(%d) does not match total size (%d)", + WLog_INFO(TAG, "cumulated size(%" PRIuz ") does not match total size (%" PRIuz ")", tracker->currentPacketReceived, tracker->currentPacketSize); } @@ -144,7 +144,7 @@ PfChannelResult channelTracker_flushCurrent(ChannelStateTracker* t, BOOL first, WINPR_ASSERT(t); - WLog_VRB(TAG, "channelTracker_flushCurrent(%s): %s sz=%d first=%d last=%d", + WLog_VRB(TAG, "channelTracker_flushCurrent(%s): %s sz=%" PRIuz " first=%d last=%d", t->channel->channel_name, direction, Stream_GetPosition(t->currentPacket), first, last); diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index d3952e9bd..d60ff6b2a 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -206,7 +206,7 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer) const char* cname = accepted_channels[i]; UINT16 channelId = WTSChannelGetId(peer, cname); - PROXY_LOG_INFO(TAG, ps, "Accepted channel: %s (%d)", cname, channelId); + PROXY_LOG_INFO(TAG, ps, "Accepted channel: %s (%" PRIu16 ")", cname, channelId); channelContext = StaticChannelContext_new(ps, cname, channelId); if (!channelContext) { @@ -411,7 +411,7 @@ static BOOL pf_server_receive_channel_data_hook(freerdp_peer* peer, UINT16 chann channel = HashTable_GetItemValue(ps->channelsById, &channelId64); if (!channel) { - PROXY_LOG_ERR(TAG, ps, "channel id=%d not registered here, dropping", channelId64); + PROXY_LOG_ERR(TAG, ps, "channel id=%" PRIu64 " not registered here, dropping", channelId64); return TRUE; } @@ -628,7 +628,7 @@ static DWORD WINAPI pf_server_handle_peer(LPVOID arg) if (status == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForMultipleObjects failed (status: %d)", status); + WLog_ERR(TAG, "WaitForMultipleObjects failed (status: %" PRIu32 ")", status); break; } diff --git a/server/shadow/X11/x11_shadow.c b/server/shadow/X11/x11_shadow.c index e24ac3a59..f60602746 100644 --- a/server/shadow/X11/x11_shadow.c +++ b/server/shadow/X11/x11_shadow.c @@ -1265,7 +1265,7 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub) if ((subsystem->depth != 24) && (subsystem->depth != 32)) { - WLog_ERR(TAG, "unsupported X11 server color depth: %d", subsystem->depth); + WLog_ERR(TAG, "unsupported X11 server color depth: %" PRIu32, subsystem->depth); return -1; } diff --git a/server/shadow/shadow_capture.c b/server/shadow/shadow_capture.c index d30bef22e..927b55fb0 100644 --- a/server/shadow/shadow_capture.c +++ b/server/shadow/shadow_capture.c @@ -215,8 +215,10 @@ int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nH WLog_INFO(TAG, "|%s|", rows[ty] ? "O" : "X"); } - WLog_INFO(TAG, "left: %d top: %d right: %d bottom: %d ncol: %d nrow: %d", l, t, r, b, ncol, - nrow); + WLog_INFO(TAG, + "left: %" PRIu32 " top: %" PRIu32 " right: %" PRIu32 " bottom: %" PRIu32 + " ncol: %" PRIu32 " nrow: %" PRIu32, + l, t, r, b, ncol, nrow); free(col_str); #endif return 1; diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 265e5a259..79861509e 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -1774,8 +1774,9 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GF pSrcData = &pSrcData[((UINT16)subY * nSrcStep) + ((UINT16)subX * 4U)]; } - // WLog_INFO(TAG, "shadow_client_send_surface_update: x: %d y: %d width: %d height: %d right: %d - // bottom: %d", nXSrc, nYSrc, nWidth, nHeight, nXSrc + nWidth, nYSrc + nHeight); + // WLog_INFO(TAG, "shadow_client_send_surface_update: x: %" PRId64 " y: %" PRId64 " width: %" + // PRId64 " height: %" PRId64 " right: %" PRId64 " bottom: %" PRId64, nXSrc, nYSrc, nWidth, + // nHeight, nXSrc + nWidth, nYSrc + nHeight); if (settings->SupportGraphicsPipeline && pStatus->gfxOpened) { diff --git a/winpr/include/winpr/stream.h b/winpr/include/winpr/stream.h index ab6d098bd..859f04cac 100644 --- a/winpr/include/winpr/stream.h +++ b/winpr/include/winpr/stream.h @@ -61,8 +61,8 @@ extern "C" WINPR_API wStream* Stream_StaticInit(wStream* s, BYTE* buffer, size_t size); WINPR_API void Stream_Free(wStream* s, BOOL bFreeBuffer); -#define Stream_CheckAndLogRequiredLength(tag, s, len) \ - Stream_CheckAndLogRequiredLengthEx(tag, WLOG_WARN, s, len, "%s(%s:%d)", __FUNCTION__, \ +#define Stream_CheckAndLogRequiredLength(tag, s, len) \ + Stream_CheckAndLogRequiredLengthEx(tag, WLOG_WARN, s, len, "%s(%s:%" PRIuz ")", __FUNCTION__, \ __FILE__, __LINE__) WINPR_API BOOL Stream_CheckAndLogRequiredLengthEx(const char* tag, DWORD level, wStream* s, UINT64 len, const char* fmt, ...); diff --git a/winpr/libwinpr/clipboard/synthetic_file.c b/winpr/libwinpr/clipboard/synthetic_file.c index b06ece9a7..099f74ceb 100644 --- a/winpr/libwinpr/clipboard/synthetic_file.c +++ b/winpr/libwinpr/clipboard/synthetic_file.c @@ -84,7 +84,7 @@ static struct synthetic_file* make_synthetic_file(const WCHAR* local_name, const hFind = FindFirstFileW(local_name, &fd); if (INVALID_HANDLE_VALUE == hFind) { - WLog_ERR(TAG, "FindFirstFile failed (%d)", GetLastError()); + WLog_ERR(TAG, "FindFirstFile failed (%" PRIu32 ")", GetLastError()); return NULL; } FindClose(hFind); @@ -330,7 +330,7 @@ static BOOL do_add_directory_contents_to_list(wClipboard* clipboard, const WCHAR BOOL bRet = FindNextFileW(hFind, &FileData); if (!bRet) { - WLog_WARN(TAG, "FindNextFile failed (%d)", GetLastError()); + WLog_WARN(TAG, "FindNextFile failed (%" PRIu32 ")", GetLastError()); if (ERROR_NO_MORE_FILES == GetLastError()) return TRUE; return FALSE; @@ -369,7 +369,7 @@ static BOOL add_directory_contents_to_list(wClipboard* clipboard, const WCHAR* l if (hFind == INVALID_HANDLE_VALUE) { - WLog_ERR(TAG, "FindFirstFile failed (%d)", GetLastError()); + WLog_ERR(TAG, "FindFirstFile failed (%" PRIu32 ")", GetLastError()); return FALSE; } @@ -1140,7 +1140,7 @@ UINT synthetic_file_read_close(struct synthetic_file* file, BOOL force) WLog_VRB(TAG, "close file %d", file->fd); if (CloseHandle(file->fd) < 0) { - WLog_WARN(TAG, "failed to close fd %d: %d", file->fd, GetLastError()); + WLog_WARN(TAG, "failed to close fd %d: %" PRIu32, file->fd, GetLastError()); } file->fd = INVALID_HANDLE_VALUE; @@ -1206,7 +1206,7 @@ static UINT file_get_range(struct synthetic_file* file, UINT64 offset, UINT32 si */ if (offset > INT64_MAX) { - WLog_ERR(TAG, "offset [%d] > INT64_MAX", offset); + WLog_ERR(TAG, "offset [%" PRIu64 "] > INT64_MAX", offset); error = ERROR_SEEK; break; } diff --git a/winpr/libwinpr/pipe/pipe.c b/winpr/libwinpr/pipe/pipe.c index 8fcf81fb8..ec7252d51 100644 --- a/winpr/libwinpr/pipe/pipe.c +++ b/winpr/libwinpr/pipe/pipe.c @@ -309,8 +309,8 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, #ifdef HAVE_SYS_AIO_H { int aio_status; - struct aiocb cb; - ZeroMemory(&cb, sizeof(struct aiocb)); + struct aiocb cb = { 0 }; + cb.aio_fildes = pipe->clientfd; cb.aio_buf = lpBuffer; cb.aio_nbytes = nNumberOfBytesToRead; @@ -396,8 +396,8 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, pipe->lpOverlapped = lpOverlapped; #ifdef HAVE_SYS_AIO_H { - struct aiocb cb; - ZeroMemory(&cb, sizeof(struct aiocb)); + struct aiocb cb = { 0 }; + cb.aio_fildes = pipe->clientfd; cb.aio_buf = (void*)lpBuffer; cb.aio_nbytes = nNumberOfBytesToWrite; @@ -407,7 +407,7 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, cb.aio_sigevent.sigev_value.sival_ptr = (void*)lpOverlapped; InstallAioSignalHandler(); io_status = aio_write(&cb); - WLog_DBG("aio_write status: %d", io_status); + WLog_DBG("aio_write status: %" PRIdz, io_status); if (io_status < 0) status = FALSE; diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.c b/winpr/libwinpr/sspi/NTLM/ntlm.c index 4afa25b31..727a7af66 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm.c @@ -1041,7 +1041,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULON } #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "Data Buffer (length = %d)", length); + WLog_DBG(TAG, "Data Buffer (length = %" PRIuz ")", length); winpr_HexDump(TAG, WLOG_DEBUG, data, length); WLog_DBG(TAG, "Encrypted Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); @@ -1134,7 +1134,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec } #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", length); + WLog_DBG(TAG, "Encrypted Data Buffer (length = %" PRIuz ")", length); winpr_HexDump(TAG, WLOG_DEBUG, data, length); WLog_DBG(TAG, "Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); diff --git a/winpr/libwinpr/synch/pollset.c b/winpr/libwinpr/synch/pollset.c index e96ab8c52..964718db9 100644 --- a/winpr/libwinpr/synch/pollset.c +++ b/winpr/libwinpr/synch/pollset.c @@ -199,7 +199,7 @@ BOOL pollset_isSignaled(WINPR_POLL_SET* set, size_t idx) { if (idx > set->fillIndex) { - WLog_ERR(TAG, "%s: index=%d out of pollset(fillIndex=%d)", __FUNCTION__, idx, + WLog_ERR(TAG, "%s: index=%d out of pollset(fillIndex=%" PRIuz ")", __FUNCTION__, idx, set->fillIndex); return FALSE; } diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index edfc8c5f7..fe1188acd 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -459,11 +459,11 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait if (status < 0) { #ifdef HAVE_POLL_H - WLog_ERR(TAG, "poll() handle %d (%" PRIu32 ") failure [%d] %s", index, nCount, - errno, strerror(errno)); + WLog_ERR(TAG, "poll() handle %" PRIu32 " (%" PRIu32 ") failure [%d] %s", index, + nCount, errno, strerror(errno)); #else - WLog_ERR(TAG, "select() handle %d (%" PRIu32 ") failure [%d] %s", index, nCount, - errno, strerror(errno)); + WLog_ERR(TAG, "select() handle %" PRIu32 " (%" PRIu32 ") failure [%d] %s", index, + nCount, errno, strerror(errno)); #endif winpr_log_backtrace(TAG, WLOG_ERROR, 20); SetLastError(ERROR_INTERNAL_ERROR); @@ -497,7 +497,7 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait DWORD rc = winpr_Handle_cleanup(lpHandles[handlesIndex]); if (rc != WAIT_OBJECT_0) { - WLog_ERR(TAG, "error in cleanup function for handle at index=%d", + WLog_ERR(TAG, "error in cleanup function for handle at index=%" PRIu32, handlesIndex); ret = rc; goto out; diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index f49e0b6f0..4827d26f5 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -384,8 +384,8 @@ winpr_get_current_time_zone_rule(const TIME_ZONE_RULE_ENTRY* rules, UINT32 count { if ((rules[i].TicksStart >= windows_time) && (windows_time >= rules[i].TicksEnd)) { - /*WLog_ERR(TAG, "Got rule %d from table at %p with count %"PRIu32"", i, (void*) rules, - * count);*/ + /*WLog_ERR(TAG, "Got rule %" PRIu32 " from table at %p with count %"PRIu32"", i, + * (void*) rules, count);*/ return &rules[i]; } } diff --git a/winpr/libwinpr/utils/wlog/wlog.c b/winpr/libwinpr/utils/wlog/wlog.c index 0542d5fab..24800343a 100644 --- a/winpr/libwinpr/utils/wlog/wlog.c +++ b/winpr/libwinpr/utils/wlog/wlog.c @@ -199,11 +199,11 @@ static BOOL log_recursion(LPCSTR file, LPCSTR fkt, size_t line) if (__android_log_print(ANDROID_LOG_FATAL, tag, "Recursion detected!!!") < 0) goto out; - if (__android_log_print(ANDROID_LOG_FATAL, tag, "Check %s [%s:%d]", fkt, file, line) < 0) + if (__android_log_print(ANDROID_LOG_FATAL, tag, "Check %s [%s:%zu]", fkt, file, line) < 0) goto out; for (i = 0; i < used; i++) - if (__android_log_print(ANDROID_LOG_FATAL, tag, "%zd: %s", i, msg[i]) < 0) + if (__android_log_print(ANDROID_LOG_FATAL, tag, "%zu: %s", i, msg[i]) < 0) goto out; #else