Merge pull request #10757 from akallabeth/format-warn

[warnings] fix format warnings
This commit is contained in:
akallabeth 2024-10-17 21:41:16 +02:00 committed by GitHub
commit 02104bc2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 32 additions and 26 deletions

View File

@ -85,8 +85,13 @@ static UINT32 audin_oss_get_format(const AUDIO_FORMAT* format)
case 16:
return AFMT_S16_LE;
default:
break;
}
break;
default:
break;
}

View File

@ -112,7 +112,7 @@ static void printer_cups_get_printjob_name(char* buf, size_t size, size_t id)
WINPR_ASSERT(buf);
WINPR_ASSERT(size > 0);
(void)sprintf_s(buf, size - 1, "FreeRDP Print %04d-%02d-%02d %02d-%02d-%02d - Job %" PRIdz,
(void)sprintf_s(buf, size - 1, "FreeRDP Print %04d-%02d-%02d %02d-%02d-%02d - Job %" PRIuz,
t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec,
id);
}

View File

@ -972,7 +972,7 @@ static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrint
if (!printer_dev->device.data)
goto error_out;
(void)sprintf_s(printer_dev->port, sizeof(printer_dev->port), "PRN%" PRIdz, printer->id);
(void)sprintf_s(printer_dev->port, sizeof(printer_dev->port), "PRN%" PRIuz, printer->id);
printer_dev->device.type = RDPDR_DTYP_PRINT;
printer_dev->device.name = printer_dev->port;
printer_dev->device.IRPRequest = printer_irp_request;

View File

@ -338,6 +338,8 @@ static BOOL rdpsnd_alsa_format_supported(rdpsndDevicePlugin* device, const AUDIO
return TRUE;
}
break;
default:
break;
}

View File

@ -85,6 +85,8 @@ static int rdpsnd_oss_get_format(const AUDIO_FORMAT* format)
return AFMT_S16_LE;
}
break;
default:
break;
}

View File

