YaGL: Fix compilation warning & add '-Werror' option 24/51024/1 accepted/tizen/mobile/20151105.083843 accepted/tizen/tv/20151105.083856 accepted/tizen/wearable/20151105.083914 submit/tizen/20151105.033621
authorjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 4 Nov 2015 13:15:31 +0000 (22:15 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 4 Nov 2015 13:15:31 +0000 (22:15 +0900)
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>
CMakeLists.txt
wayland-drm/wayland-drm.c

index bced734fba54dd86a229ddf2ccbdd1825ca6a103..b21d6931d9be7129d04bed8268adef02372e3aea 100644 (file)
@@ -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 ()
index c3ed342c650c4423ebec3f6e4ed1399f0f0b1ea0..3368998d5bd97945407b63c9cd37f0aeeba6e8c4 100644 (file)
@@ -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,