소스 검색

Replace if() with SDL_assert()

If the if statement was not fulfilled, the pointers passed would be silently left unfilled.
Semphris 1 년 전
부모
커밋
0429f5d6a3
1개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 6 5
      src/video/wayland/SDL_waylandwindow.c

+ 6 - 5
src/video/wayland/SDL_waylandwindow.c

@@ -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)
 {
     SDL_WindowData *data;
-    if (window->driverdata) {
-        data = window->driverdata;
-        *w = data->current.drawable_width;
-        *h = data->current.drawable_height;
-    }
+
+    SDL_assert(window->driverdata)
+
+    data = window->driverdata;
+    *w = data->current.drawable_width;
+    *h = data->current.drawable_height;
 }
 
 void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)