re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory

This commit is contained in:
pionere authored and Ryan C. Gordon committed 2022-01-28 20:40:19 -05:00
1 parent ebdd536676
commit 60deadba59
18 files changed
+52 -102

No files matched your search

+2 -4
View File
@@ -492,8 +492,7 @@ SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
++index;
}
SDL_SetError("Couldn't find joystick in haptic device list");
return -1;
return SDL_SetError("Couldn't find joystick in haptic device list");
}
void
@@ -959,8 +958,7 @@ SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SD
REFGUID type = SDL_SYS_HapticEffectType(base);
if (type == NULL) {
SDL_SetError("Haptic: Unknown effect type.");
return -1;
return SDL_SetError("Haptic: Unknown effect type.");
}
/* Get the effect. */
+1 -2
View File
@@ -246,8 +246,7 @@ SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
++index;
}
SDL_SetError("Couldn't find joystick in haptic device list");
return -1;
return SDL_SetError("Couldn't find joystick in haptic device list");
}
void