Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SDL_properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ static void SDLCALL SDL_DumpPropertiesCallback(void *userdata, SDL_PropertiesID
case SDL_PROPERTY_TYPE_NUMBER:
{
Sint64 value = SDL_GetNumberProperty(props, name, 0);
SDL_Log("%s: %" SDL_PRIs64 " (%" SDL_PRIx64 ")", name, value, value);
SDL_Log("%s: %" SDL_PRIs64 " (%" SDL_PRIx64 ")", name, value, (Uint64)value);
}
break;
case SDL_PROPERTY_TYPE_FLOAT:
Expand Down
4 changes: 2 additions & 2 deletions src/audio/alsa/SDL_alsa_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ static bool ALSA_OpenDevice(SDL_AudioDevice *device)

//device->spec.channels = 8;
//SDL_SetLogPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE);
LOGDEBUG("channels requested %u",device->spec.channels);
LOGDEBUG("channels requested %d",device->spec.channels);
// XXX: We do not use the SDL internal swizzler yet.
device->chmap = NULL;

Expand Down Expand Up @@ -1178,7 +1178,7 @@ static bool ALSA_OpenDevice(SDL_AudioDevice *device)
snd_pcm_uframes_t bufsize;
ALSA_snd_pcm_hw_params_get_buffer_size(cfg_ctx.hwparams, &bufsize);
SDL_LogDebug(SDL_LOG_CATEGORY_AUDIO,
"ALSA: period size = %ld, periods = %u, buffer size = %lu",
"ALSA: period size = %lu, periods = %u, buffer size = %lu",
cfg_ctx.persize, cfg_ctx.periods, bufsize);
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/audio/directsound/SDL_directsound.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static bool DSOUND_Load(void)
return loaded;
}

static bool SetDSerror(const char *function, int code)
static bool SetDSerror(const char *function, HRESULT code)
{
const char *error;

Expand Down Expand Up @@ -152,7 +152,7 @@ static bool SetDSerror(const char *function, int code)
break;
}

return SDL_SetError("%s: %s (0x%x)", function, error, code);
return SDL_SetError("%s: %s (0x%lx)", function, error, (ULONG)code);
}

