common: Fix all warnings
authorTaekyun Kim <tkq.kim@samsung.com>
Thu, 13 Aug 2015 04:34:12 +0000 (13:34 +0900)
committer김태균 <tkq.kim@samsung.com>
Thu, 13 Aug 2015 04:44:52 +0000 (13:44 +0900)
Change-Id: Ieaa50fe2b0f5a89b7678b621b727219a0ab0481c

13 files changed:
src/lib/desktop-shell/shell-surface.c
src/lib/desktop-shell/xdg-shell.c
src/lib/drm/drm-output.c
src/lib/fbdev/fbdev-output.c
src/lib/libinput/libinput.c
src/lib/pepper/pepper-utils.h
src/lib/pepper/utils-log.c
src/lib/pepper/utils-vt.c
src/lib/pepper/view.c
src/lib/render/gl-renderer.c
src/lib/x11/pepper-x11.h
src/lib/x11/x11-input.c
src/lib/x11/x11-internal.h

index 16ad5c9..8bfc8a9 100644 (file)
@@ -63,7 +63,9 @@ handle_surface_destroy(pepper_event_listener_t *listener,
     wl_list_remove(&shsurf->link);
 
     if (shsurf->fullscreen.background_surface)
+    {
         /* TODO: pepper_surface_destroy(shsurf->fullscreen.background_surface); */;
+    }
 
     if (shsurf->fullscreen.background_view)
         pepper_view_destroy(shsurf->fullscreen.background_view);
@@ -358,7 +360,7 @@ shell_surface_get_output(shell_surface_t *shsurf)
     return output;
 }
 
-void
+static void
 shell_surface_get_geometry(shell_surface_t *shsurf, pixman_rectangle32_t *geometry)
 {
     double x, y;
index fe4c380..c9d444e 100644 (file)
@@ -183,7 +183,9 @@ xdg_shell_use_unstable_version(struct wl_client     *client,
 {
     /* TODO: */
     if (version != XDG_SHELL_VERSION_CURRENT)
+    {
         PEPPER_ERROR("wl_client@%p want bad XDG_SHELL version %d\n", client, version);
+    }
 }
 
 static void
index 9fd5c9a..e346c13 100644 (file)
@@ -24,7 +24,7 @@ init_renderer(drm_output_t *output, const char *renderer);
 static void
 fini_renderer(drm_output_t *output);
 
-void
+static void
 drm_output_destroy(void *o)
 {
     drm_output_t   *output = (drm_output_t *)o;
@@ -431,8 +431,8 @@ error:
     return -1;
 }
 
-static int
-find_crtc(pepper_drm_t *drm, drmModeRes *res, drmModeConnector *conn)
+static pepper_bool_t
+find_crtc(pepper_drm_t *drm, drmModeRes *res, drmModeConnector *conn, uint32_t *crtc_id)
 {
     int             i, j;
     drmModeEncoder *enc;
@@ -463,13 +463,14 @@ find_crtc(pepper_drm_t *drm, drmModeRes *res, drmModeConnector *conn)
             if (!crtc_used)
             {
                 drmModeFreeEncoder(enc);
-                return res->crtcs[j];
+                *crtc_id = res->crtcs[j];
+                return PEPPER_TRUE;
             }
         }
         drmModeFreeEncoder(enc);
     }
 
-    return -1;
+    return PEPPER_FALSE;
 }
 
 static void
