Simplify flags testing (#7220)

This commit is contained in:
Sylvain Becker
2023-02-03 22:08:42 +01:00
committed by GitHub
parent dcd17f5473
commit cb6b8b0132
46 changed files with 218 additions and 218 deletions

View File

@@ -532,7 +532,7 @@ WatchJoystick(SDL_Joystick *joystick)
break;
}
if ((event.key.keysym.sym != SDLK_ESCAPE)) {
if (event.key.keysym.sym != SDLK_ESCAPE) {
break;
}
SDL_FALLTHROUGH;
@@ -766,7 +766,7 @@ int main(int argc, char *argv[])
while (SDL_PollEvent(&event) > 0) {
switch (event.type) {
case SDL_EVENT_KEY_DOWN:
if ((event.key.keysym.sym != SDLK_ESCAPE)) {
if (event.key.keysym.sym != SDLK_ESCAPE) {
break;
}
SDL_FALLTHROUGH;

View File

@@ -349,7 +349,7 @@ static SDL_bool ShowingFront()
}
}
}
if ((SDL_GetModState() & SDL_KMOD_SHIFT) != 0) {
if (SDL_GetModState() & SDL_KMOD_SHIFT) {
showing_front = SDL_FALSE;
}
return showing_front;

View File

@@ -731,7 +731,7 @@ int main(int argc, char *argv[])
if (textlen == 0) {
break;
}
if ((text[textlen - 1] & 0x80) == 0x00) {
if (!(text[textlen - 1] & 0x80)) {
/* One byte */
text[textlen - 1] = 0x00;
break;