re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory

This commit is contained in:
pionere
2022-01-17 17:22:30 +01:00
committed by Ryan C. Gordon
parent ebdd536676
commit 60deadba59
18 changed files with 52 additions and 102 deletions

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. */