Clang-Tidy fixes (#6725)

This commit is contained in:
Pierre Wendling
2022-12-01 16:07:03 -05:00
committed by GitHub
parent c2ce44bead
commit 3c501b963d
184 changed files with 1312 additions and 1154 deletions

View File

@@ -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)