@ -390,7 +390,7 @@ static BOOL rdpsnd_apply_volume(rdpsndPlugin* rdpsnd)
return TRUE;
}
static BOOL rdpsnd_ensure_device_is_open(rdpsndPlugin* rdpsnd, UINT32 wFormatNo,
static BOOL rdpsnd_ensure_device_is_open(rdpsndPlugin* rdpsnd, UINT16 wFormatNo,
const AUDIO_FORMAT* format)
{
if (!rdpsnd)

View File

@ -391,6 +391,8 @@ static UINT rdpsnd_server_select_format(RdpsndServerContext* context, UINT16 cli
if (context->priv->out_frames < bs)
context->priv->out_frames = bs;
break;
default:
break;
}

View File

@ -319,14 +319,14 @@ BOOL sdlDispContext::handle_display_event(const SDL_DisplayEvent* ev)
{
#if SDL_VERSION_ATLEAST(2, 0, 14)
case SDL_DISPLAYEVENT_CONNECTED:
SDL_Log("A new display with id %d was connected", ev->display);
SDL_Log("A new display with id %u was connected", ev->display);
return TRUE;
case SDL_DISPLAYEVENT_DISCONNECTED:
SDL_Log("The display with id %d was disconnected", ev->display);
SDL_Log("The display with id %u was disconnected", ev->display);
return TRUE;
#endif
case SDL_DISPLAYEVENT_ORIENTATION:
SDL_Log("The orientation of display with id %d was changed", ev->display);
SDL_Log("The orientation of display with id %u was changed", ev->display);
return TRUE;
default:
return TRUE;

View File

@ -317,13 +317,13 @@ BOOL sdlDispContext::handle_display_event(const SDL_DisplayEvent* ev)
switch (ev->type)
{
case SDL_EVENT_DISPLAY_ADDED:
SDL_Log("A new display with id %d was connected", ev->displayID);
SDL_Log("A new display with id %u was connected", ev->displayID);
return TRUE;
case SDL_EVENT_DISPLAY_REMOVED:
SDL_Log("The display with id %d was disconnected", ev->displayID);
SDL_Log("The display with id %u was disconnected", ev->displayID);
return TRUE;
case SDL_EVENT_DISPLAY_ORIENTATION:
SDL_Log("The orientation of display with id %d was changed", ev->displayID);
SDL_Log("The orientation of display with id %u was changed", ev->displayID);
return TRUE;
default:
return TRUE;

View File

@ -73,7 +73,7 @@ int sdl_list_monitors(SdlContext* sdl)
if (brc != 0)
continue;
printf(" %s [%d] [%s] %dx%d\t+%d+%d\n", (i == 0) ? "*" : " ", id, name, rect.w, rect.h,
printf(" %s [%u] [%s] %dx%d\t+%d+%d\n", (i == 0) ? "*" : " ", id, name, rect.w, rect.h,
rect.x, rect.y);
}
SDL_free(ids);

View File

@ -447,7 +447,7 @@ int wlf_list_monitors(wlfContext* wlc)
UwacOutputGetPosition(monitor, &pos);
UwacOutputGetResolution(monitor, &resolution);
printf(" %s [%d] %dx%d\t+%d+%d\n", (i == 0) ? "*" : " ", i, resolution.width,
printf(" %s [%u] %dx%d\t+%d+%d\n", (i == 0) ? "*" : " ", i, resolution.width,
resolution.height, pos.x, pos.y);
}

View File

@ -546,7 +546,7 @@ static char* xf_window_get_title(rdpSettings* settings)
if (!port)
(void)sprintf_s(windowTitle, size, "%s %s", prefix, name);
else
(void)sprintf_s(windowTitle, size, "%s %s:%i", prefix, name,
(void)sprintf_s(windowTitle, size, "%s %s:%" PRIu32, prefix, name,
freerdp_settings_get_uint32(settings, FreeRDP_ServerPort));
return windowTitle;

View File

@ -1726,7 +1726,7 @@ static void freerdp_client_print_tune_list(const rdpSettings* settings)
freerdp_settings_get_int16(settings, (FreeRDP_Settings_Keys_Int16)x));
break;
case RDP_SETTINGS_TYPE_UINT32:
printf("%" PRIuz "\t%50s\tUINT32\t%" PRIu32 "\n", x, name,
printf("%" PRIdz "\t%50s\tUINT32\t%" PRIu32 "\n", x, name,
freerdp_settings_get_uint32(settings, (FreeRDP_Settings_Keys_UInt32)x));
break;
case RDP_SETTINGS_TYPE_INT32:

View File

@ -111,9 +111,9 @@ const char* audio_format_get_tag_string(UINT16 wFormatTag)
case WAVE_FORMAT_AAC_MS:
return "WAVE_FORMAT_AAC_MS";
default:
return "WAVE_FORMAT_UNKNOWN";
}
return "WAVE_FORMAT_UNKNOWN";
}
void audio_format_print(wLog* log, DWORD level, const AUDIO_FORMAT* format)

View File

@ -785,23 +785,18 @@ out_fail:
char* freerdp_assistance_construct_expert_blob(const char* name, const char* pass)
{
size_t size = 0;
size_t nameLength = 0;
size_t passLength = 0;
char* ExpertBlob = NULL;
if (!name || !pass)
return NULL;
nameLength = strlen(name) + strlen("NAME=");
passLength = strlen(pass) + strlen("PASS=");
size = nameLength + passLength + 64;
ExpertBlob = (char*)calloc(1, size);
const size_t nameLength = strlen(name) + strlen("NAME=");
const size_t passLength = strlen(pass) + strlen("PASS=");
const size_t size = nameLength + passLength + 64;
char* ExpertBlob = (char*)calloc(1, size);
if (!ExpertBlob)
return NULL;
(void)sprintf_s(ExpertBlob, size, "%" PRIdz ";NAME=%s%" PRIdz ";PASS=%s", nameLength, name,
(void)sprintf_s(ExpertBlob, size, "%" PRIuz ";NAME=%s%" PRIuz ";PASS=%s", nameLength, name,
passLength, pass);
return ExpertBlob;
}

View File

@ -588,7 +588,7 @@ static BOOL http_encode_body_line(wStream* s, const char* param, const char* val
static BOOL http_encode_content_length_line(wStream* s, size_t ContentLength)
{
return http_encode_print(s, "Content-Length: %" PRIdz "\r\n", ContentLength);
return http_encode_print(s, "Content-Length: %" PRIuz "\r\n", ContentLength);
}
static BOOL http_encode_header_line(wStream* s, const char* Method, const char* URI)