mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-07 02:16:26 +00:00
Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!)
This commit is contained in:
@@ -125,14 +125,14 @@ SDL_HapticOpen(int device_index)
|
||||
}
|
||||
|
||||
/* Create the haptic device */
|
||||
haptic = (SDL_Haptic *)SDL_malloc((sizeof *haptic));
|
||||
haptic = (SDL_Haptic *)SDL_malloc(sizeof(*haptic));
|
||||
if (haptic == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Initialize the haptic device */
|
||||
SDL_memset(haptic, 0, (sizeof *haptic));
|
||||
SDL_memset(haptic, 0, sizeof(*haptic));
|
||||
haptic->rumble_id = -1;
|
||||
haptic->index = device_index;
|
||||
if (SDL_SYS_HapticOpen(haptic) < 0) {
|
||||
@@ -299,7 +299,7 @@ SDL_HapticOpenFromJoystick(SDL_Joystick *joystick)
|
||||
}
|
||||
|
||||
/* Create the haptic device */
|
||||
haptic = (SDL_Haptic *)SDL_malloc((sizeof *haptic));
|
||||
haptic = (SDL_Haptic *)SDL_malloc(sizeof(*haptic));
|
||||
if (haptic == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
SDL_UnlockJoysticks();
|
||||
|
@@ -88,7 +88,7 @@ int SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid)
|
||||
/* !!! FIXME: I'm not bothering to query for a real name right now (can we even?) */
|
||||
{
|
||||
char buf[64];
|
||||
(void)SDL_snprintf(buf, sizeof buf, "XInput Controller #%u", userid + 1);
|
||||
(void)SDL_snprintf(buf, sizeof(buf), "XInput Controller #%u", userid + 1);
|
||||
item->name = SDL_strdup(buf);
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ static int SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 us
|
||||
return SDL_SetError("Couldn't create XInput haptic mutex");
|
||||
}
|
||||
|
||||
(void)SDL_snprintf(threadName, sizeof threadName, "SDLXInputDev%u", userid);
|
||||
(void)SDL_snprintf(threadName, sizeof(threadName), "SDLXInputDev%d", userid);
|
||||
haptic->hwdata->thread = SDL_CreateThreadInternal(SDL_RunXInputHaptic, threadName, 64 * 1024, haptic->hwdata);
|
||||
|
||||
if (haptic->hwdata->thread == NULL) {
|
||||
|
Reference in New Issue
Block a user