static void DSOUND_FreeDeviceHandle(SDL_AudioDevice *device)
Expand Down
2 changes: 1 addition & 1 deletion src/audio/wasapi/SDL_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ static bool mgmtthrtask_PrepDevice(void *userdata)
ret = IAudioClient2_SetClientProperties(client2, &audioProps);
if (FAILED(ret)) {
// This isn't fatal, let's log it instead of failing
SDL_LogWarn(SDL_LOG_CATEGORY_AUDIO, "IAudioClient2_SetClientProperties failed: 0x%lx", ret);
SDL_LogWarn(SDL_LOG_CATEGORY_AUDIO, "IAudioClient2_SetClientProperties failed: 0x%lx", (ULONG)ret);
}
IAudioClient2_Release(client2);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/windows/SDL_windowsdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ void windows_ShowFileDialog(void *ptr)
const char *opts[1] = { NULL };
callback(userdata, opts, getFilterIndex(dialog.nFilterIndex));
} else {
SDL_SetError("Windows error, CommDlgExtendedError: %ld", pCommDlgExtendedError());
SDL_SetError("Windows error, CommDlgExtendedError: %lu", pCommDlgExtendedError());
callback(userdata, NULL, -1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ int SDL_GetEventDescription(const SDL_Event *event, char *buf, int buflen)
#undef PRINT_JBUTTON_EVENT

SDL_EVENT_CASE(SDL_EVENT_JOYSTICK_BATTERY_UPDATED)
(void)SDL_snprintf(details, sizeof(details), " (timestamp=%" SDL_PRIu64 " which=%d state=%u percent=%d)",
(void)SDL_snprintf(details, sizeof(details), " (timestamp=%" SDL_PRIu64 " which=%d state=%d percent=%d)",
event->jbattery.timestamp, (int)event->jbattery.which,
event->jbattery.state, event->jbattery.percent);
break;
Expand Down
16 changes: 8 additions & 8 deletions src/gpu/d3d12/SDL_gpu_d3d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,9 +1328,9 @@ static void D3D12_INTERNAL_SetError(
// No message? Screw it, just post the code.
if (dwChars == 0) {
if (renderer->debug_mode) {
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: " HRESULT_FMT, msg, res);
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: " HRESULT_FMT, msg, (ULONG)res);
}
SDL_SetError("%s! Error Code: " HRESULT_FMT, msg, res);
SDL_SetError("%s! Error Code: " HRESULT_FMT, msg, (ULONG)res);
return;
}

Expand All @@ -1350,9 +1350,9 @@ static void D3D12_INTERNAL_SetError(
wszMsgBuff[dwChars] = '\0';

if (renderer->debug_mode) {
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, res);
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, (ULONG)res);
}
SDL_SetError("%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, res);
SDL_SetError("%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, (ULONG)res);
}

// Release / Cleanup
Expand Down Expand Up @@ -7069,7 +7069,7 @@ static bool D3D12_INTERNAL_CreateSwapchain(
SDL_LogWarn(
SDL_LOG_CATEGORY_GPU,
"Could not get swapchain parent! Error Code: " HRESULT_FMT,
res);
(ULONG)res);
} else {
// Disable DXGI window crap
res = IDXGIFactory1_MakeWindowAssociation(
Expand All @@ -7080,7 +7080,7 @@ static bool D3D12_INTERNAL_CreateSwapchain(
SDL_LogWarn(
SDL_LOG_CATEGORY_GPU,
"MakeWindowAssociation failed! Error Code: " HRESULT_FMT,
res);
(ULONG)res);
}

// We're done with the parent now
Expand Down Expand Up @@ -8996,15 +8996,15 @@ static bool D3D12_INTERNAL_GetAdapterByLuid(LUID luid, IDXGIFactory1 *factory, I
IDXGIAdapter1 *adapter;
res = IDXGIFactory1_EnumAdapters1(factory, adapterIndex, &adapter);
if (FAILED(res)) {
SDL_LogError(SDL_LOG_CATEGORY_GPU, "Failed to get an adapter when iterating, i: %d, res: %ld", adapterIndex, res);
SDL_LogError(SDL_LOG_CATEGORY_GPU, "Failed to get an adapter when iterating, i: %u, res: %ld", adapterIndex, res);
return false;
}

DXGI_ADAPTER_DESC1 adapterDesc;
res = IDXGIAdapter1_GetDesc1(adapter, &adapterDesc);
if (FAILED(res)) {
IDXGIAdapter1_Release(adapter);
SDL_LogError(SDL_LOG_CATEGORY_GPU, "Failed to get description of adapter, i: %d, res %ld", adapterIndex, res);
SDL_LogError(SDL_LOG_CATEGORY_GPU, "Failed to get description of adapter, i: %u, res %ld", adapterIndex, res);
return false;
}
if (SDL_memcmp(&adapterDesc.AdapterLuid, &luid, sizeof(luid)) == 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/gpu/vulkan/SDL_gpu_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -13258,7 +13258,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
(void)SDL_snprintf(
driverVer,
SDL_arraysize(driverVer),
"%d.%d.%d.%d",
"%u.%u.%u.%u",
(rawDriverVer >> 22) & 0x3ff,
(rawDriverVer >> 14) & 0xff,
(rawDriverVer >> 6) & 0xff,
Expand All @@ -13270,7 +13270,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
(void)SDL_snprintf(
driverVer,
SDL_arraysize(driverVer),
"%d.%d",
"%u.%u",
(rawDriverVer >> 14) & 0x3ffff,
rawDriverVer & 0x3fff);
}
Expand All @@ -13281,7 +13281,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
(void)SDL_snprintf(
driverVer,
SDL_arraysize(driverVer),
"%d.%d.%d",
"%u.%u.%u",
(rawDriverVer >> 22) & 0x3ff,
(rawDriverVer >> 12) & 0x3ff,
rawDriverVer & 0xfff);
Expand Down
2 changes: 1 addition & 1 deletion src/haptic/hidapi/SDL_hidapihaptic_lg4ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ static void *SDL_HIDAPI_HapticDriverLg4ff_Open(SDL_Joystick *joystick)
ctx->product_id = SDL_GetJoystickProduct(joystick);
ctx->release_number = SDL_GetJoystickProductVersion(joystick);

SDL_snprintf(ctx->thread_name_buf, sizeof(ctx->thread_name_buf), "SDL_hidapihaptic_lg4ff %d %04x:%04x", SDL_GetJoystickID(joystick), USB_VENDOR_ID_LOGITECH, ctx->product_id);
SDL_snprintf(ctx->thread_name_buf, sizeof(ctx->thread_name_buf), "SDL_hidapihaptic_lg4ff %u %04x:%04x", SDL_GetJoystickID(joystick), (unsigned int)USB_VENDOR_ID_LOGITECH, ctx->product_id);
ctx->stop_thread = false;
ctx->thread = SDL_CreateThread(SDL_HIDAPI_HapticDriverLg4ff_ThreadFunction, ctx->thread_name_buf, ctx);

Expand Down
4 changes: 2 additions & 2 deletions src/joystick/controller_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ static const char *GetControllerTypeOverride( int nVID, int nPID )
char key[32];
const char *spot = NULL;

SDL_snprintf(key, sizeof(key), "0x%.4x/0x%.4x=", nVID, nPID);
SDL_snprintf(key, sizeof(key), "0x%.4x/0x%.4x=", (unsigned int)nVID, (unsigned int)nPID);
spot = SDL_strstr(hint, key);
if (!spot) {
SDL_snprintf(key, sizeof(key), "0x%.4X/0x%.4X=", nVID, nPID);
SDL_snprintf(key, sizeof(key), "0x%.4X/0x%.4X=", (unsigned int)nVID, (unsigned int)nPID);
spot = SDL_strstr(hint, key);
}
if (spot) {
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/hidapi/SDL_hidapi_gip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,7 @@ static void GIP_ReceivePacket(GIP_Device *device, const Uint8 *bytes, int num_by
offset += GIP_DecodeLength(&fragment_offset, &bytes[offset], num_bytes - offset);
if (fragment_offset != attachment->fragment_offset) {
SDL_LogWarn(SDL_LOG_CATEGORY_INPUT,
"GIP: Received out of sequence fragment, (claimed %" SDL_PRIu64 ", expected %d)",
"GIP: Received out of sequence fragment, (claimed %" SDL_PRIu64 ", expected %u)",
fragment_offset, attachment->fragment_offset);
GIP_Acknowledge(device,
&header,
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/windows/SDL_dinputjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ const DIDATAFORMAT SDL_c_dfDIJoystick2 = {
// Convert a DirectInput return code to a text message
static bool SetDIerror(const char *function, HRESULT code)
{
return SDL_SetError("%s() DirectX error 0x%8.8lx", function, code);
return SDL_SetError("%s() DirectX error 0x%8.8lx", function, (ULONG)code);
}

static bool SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char *hidPath)
Expand Down
6 changes: 3 additions & 3 deletions src/joystick/windows/SDL_rawinputjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,12 @@ static void RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx)

hr = __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_add_GamepadAdded(wgi_state.gamepad_statics, &gamepad_added.iface, &wgi_state.gamepad_added_token);
if (!SUCCEEDED(hr)) {
SDL_SetError("add_GamepadAdded() failed: 0x%lx", hr);
SDL_SetError("add_GamepadAdded() failed: 0x%lx", (ULONG)hr);
}

hr = __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_add_GamepadRemoved(wgi_state.gamepad_statics, &gamepad_removed.iface, &wgi_state.gamepad_removed_token);
if (!SUCCEEDED(hr)) {
SDL_SetError("add_GamepadRemoved() failed: 0x%lx", hr);
SDL_SetError("add_GamepadRemoved() failed: 0x%lx", (ULONG)hr);
}
}
}
Expand Down Expand Up @@ -1506,7 +1506,7 @@ static bool RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_
WindowsGamingInputGamepadState *gamepad_state = ctx->wgi_slot;
HRESULT hr = __x_ABI_CWindows_CGaming_CInput_CIGamepad_put_Vibration(gamepad_state->gamepad, ctx->vibration);
if (!SUCCEEDED(hr)) {
return SDL_SetError("Setting vibration failed: 0x%lx", hr);
return SDL_SetError("Setting vibration failed: 0x%lx", (ULONG)hr);
}
ctx->triggers_rumbling = (left_rumble > 0 || right_rumble > 0);
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/test/SDL_test_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ void SDLTest_PrintEvent(const SDL_Event *event)
event->jaxis.value);
break;
case SDL_EVENT_JOYSTICK_BALL_MOTION:
SDL_Log("SDL EVENT: Joystick %" SDL_PRIs32 ": ball %d moved by %d,%d",
SDL_Log("SDL EVENT: Joystick %" SDL_PRIu32 ": ball %d moved by %d,%d",
event->jball.which, event->jball.ball, event->jball.xrel,
event->jball.yrel);
break;
Expand Down Expand Up @@ -2018,7 +2018,7 @@ void SDLTest_PrintEvent(const SDL_Event *event)
event->pmotion.which, event->pmotion.x, event->pmotion.y);
break;
case SDL_EVENT_PEN_AXIS:
SDL_Log("SDL EVENT: Pen %" SDL_PRIu32 " axis %d changed to %.2f",
SDL_Log("SDL EVENT: Pen %" SDL_PRIu32 " axis %u changed to %.2f",
event->paxis.which, event->paxis.axis, event->paxis.value);
break;
case SDL_EVENT_LOCALE_CHANGED:
Expand Down
2 changes: 1 addition & 1 deletion src/test/SDL_test_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void SDLTest_LogAllocations(void)
}
dyn_dbghelp.pSymGetLineFromAddr64(GetCurrentProcess(), (DWORD64)entry->stack[stack_index], &lineColumn, &dbg_line);
}
SDL_snprintf(stack_entry_description, sizeof(stack_entry_description), "%s+0x%I64x %s:%u", pSymbol->Name, dwDisplacement, dbg_line.FileName, (Uint32)dbg_line.LineNumber);
SDL_snprintf(stack_entry_description, sizeof(stack_entry_description), "%s+0x%" SDL_PRIx64 " %s:%u", pSymbol->Name, dwDisplacement, dbg_line.FileName, (Uint32)dbg_line.LineNumber);
}
#endif
(void)SDL_snprintf(line, sizeof(line), "\t0x%" SDL_PRIx64 ": %s\n", entry->stack[stack_index], stack_entry_description);
Expand Down
Loading
Loading