mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
Clang-Tidy fixes (#6725)
This commit is contained in:
@@ -152,8 +152,7 @@ int SDL_SYS_HapticInit(void)
|
||||
*/
|
||||
i = 0;
|
||||
for (j = 0; j < MAX_HAPTICS; ++j) {
|
||||
|
||||
SDL_snprintf(path, PATH_MAX, joydev_pattern, i++);
|
||||
(void)SDL_snprintf(path, PATH_MAX, joydev_pattern, i++);
|
||||
MaybeAddDevice(path);
|
||||
}
|
||||
|
||||
@@ -665,11 +664,11 @@ static int SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection *src)
|
||||
break;
|
||||
|
||||
case SDL_HAPTIC_CARTESIAN:
|
||||
if (!src->dir[1])
|
||||
if (!src->dir[1]) {
|
||||
*dest = (src->dir[0] >= 0 ? 0x4000 : 0xC000);
|
||||
else if (!src->dir[0])
|
||||
} else if (!src->dir[0]) {
|
||||
*dest = (src->dir[1] >= 0 ? 0x8000 : 0);
|
||||
else {
|
||||
} else {
|
||||
float f = SDL_atan2(src->dir[1], src->dir[0]); /* Ideally we'd use fixed point math instead of floats... */
|
||||
/*
|
||||
SDL_atan2 takes the parameters: Y-axis-value and X-axis-value (in that order)
|
||||
|
Reference in New Issue
Block a user