mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-18 12:08:58 +00:00
Prefer SDL_zero()/SDL_zerop()
Replace uses of 'SDL_memset(E, 0, sizeof(E))' and similar with the SDL_zero()/SDL_zerop() macros.
This commit is contained in:
parent
fe403220f0
commit
83fb7b6636
17 changed files with 30 additions and 30 deletions
|
|
@ -1166,7 +1166,7 @@ bool SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic,
|
|||
FFEFFECT temp;
|
||||
|
||||
// Get the effect.
|
||||
SDL_memset(&temp, 0, sizeof(FFEFFECT));
|
||||
SDL_zero(temp);
|
||||
if (!SDL_SYS_ToFFEFFECT(haptic, &temp, data)) {
|
||||
goto err_update;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -694,9 +694,9 @@ static int lg4ff_init_slots(struct lg4ff_device *device)
|
|||
return -1;
|
||||
}
|
||||
|
||||
SDL_memset(&device->states, 0, sizeof(device->states));
|
||||
SDL_memset(&device->slots, 0, sizeof(device->slots));
|
||||
SDL_memset(¶meters, 0, sizeof(parameters));
|
||||
SDL_zero(device->states);
|
||||
SDL_zero(device->slots);
|
||||
SDL_zero(parameters);
|
||||
|
||||
device->slots[0].effect_type = SDL_HAPTIC_CONSTANT;
|
||||
device->slots[1].effect_type = SDL_HAPTIC_SPRING;
|
||||
|
|
|
|||
|
|
@ -1050,7 +1050,7 @@ bool SDL_DINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *eff
|
|||
DIEFFECT temp;
|
||||
|
||||
// Get the effect.
|
||||
SDL_memset(&temp, 0, sizeof(DIEFFECT));
|
||||
SDL_zero(temp);
|
||||
if (!SDL_SYS_ToDIEFFECT(haptic, &temp, data)) {
|
||||
goto err_update;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue