Clang-Tidy fixes (#6725)

(cherry picked from commit 3c501b963d)
This commit is contained in:
Pierre Wendling
2022-12-01 16:07:03 -05:00
committed by Sam Lantinga
parent e29c0661cc
commit d0bbfdbfb8
179 changed files with 1260 additions and 1101 deletions

View File

@@ -160,8 +160,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);
}
@@ -673,9 +672,9 @@ 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 {
float f = SDL_atan2(src->dir[1], src->dir[0]); /* Ideally we'd use fixed point math instead of floats... */