Add `default: break;` to switches on SDL_Event::type
This is just a nice-to-have, as `SDL_Event::type` in an `Uint32`, so there are no compiler errors about not handling all `SDL_EventType` enum values.main
parent
722f4104bf
commit
01248a99c8
|
@ -2422,6 +2422,8 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event
|
||||||
}
|
}
|
||||||
case SDL_EVENT_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
return 1;
|
return 1;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; /* keep going */
|
return 0; /* keep going */
|
||||||
|
|
|
@ -202,6 +202,8 @@ int SDL_AppEvent(const SDL_Event *event)
|
||||||
SDL_Log("Camera denied!");
|
SDL_Log("Camera denied!");
|
||||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Camera permission denied!", "User denied access to the camera!", window);
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Camera permission denied!", "User denied access to the camera!", window);
|
||||||
return -1;
|
return -1;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SDLTest_CommonEventMainCallbacks(state, event);
|
return SDLTest_CommonEventMainCallbacks(state, event);
|
||||||
|
|
|
@ -153,6 +153,8 @@ int main(int argc, char **argv)
|
||||||
case SDL_EVENT_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
done = 1;
|
done = 1;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,8 @@ int main(int argc, char *argv[])
|
||||||
case SDL_EVENT_JOYSTICK_BUTTON_UP:
|
case SDL_EVENT_JOYSTICK_BUTTON_UP:
|
||||||
SDL_Log("Button Release: %d\n", event.jbutton.button);
|
SDL_Log("Button Release: %d\n", event.jbutton.button);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,8 @@ static void loop(void)
|
||||||
case SDL_EVENT_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
done = SDL_TRUE;
|
done = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,8 @@ static void loop(void)
|
||||||
if (event.key.keysym.sym != SDLK_ESCAPE) {
|
if (event.key.keysym.sym != SDLK_ESCAPE) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ static void loop(void)
|
||||||
mouseX += event.motion.xrel;
|
mouseX += event.motion.xrel;
|
||||||
mouseY += event.motion.yrel;
|
mouseY += event.motion.yrel;
|
||||||
} break;
|
} break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < state->num_windows; ++i) {
|
for (i = 0; i < state->num_windows; ++i) {
|
||||||
|
|
|
@ -114,6 +114,8 @@ static void loop(void)
|
||||||
case SDL_EVENT_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
done = SDL_TRUE;
|
done = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue