mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-02 23:57:45 +08:00
Replace if() with SDL_assert()
If the if statement was not fulfilled, the pointers passed would be silently left unfilled.
This commit is contained in:
@@ -2471,11 +2471,12 @@ void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
|||||||
void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h)
|
void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h)
|
||||||
{
|
{
|
||||||
SDL_WindowData *data;
|
SDL_WindowData *data;
|
||||||
if (window->driverdata) {
|
|
||||||
|
SDL_assert(window->driverdata)
|
||||||
|
|
||||||
data = window->driverdata;
|
data = window->driverdata;
|
||||||
*w = data->current.drawable_width;
|
*w = data->current.drawable_width;
|
||||||
*h = data->current.drawable_height;
|
*h = data->current.drawable_height;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
|
void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
|
||||||
|
|||||||
Reference in New Issue
Block a user