The parameter to SDL_AppEvent() should be non-const

This allows functions like SDL_ConvertEventToRenderCoordinates() to work without having to copy the event.

Fixes https://github.com/libsdl-org/SDL/issues/10691
This commit is contained in:
Sam Lantinga
2024-09-03 07:45:30 -07:00
parent b1b4a9cd1b
commit 575d9cda6f
20 changed files with 20 additions and 20 deletions

View File

@@ -120,7 +120,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
return (event->type == SDL_EVENT_QUIT) ? SDL_APP_SUCCESS : SDL_APP_CONTINUE;
}

View File

@@ -1114,7 +1114,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
static SDL_bool saw_event = SDL_FALSE;
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
Thing *thing = NULL;

View File

@@ -149,7 +149,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv)
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
if (event->type == SDL_EVENT_QUIT) {
return SDL_APP_SUCCESS;

View File

@@ -216,7 +216,7 @@ static int FlipCamera(void)
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
switch (event->type) {
case SDL_EVENT_KEY_DOWN: {

View File

@@ -70,7 +70,7 @@ onerror:
return SDL_APP_FAILURE;
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
dropfile_dialog *dialog = appstate;
if (event->type == SDL_EVENT_DROP_BEGIN) {

View File

@@ -70,7 +70,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
return SDLTest_CommonEventMainCallbacks(state, event);
}

View File

@@ -107,7 +107,7 @@ static Pen *FindPen(SDL_PenID which)
return NULL;
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
Pen *pen = NULL;

View File

@@ -551,7 +551,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
}
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
return SDLTest_CommonEventMainCallbacks(state, event);
}