diff options
author | jinhyung.jo <jinhyung.jo@samsung.com> | 2015-11-04 22:15:31 +0900 |
---|---|---|
committer | jinhyung.jo <jinhyung.jo@samsung.com> | 2015-11-04 22:15:31 +0900 |
commit | 81d2dc72bf07bcd5914dffd70b1c8906fbb8b7c0 (patch) | |
tree | 3ee0e044d6a262c2a8376ea1990f2f0cc79415cb | |
parent | 233c1f2ea5be0b1d160b64856e33365e0ab58313 (diff) | |
download | emulator-yagl-81d2dc72bf07bcd5914dffd70b1c8906fbb8b7c0.tar.gz emulator-yagl-81d2dc72bf07bcd5914dffd70b1c8906fbb8b7c0.tar.bz2 emulator-yagl-81d2dc72bf07bcd5914dffd70b1c8906fbb8b7c0.zip |
YaGL: Fix compilation warning & add '-Werror' optionsubmit/tizen/20151105.033621accepted/tizen/wearable/20151105.083914accepted/tizen/tv/20151105.083856accepted/tizen/mobile/20151105.083843
Removed a usage of the deprecated function, wl_client_add_resource'
And added a compilation option, '-Werror'.
Change-Id: I20fb58f9ab26c9a1f359ec8f4f5d56c261778bd7
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | wayland-drm/wayland-drm.c | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bced734..b21d693 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${YAGL_OUT_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${YAGL_OUT_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${YAGL_OUT_DIR}/lib) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -D_REENTRANT -fPIC -DPIC -DMESA_EGL_NO_X11_HEADERS") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -D_REENTRANT -fPIC -DPIC -DMESA_EGL_NO_X11_HEADERS") foreach (CONFIGURATION RELEASE MINSIZEREL RELWITHDEBINFO) string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_${CONFIGURATION} "${CMAKE_C_FLAGS_${CONFIGURATION}}") endforeach () diff --git a/wayland-drm/wayland-drm.c b/wayland-drm/wayland-drm.c index c3ed342..3368998 100644 --- a/wayland-drm/wayland-drm.c +++ b/wayland-drm/wayland-drm.c @@ -50,7 +50,7 @@ struct wl_drm struct wl_drm_buffer { - struct wl_resource resource; + struct wl_resource *resource; struct wl_drm *drm; @@ -112,16 +112,18 @@ static void drm_create_buffer(struct wl_client *client, } buffer->drm = drm; + buffer->resource = wl_resource_create(client, &wl_buffer_interface, 1, id); - buffer->resource.object.id = id; - buffer->resource.object.interface = &wl_buffer_interface; - buffer->resource.object.implementation = (void(**)(void))&drm->buffer_interface; - buffer->resource.data = buffer; - - buffer->resource.destroy = buffer_destroy; - buffer->resource.client = resource->client; + if (!buffer->resource) { + wl_resource_post_no_memory(resource); + free(buffer); + return; + } - wl_client_add_resource(resource->client, &buffer->resource); + wl_resource_set_implementation(buffer->resource, + (void(**)(void))&drm->buffer_interface, + buffer, + buffer_destroy); } static void drm_create_planar_buffer(struct wl_client *client, |