diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c index d0c93cfcb4..342eabdf75 100644 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c @@ -1323,7 +1323,7 @@ static bool HIDAPI_GIP_SendPacket(SDL_DriverXboxOne_Context *ctx, struct gip_hea hdr_len = HIDAPI_GIP_GetHeaderLength(hdr); size = (hdr_len + hdr->packet_length); if (size > sizeof(packet)) { - SDL_SetError("Couldn't send GIP packet, size (%d) too large\n", size); + SDL_SetError("Couldn't send GIP packet, size (%d) too large", size); return false; } diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 30bae026fd..54545eb854 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -1492,7 +1492,7 @@ static bool HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index) if (!device || !device->driver) { // This should never happen - validated before being called - return SDL_SetError("Couldn't find HIDAPI device at index %d\n", device_index); + return SDL_SetError("Couldn't find HIDAPI device at index %d", device_index); } hwdata = (struct joystick_hwdata *)SDL_calloc(1, sizeof(*hwdata)); diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index d5adc2daa3..d5166def0a 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -703,12 +703,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\n", hr); + SDL_SetError("add_GamepadAdded() failed: 0x%lx", 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\n", hr); + SDL_SetError("add_GamepadRemoved() failed: 0x%lx", hr); } } } @@ -1511,7 +1511,7 @@ static bool RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_ gamepad_state->vibration.RightTrigger = (DOUBLE)right_rumble / SDL_MAX_UINT16; hr = __x_ABI_CWindows_CGaming_CInput_CIGamepad_put_Vibration(gamepad_state->gamepad, gamepad_state->vibration); if (!SUCCEEDED(hr)) { - return SDL_SetError("Setting vibration failed: 0x%lx\n", hr); + return SDL_SetError("Setting vibration failed: 0x%lx", hr); } return true; } else { diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index b723877a03..45943e247c 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -2315,7 +2315,7 @@ static bool D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand * textureSampler = rendererData->samplers[D3D11_SAMPLER_NEAREST_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } break; case D3D11_FILTER_MIN_MAG_MIP_LINEAR: @@ -2327,11 +2327,11 @@ static bool D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand * textureSampler = rendererData->samplers[D3D11_SAMPLER_LINEAR_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } break; default: - return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode); + return SDL_SetError("Unknown scale mode: %d", textureData->scaleMode); } #ifdef SDL_HAVE_YUV if (textureData->yuv) { diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 3785a7d95b..64f0474015 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -2742,7 +2742,7 @@ static bool D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand * textureSampler = &rendererData->samplers[D3D12_SAMPLER_NEAREST_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } break; case D3D12_FILTER_MIN_MAG_MIP_LINEAR: @@ -2754,11 +2754,11 @@ static bool D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand * textureSampler = &rendererData->samplers[D3D12_SAMPLER_LINEAR_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } break; default: - return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode); + return SDL_SetError("Unknown scale mode: %d", textureData->scaleMode); } #ifdef SDL_HAVE_YUV if (textureData->yuv) { diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 0aac565d38..63d9770d50 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -1482,7 +1482,7 @@ static bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, c mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_NEAREST_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } } else { switch (cmd->data.draw.texture_address_mode) { @@ -1493,7 +1493,7 @@ static bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, c mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_LINEAR_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } } [data.mtlcmdencoder setFragmentSamplerState:mtlsampler atIndex:0]; diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 64164a6d8b..d5344382aa 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1132,7 +1132,7 @@ static bool SetTextureAddressMode(GL_RenderData *data, GLenum textype, SDL_Textu data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT); break; default: - return SDL_SetError("Unknown texture address mode: %d\n", addressMode); + return SDL_SetError("Unknown texture address mode: %d", addressMode); } return true; } diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index a4c5dec154..44656293ff 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1041,7 +1041,7 @@ static bool SetTextureAddressMode(GLES2_RenderData *data, GLenum textype, SDL_Te data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT); break; default: - return SDL_SetError("Unknown texture address mode: %d\n", addressMode); + return SDL_SetError("Unknown texture address mode: %d", addressMode); } return true; } diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 8cfc3a4ad7..7398315a85 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -3778,7 +3778,7 @@ static bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand textureSampler = rendererData->samplers[VULKAN_SAMPLER_NEAREST_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } break; case VK_FILTER_LINEAR: @@ -3790,7 +3790,7 @@ static bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand textureSampler = rendererData->samplers[VULKAN_SAMPLER_LINEAR_WRAP]; break; default: - return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + return SDL_SetError("Unknown texture address mode: %d", cmd->data.draw.texture_address_mode); } break; default: diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index da8116e9a9..ccacfcf461 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -921,7 +921,7 @@ static bool SDL_ConvertPixels_XRGB8888_to_YUV(int width, int height, const void int plane_skip; if (dst_pitch < row_size) { - return SDL_SetError("Destination pitch is too small, expected at least %d\n", row_size); + return SDL_SetError("Destination pitch is too small, expected at least %d", row_size); } plane_skip = (dst_pitch - row_size); diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.c b/src/video/kmsdrm/SDL_kmsdrmvulkan.c index dd50d39efd..d58277b789 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.c +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.c @@ -328,7 +328,7 @@ bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, &mode_count, NULL); if (mode_count == 0) { - SDL_SetError("Vulkan can't find any video modes for display %i (%s)\n", 0, + SDL_SetError("Vulkan can't find any video modes for display %i (%s)", 0, display_props[display_index].displayName); goto clean; } diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index c63721ec3d..8519b245ef 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1397,7 +1397,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, close(fd); if (!input->xkb.keymap) { - SDL_SetError("failed to compile keymap\n"); + SDL_SetError("failed to compile keymap"); return; } @@ -1422,7 +1422,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, } input->xkb.state = WAYLAND_xkb_state_new(input->xkb.keymap); if (!input->xkb.state) { - SDL_SetError("failed to create XKB state\n"); + SDL_SetError("failed to create XKB state"); WAYLAND_xkb_keymap_unref(input->xkb.keymap); input->xkb.keymap = NULL; return; @@ -1472,7 +1472,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, input->xkb.compose_state = WAYLAND_xkb_compose_state_new(input->xkb.compose_table, XKB_COMPOSE_STATE_NO_FLAGS); if (!input->xkb.compose_state) { - SDL_SetError("could not create XKB compose state\n"); + SDL_SetError("could not create XKB compose state"); WAYLAND_xkb_compose_table_unref(input->xkb.compose_table); input->xkb.compose_table = NULL; } diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index c3c125eafe..c8c0ffd737 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1878,7 +1878,7 @@ void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t icc_profile_atom = X11_XInternAtom(display, icc_atom_string, True); if (icc_profile_atom == None) { - SDL_SetError("Screen is not calibrated.\n"); + SDL_SetError("Screen is not calibrated."); return NULL; } @@ -1887,7 +1887,7 @@ void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t real_nitems = atomProp.count; icc_profile_data = atomProp.data; if (real_format == None) { - SDL_SetError("Screen is not calibrated.\n"); + SDL_SetError("Screen is not calibrated."); return NULL; } diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c index e0a0ad4506..4f2ba81120 100644 --- a/test/testffmpeg_vulkan.c +++ b/test/testffmpeg_vulkan.c @@ -146,7 +146,7 @@ static int loadDeviceFunctions(VulkanVideoContext *context) #define VULKAN_DEVICE_FUNCTION(name) \ context->name = (PFN_##name)context->vkGetDeviceProcAddr(context->device, #name); \ if (!context->name) { \ - return SDL_SetError("vkGetDeviceProcAddr(device, \"" #name "\") failed\n"); \ + return SDL_SetError("vkGetDeviceProcAddr(device, \"" #name "\") failed"); \ } VULKAN_FUNCTIONS() #undef VULKAN_GLOBAL_FUNCTION @@ -243,7 +243,7 @@ static int createInstance(VulkanVideoContext *context) result = context->vkCreateInstance(&instanceCreateInfo, NULL, &context->instance); if (result != VK_SUCCESS) { context->instance = VK_NULL_HANDLE; - return SDL_SetError("vkCreateInstance(): %s\n", getVulkanResultString(result)); + return SDL_SetError("vkCreateInstance(): %s", getVulkanResultString(result)); } if (loadInstanceFunctions(context) < 0) { return -1;