@@ -716,8 +717,7 @@ drm_output_create(pepper_drm_t *drm, struct udev_device *device,
     wl_list_insert(&drm->output_list, &output->link);
 
     /* find crtc + connector */
-    output->crtc_id = find_crtc(drm, res, conn);
-    if (output->crtc_id < 0)
+    if (!find_crtc(drm, res, conn, &output->crtc_id))
     {
         PEPPER_ERROR("Failed to find crtc in %s\n", __FUNCTION__);
         goto error;
index 8e84c22..4b77d3f 100644 (file)
@@ -83,7 +83,8 @@ fbdev_debug_print_var_screeninfo(const struct fb_var_screeninfo *info)
     printf("Blue channel:       %i bits at offset %i\n",
            info->red.length, info->blue.offset);
 }
-void
+
+static void
 fbdev_output_destroy(void *o)
 {
     fbdev_output_t *output = (fbdev_output_t *)o;
index 59972c7..a0a2b0f 100644 (file)
@@ -88,7 +88,7 @@ libinput_device_get_properties(struct libinput_device *libinput_device,
     }
 }
 
-const char *
+static const char *
 li_device_get_property(void *dev, const char *key)
 {
     li_device_t            *device = (li_device_t *)dev;
index 2f81889..27ea6bb 100644 (file)
@@ -628,7 +628,7 @@ PEPPER_API pepper_bool_t
 pepper_virtual_terminal_setup(int tty);
 
 PEPPER_API void
-pepper_virtual_terminal_restore();
+pepper_virtual_terminal_restore(void);
 
 #ifdef __cplusplus
 }
index d497269..80b2e3e 100644 (file)
@@ -9,7 +9,7 @@ static FILE *pepper_log_file;
 static int pepper_log_verbosity = 3;
 static int cached_tm_mday = -1;
 
-void __attribute__ ((constructor))
+static void __attribute__ ((constructor))
 before_main(void)
 {
     pepper_log_file = stdout;
index 1ad930c..23e3af0 100644 (file)
@@ -21,7 +21,7 @@ static struct _vt_data
 } vt_data;
 
 PEPPER_API void
-pepper_virtual_terminal_restore()
+pepper_virtual_terminal_restore(void)
 {
     if (vt_data.tty_fd >= 0)
     {
@@ -29,17 +29,25 @@ pepper_virtual_terminal_restore()
         struct vt_mode  mode = {0};
 
         if ((vt_data.kb_mode >= 0) && (ioctl(fd, KDSKBMODE, vt_data.kb_mode) < 0))
+        {
             PEPPER_ERROR("");
+        }
 
         if (ioctl(fd, KDSETMODE, KD_TEXT) < 0)
+        {
             PEPPER_ERROR("");
+        }
 
         mode.mode = VT_AUTO;
         if (ioctl(fd, VT_SETMODE, &mode) < 0)
+        {
             PEPPER_ERROR("");
+        }
 
         if ((vt_data.saved_tty_num > 0) && (ioctl(fd, VT_ACTIVATE, vt_data.saved_tty_num) < 0))
+        {
             PEPPER_ERROR("");
+        }
 
         close(fd);
     }
index f7cfda9..c05300b 100644 (file)
@@ -157,7 +157,7 @@ pepper_view_assign_plane(pepper_view_t *view, pepper_output_t *output, pepper_pl
     plane_entry_set_plane(&view->plane_entries[output->id], plane);
 }
 
-void
+static void
 view_update_geometry(pepper_view_t *view)
 {
     pepper_list_t *l;
index 4527fb3..21d2e7e 100644 (file)
@@ -559,9 +559,13 @@ setup_egl_extensions(gl_renderer_t *gr)
     }
 
     if (strstr(extensions, "EGL_EXT_buffer_age"))
+    {
         gr->has_buffer_age = PEPPER_TRUE;
+    }
     else
+    {
         PEPPER_ERROR("Performance Warning: EGL_EXT_buffer_age not supported.\n");
+    }
 
     if (strstr(extensions, "EGL_EXT_platform_base"))
     {
@@ -832,7 +836,7 @@ pepper_gl_renderer_create_target(pepper_renderer_t *renderer, void *native_windo
 
         if (eglGetConfigAttrib(gr->display, configs[i], EGL_BUFFER_SIZE, &attrib))
         {
-            if (attrib == PEPPER_FORMAT_BPP(format))
+            if (attrib == (EGLint)PEPPER_FORMAT_BPP(format))
             {
                 config = configs[i];
                 break;
index daedd45..6d612fa 100644 (file)
@@ -19,8 +19,8 @@ PEPPER_API pepper_output_t *
 pepper_x11_output_create(pepper_x11_connection_t *connection, int32_t w, int32_t h,
                          const char *renderer);
 
-PEPPER_API pepper_bool_t
-pepper_x11_input_init(pepper_x11_connection_t* connection);
+PEPPER_API void
+pepper_x11_seat_create(pepper_x11_connection_t* conn);
 
 #ifdef __cplusplus
 }
index a8b404b..ed4f478 100644 (file)
@@ -58,6 +58,7 @@ x11_handle_input_event(x11_seat_t* seat, uint32_t type, xcb_generic_event_t* xev
     case XCB_MOTION_NOTIFY:
         {
             xcb_motion_notify_event_t *motion = (xcb_motion_notify_event_t *)xev;
+            UNUSED(motion);
         }
         break;
     default :
@@ -70,7 +71,7 @@ x11_handle_input_event(x11_seat_t* seat, uint32_t type, xcb_generic_event_t* xev
 void
 x11_window_input_property_change(xcb_connection_t *conn, xcb_window_t window)
 {
-     const static uint32_t values[] =
+     static const uint32_t values[] =
      {
          XCB_EVENT_MASK_EXPOSURE |
          XCB_EVENT_MASK_STRUCTURE_NOTIFY |
index 22d8fbe..1188d01 100644 (file)
@@ -49,7 +49,7 @@ struct x11_output
     char                        name[32];
 
     int32_t                  x, y;
-    uint32_t                 w, h;
+    int32_t                  w, h;
     uint32_t                 subpixel;
     uint32_t                 scale;
     uint8_t                  depth;