From: huiyu.eun Date: Thu, 26 Jul 2018 08:33:25 +0000 (+0900) Subject: [SDL_Tizen] Fix build warnings X-Git-Tag: accepted/tizen/unified/20180813.152534^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2FSDL.git;a=commitdiff_plain;h=cd7343a6adbd4b0593db5e29a9a9ae5a97cd09be [SDL_Tizen] Fix build warnings Change-Id: Icdcf1cb45dff488b9ea6b9290b143ab19334a2d3 Signed-off-by: huiyu.eun --- diff --git a/extension/SDL2_image-2.0.3/IMG_bmp.c b/extension/SDL2_image-2.0.3/IMG_bmp.c index 4ddee41..b10b6f6 100755 --- a/extension/SDL2_image-2.0.3/IMG_bmp.c +++ b/extension/SDL2_image-2.0.3/IMG_bmp.c @@ -244,11 +244,11 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc) /* The Win32 BITMAPINFOHEADER struct (40 bytes) */ Uint32 biSize; - Sint32 biWidth; + Sint32 biWidth = 0; Sint32 biHeight = 0; Uint16 biPlanes; - Uint16 biBitCount; - Uint32 biCompression; + Uint16 biBitCount = 0; + Uint32 biCompression = BI_RGB; Uint32 biSizeImage; Sint32 biXPelsPerMeter; Sint32 biYPelsPerMeter; diff --git a/src/joystick/tizen/SDL_sysjoystick.c b/src/joystick/tizen/SDL_sysjoystick.c index 09cd7a1..4e4dcfe 100755 --- a/src/joystick/tizen/SDL_sysjoystick.c +++ b/src/joystick/tizen/SDL_sysjoystick.c @@ -53,7 +53,6 @@ _tizen_cb_event_joystick_change(void *data, int type EINA_UNUSED, void *event) switch (ev->type) { #if !SDL_EVENTS_DISABLED - SDL_Event event; #endif /* !SDL_EVENTS_DISABLED */ case ECORE_EVENT_JOYSTICK_EVENT_TYPE_CONNECTED: s_bDeviceAttached = SDL_TRUE; diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index 423ee98..108dc22 100755 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -37,7 +37,7 @@ #define SDLTEST_FINAL_RESULT_FORMAT ">>> %s '%s': %s\n" /* ! \brief Timeout for single test case execution */ -static Uint32 SDLTest_TestCaseTimeout = 3600; +//static Uint32 SDLTest_TestCaseTimeout = 3600; /** * Generates a random run seed string for the harness. The generated seed @@ -167,6 +167,7 @@ SDLTest_GenerateExecKey(const char *runSeed, char *suiteName, char *testName, in * * \return Timer id or -1 on failure. */ +/* static SDL_TimerID SDLTest_SetTestTimeout(int timeout, void (*callback)()) { @@ -183,7 +184,7 @@ SDLTest_SetTestTimeout(int timeout, void (*callback)()) return -1; } - /* Init SDL timer if not initialized before */ + //Init SDL timer if not initialized before if (SDL_WasInit(SDL_INIT_TIMER) == 0) { if (SDL_InitSubSystem(SDL_INIT_TIMER)) { SDLTest_LogError("Failed to init timer subsystem: %s", SDL_GetError()); @@ -191,7 +192,7 @@ SDLTest_SetTestTimeout(int timeout, void (*callback)()) } } - /* Set timer */ + // Set timer timeoutInMilliseconds = timeout * 1000; timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback)callback, 0x0); if (timerID == 0) { @@ -201,16 +202,19 @@ SDLTest_SetTestTimeout(int timeout, void (*callback)()) return timerID; } +*/ /** * \brief Timeout handler. Aborts test run and exits harness process. */ +/* static SDL_NORETURN void SDLTest_BailOut() { SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run."); - exit(TEST_ABORTED); /* bail out from the test */ + exit(TEST_ABORTED); // bail out from the test } +*/ /** * \brief Execute a test using the given execution key. diff --git a/src/video/tizen/SDL_tizenmouse.c b/src/video/tizen/SDL_tizenmouse.c index 04f5ad7..b762c82 100755 --- a/src/video/tizen/SDL_tizenmouse.c +++ b/src/video/tizen/SDL_tizenmouse.c @@ -166,7 +166,7 @@ Tizen_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) surface->pixels, surface->h * surface->pitch); - data->surface = wl_compositor_create_surface(ecore_wl2_display_compositor_get(wl2_display)); + data->surface = (Ecore_Wl2_Surface*) wl_compositor_create_surface(ecore_wl2_display_compositor_get(wl2_display)); data->hot_x = hot_x; data->hot_y = hot_y; @@ -202,7 +202,7 @@ Tizen_FreeCursor(SDL_Cursor *cursor) wl_buffer_destroy(d->buffer); if (d->surface) - wl_surface_destroy(d->surface); + wl_surface_destroy((struct wl_surface*)d->surface); /* Not sure what's meant to happen to shm_data */ free (cursor->driverdata); diff --git a/src/video/tizen/SDL_tizenopengles.c b/src/video/tizen/SDL_tizenopengles.c index aedf463..6fad59e 100755 --- a/src/video/tizen/SDL_tizenopengles.c +++ b/src/video/tizen/SDL_tizenopengles.c @@ -62,10 +62,10 @@ Tizen_GLES_CreateContext(_THIS, SDL_Window *window) return context; } -void +int Tizen_GLES_SwapWindow(_THIS, SDL_Window *window) { - SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); + int ret = SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); SDL_WindowData* wind = (SDL_WindowData*)window->driverdata; int x, y, w, h; if (wind->received_rotation != TIZEN_ROTATION_RECEIVED_NONE) { @@ -86,6 +86,7 @@ Tizen_GLES_SwapWindow(_THIS, SDL_Window *window) _tizen_quickpanel_on(window->driverdata); } } + return ret; } int diff --git a/src/video/tizen/SDL_tizenopengles.h b/src/video/tizen/SDL_tizenopengles.h index cd14cae..4b0fba4 100755 --- a/src/video/tizen/SDL_tizenopengles.h +++ b/src/video/tizen/SDL_tizenopengles.h @@ -41,7 +41,7 @@ typedef struct SDL_PrivateGLESData { extern int Tizen_GLES_LoadLibrary(_THIS, const char *path); extern SDL_GLContext Tizen_GLES_CreateContext(_THIS, SDL_Window *window); -extern void Tizen_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int Tizen_GLES_SwapWindow(_THIS, SDL_Window *window); extern int Tizen_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern void Tizen_GLES_DeleteContext(_THIS, SDL_GLContext context); extern int Tizen_GLES_GetAlphaSize(_THIS); diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index 0b6734a..26bd3f5 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -428,7 +428,6 @@ _tizen_rotation_do(SDL_Window *window, SDL_WindowData* wind, int rotation) _tizen_set_window_size(window, window_w, window_h); - SDL_VideoData* _this = SDL_GetVideoDevice()->driverdata; #if SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) {