mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 15:39:10 +00:00
Remove newlines from error messages
This commit is contained in:
parent
d0ae093681
commit
a336b62d8b
14 changed files with 26 additions and 26 deletions
|
@ -1323,7 +1323,7 @@ static bool HIDAPI_GIP_SendPacket(SDL_DriverXboxOne_Context *ctx, struct gip_hea
|
||||||
hdr_len = HIDAPI_GIP_GetHeaderLength(hdr);
|
hdr_len = HIDAPI_GIP_GetHeaderLength(hdr);
|
||||||
size = (hdr_len + hdr->packet_length);
|
size = (hdr_len + hdr->packet_length);
|
||||||
if (size > sizeof(packet)) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1492,7 +1492,7 @@ static bool HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
||||||
|
|
||||||
if (!device || !device->driver) {
|
if (!device || !device->driver) {
|
||||||
// This should never happen - validated before being called
|
// 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));
|
hwdata = (struct joystick_hwdata *)SDL_calloc(1, sizeof(*hwdata));
|
||||||
|
|
|
@ -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);
|
hr = __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_add_GamepadAdded(wgi_state.gamepad_statics, &gamepad_added.iface, &wgi_state.gamepad_added_token);
|
||||||
if (!SUCCEEDED(hr)) {
|
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);
|
hr = __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_add_GamepadRemoved(wgi_state.gamepad_statics, &gamepad_removed.iface, &wgi_state.gamepad_removed_token);
|
||||||
if (!SUCCEEDED(hr)) {
|
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;
|
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);
|
hr = __x_ABI_CWindows_CGaming_CInput_CIGamepad_put_Vibration(gamepad_state->gamepad, gamepad_state->vibration);
|
||||||
if (!SUCCEEDED(hr)) {
|
if (!SUCCEEDED(hr)) {
|
||||||
return SDL_SetError("Setting vibration failed: 0x%lx\n", hr);
|
return SDL_SetError("Setting vibration failed: 0x%lx", hr);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2315,7 +2315,7 @@ static bool D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
|
||||||
textureSampler = rendererData->samplers[D3D11_SAMPLER_NEAREST_WRAP];
|
textureSampler = rendererData->samplers[D3D11_SAMPLER_NEAREST_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
case D3D11_FILTER_MIN_MAG_MIP_LINEAR:
|
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];
|
textureSampler = rendererData->samplers[D3D11_SAMPLER_LINEAR_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode);
|
return SDL_SetError("Unknown scale mode: %d", textureData->scaleMode);
|
||||||
}
|
}
|
||||||
#ifdef SDL_HAVE_YUV
|
#ifdef SDL_HAVE_YUV
|
||||||
if (textureData->yuv) {
|
if (textureData->yuv) {
|
||||||
|
|
|
@ -2742,7 +2742,7 @@ static bool D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
|
||||||
textureSampler = &rendererData->samplers[D3D12_SAMPLER_NEAREST_WRAP];
|
textureSampler = &rendererData->samplers[D3D12_SAMPLER_NEAREST_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
case D3D12_FILTER_MIN_MAG_MIP_LINEAR:
|
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];
|
textureSampler = &rendererData->samplers[D3D12_SAMPLER_LINEAR_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode);
|
return SDL_SetError("Unknown scale mode: %d", textureData->scaleMode);
|
||||||
}
|
}
|
||||||
#ifdef SDL_HAVE_YUV
|
#ifdef SDL_HAVE_YUV
|
||||||
if (textureData->yuv) {
|
if (textureData->yuv) {
|
||||||
|
|
|
@ -1482,7 +1482,7 @@ static bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, c
|
||||||
mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_NEAREST_WRAP];
|
mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_NEAREST_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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 {
|
} else {
|
||||||
switch (cmd->data.draw.texture_address_mode) {
|
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];
|
mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_LINEAR_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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];
|
[data.mtlcmdencoder setFragmentSamplerState:mtlsampler atIndex:0];
|
||||||
|
|
|
@ -1132,7 +1132,7 @@ static bool SetTextureAddressMode(GL_RenderData *data, GLenum textype, SDL_Textu
|
||||||
data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return SDL_SetError("Unknown texture address mode: %d\n", addressMode);
|
return SDL_SetError("Unknown texture address mode: %d", addressMode);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ static bool SetTextureAddressMode(GLES2_RenderData *data, GLenum textype, SDL_Te
|
||||||
data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return SDL_SetError("Unknown texture address mode: %d\n", addressMode);
|
return SDL_SetError("Unknown texture address mode: %d", addressMode);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3778,7 +3778,7 @@ static bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand
|
||||||
textureSampler = rendererData->samplers[VULKAN_SAMPLER_NEAREST_WRAP];
|
textureSampler = rendererData->samplers[VULKAN_SAMPLER_NEAREST_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
case VK_FILTER_LINEAR:
|
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];
|
textureSampler = rendererData->samplers[VULKAN_SAMPLER_LINEAR_WRAP];
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -921,7 +921,7 @@ static bool SDL_ConvertPixels_XRGB8888_to_YUV(int width, int height, const void
|
||||||
int plane_skip;
|
int plane_skip;
|
||||||
|
|
||||||
if (dst_pitch < row_size) {
|
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);
|
plane_skip = (dst_pitch - row_size);
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,7 @@ bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||||
&mode_count, NULL);
|
&mode_count, NULL);
|
||||||
|
|
||||||
if (mode_count == 0) {
|
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);
|
display_props[display_index].displayName);
|
||||||
goto clean;
|
goto clean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1397,7 +1397,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if (!input->xkb.keymap) {
|
if (!input->xkb.keymap) {
|
||||||
SDL_SetError("failed to compile keymap\n");
|
SDL_SetError("failed to compile keymap");
|
||||||
return;
|
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);
|
input->xkb.state = WAYLAND_xkb_state_new(input->xkb.keymap);
|
||||||
if (!input->xkb.state) {
|
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);
|
WAYLAND_xkb_keymap_unref(input->xkb.keymap);
|
||||||
input->xkb.keymap = NULL;
|
input->xkb.keymap = NULL;
|
||||||
return;
|
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,
|
input->xkb.compose_state = WAYLAND_xkb_compose_state_new(input->xkb.compose_table,
|
||||||
XKB_COMPOSE_STATE_NO_FLAGS);
|
XKB_COMPOSE_STATE_NO_FLAGS);
|
||||||
if (!input->xkb.compose_state) {
|
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);
|
WAYLAND_xkb_compose_table_unref(input->xkb.compose_table);
|
||||||
input->xkb.compose_table = NULL;
|
input->xkb.compose_table = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
icc_profile_atom = X11_XInternAtom(display, icc_atom_string, True);
|
||||||
if (icc_profile_atom == None) {
|
if (icc_profile_atom == None) {
|
||||||
SDL_SetError("Screen is not calibrated.\n");
|
SDL_SetError("Screen is not calibrated.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1887,7 +1887,7 @@ void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t
|
||||||
real_nitems = atomProp.count;
|
real_nitems = atomProp.count;
|
||||||
icc_profile_data = atomProp.data;
|
icc_profile_data = atomProp.data;
|
||||||
if (real_format == None) {
|
if (real_format == None) {
|
||||||
SDL_SetError("Screen is not calibrated.\n");
|
SDL_SetError("Screen is not calibrated.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ static int loadDeviceFunctions(VulkanVideoContext *context)
|
||||||
#define VULKAN_DEVICE_FUNCTION(name) \
|
#define VULKAN_DEVICE_FUNCTION(name) \
|
||||||
context->name = (PFN_##name)context->vkGetDeviceProcAddr(context->device, #name); \
|
context->name = (PFN_##name)context->vkGetDeviceProcAddr(context->device, #name); \
|
||||||
if (!context->name) { \
|
if (!context->name) { \
|
||||||
return SDL_SetError("vkGetDeviceProcAddr(device, \"" #name "\") failed\n"); \
|
return SDL_SetError("vkGetDeviceProcAddr(device, \"" #name "\") failed"); \
|
||||||
}
|
}
|
||||||
VULKAN_FUNCTIONS()
|
VULKAN_FUNCTIONS()
|
||||||
#undef VULKAN_GLOBAL_FUNCTION
|
#undef VULKAN_GLOBAL_FUNCTION
|
||||||
|
@ -243,7 +243,7 @@ static int createInstance(VulkanVideoContext *context)
|
||||||
result = context->vkCreateInstance(&instanceCreateInfo, NULL, &context->instance);
|
result = context->vkCreateInstance(&instanceCreateInfo, NULL, &context->instance);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
context->instance = VK_NULL_HANDLE;
|
context->instance = VK_NULL_HANDLE;
|
||||||
return SDL_SetError("vkCreateInstance(): %s\n", getVulkanResultString(result));
|
return SDL_SetError("vkCreateInstance(): %s", getVulkanResultString(result));
|
||||||
}
|
}
|
||||||
if (loadInstanceFunctions(context) < 0) {
|
if (loadInstanceFunctions(context) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue