[Cogl] [PATCH] pedantic style fixes

Robert Bragg robert at sixbynine.org
Tue Dec 4 02:55:48 PST 2012


From: Robert Bragg <robert at linux.intel.com>

TODO: squash back into owen's patch
---
 cogl/cogl-xlib-renderer.c     |   42 ++++++++++++++++++++++++++--------------
 cogl/winsys/cogl-winsys-glx.c |   10 ++++++--
 2 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/cogl/cogl-xlib-renderer.c b/cogl/cogl-xlib-renderer.c
index fff3c35..c3964c1 100644
--- a/cogl/cogl-xlib-renderer.c
+++ b/cogl/cogl-xlib-renderer.c
@@ -202,12 +202,18 @@ compare_outputs (CoglOutput *a,
 
 #define CSO(X) COGL_SUBPIXEL_ORDER_ ## X
 static CoglSubpixelOrder subpixel_map[6][6] = {
-  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_RGB), CSO(HORIZONTAL_BGR), CSO(VERTICAL_RGB),   CSO(VERTICAL_BGR) },   /* 0 */
-  { CSO(UNKNOWN), CSO(NONE), CSO(VERTICAL_RGB),   CSO(VERTICAL_BGR),   CSO(HORIZONTAL_BGR), CSO(HORIZONTAL_RGB) }, /* 90 */
-  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_BGR), CSO(HORIZONTAL_RGB), CSO(VERTICAL_BGR),   CSO(VERTICAL_RGB) },   /* 180 */
-  { CSO(UNKNOWN), CSO(NONE), CSO(VERTICAL_BGR),   CSO(VERTICAL_RGB),   CSO(HORIZONTAL_RGB), CSO(HORIZONTAL_BGR) }, /* 270 */
-  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_BGR), CSO(HORIZONTAL_RGB), CSO(VERTICAL_RGB),   CSO(VERTICAL_BGR) },   /* Reflect_X */
-  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_RGB), CSO(HORIZONTAL_BGR), CSO(VERTICAL_BGR),   CSO(VERTICAL_RGB) },   /* Reflect_Y */
+  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_RGB), CSO(HORIZONTAL_BGR),
+    CSO(VERTICAL_RGB),   CSO(VERTICAL_BGR) },   /* 0 */
+  { CSO(UNKNOWN), CSO(NONE), CSO(VERTICAL_RGB),   CSO(VERTICAL_BGR),
+    CSO(HORIZONTAL_BGR), CSO(HORIZONTAL_RGB) }, /* 90 */
+  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_BGR), CSO(HORIZONTAL_RGB),
+    CSO(VERTICAL_BGR),   CSO(VERTICAL_RGB) },   /* 180 */
+  { CSO(UNKNOWN), CSO(NONE), CSO(VERTICAL_BGR),   CSO(VERTICAL_RGB),
+    CSO(HORIZONTAL_RGB), CSO(HORIZONTAL_BGR) }, /* 270 */
+  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_BGR), CSO(HORIZONTAL_RGB),
+    CSO(VERTICAL_RGB),   CSO(VERTICAL_BGR) },   /* Reflect_X */
+  { CSO(UNKNOWN), CSO(NONE), CSO(HORIZONTAL_RGB), CSO(HORIZONTAL_BGR),
+    CSO(VERTICAL_BGR),   CSO(VERTICAL_RGB) },   /* Reflect_Y */
 };
 #undef CSO
 
@@ -240,7 +246,8 @@ update_outputs (CoglRenderer *renderer,
       float refresh_rate = 0;
       int j;
 
-      crtc_info = XRRGetCrtcInfo (xlib_renderer->xdpy, resources, resources->crtcs[i]);
+      crtc_info = XRRGetCrtcInfo (xlib_renderer->xdpy,
+                                  resources, resources->crtcs[i]);
       if (crtc_info == NULL)
         {
           error = TRUE;
@@ -254,7 +261,8 @@ update_outputs (CoglRenderer *renderer,
         {
           if (resources->modes[j].id == crtc_info->mode)
             refresh_rate = (resources->modes[j].dotClock /
-                            ((float)resources->modes[j].hTotal * resources->modes[j].vTotal));
+                            ((float)resources->modes[j].hTotal *
+                             resources->modes[j].vTotal));
         }
 
       output_info = XRRGetOutputInfo (xlib_renderer->xdpy,
@@ -354,9 +362,11 @@ update_outputs (CoglRenderer *renderer,
 
               if (!_cogl_output_values_equal (output_l, output_m))
                 {
-                  xlib_renderer->outputs = g_list_remove_link (xlib_renderer->outputs, m);
-                  xlib_renderer->outputs = g_list_insert_before (xlib_renderer->outputs ,
-                                                                 m_next, output_l);
+                  xlib_renderer->outputs =
+                    g_list_remove_link (xlib_renderer->outputs, m);
+                  xlib_renderer->outputs =
+                    g_list_insert_before (xlib_renderer->outputs,
+                                          m_next, output_l);
                   cogl_object_ref (output_l);
 
                   changed = TRUE;
@@ -367,8 +377,8 @@ update_outputs (CoglRenderer *renderer,
             }
           else if (cmp < 0)
             {
-              xlib_renderer->outputs = g_list_insert_before (xlib_renderer->outputs ,
-                                                             m, output_l);
+              xlib_renderer->outputs =
+                g_list_insert_before (xlib_renderer->outputs, m, output_l);
               cogl_object_ref (output_l);
               changed = TRUE;
               l = l->next;
@@ -376,7 +386,8 @@ update_outputs (CoglRenderer *renderer,
           else
             {
               GList *m_next = m->next;
-              xlib_renderer->outputs = g_list_remove_link (xlib_renderer->outputs, m);
+              xlib_renderer->outputs =
+                g_list_remove_link (xlib_renderer->outputs, m);
               changed = TRUE;
               m = m_next;
             }
@@ -424,7 +435,8 @@ update_outputs (CoglRenderer *renderer,
             }
 
           COGL_NOTE (WINSYS,
-                     " %10s: +%d+%dx%dx%d mm=%dx%d dpi=%.1fx%.1f subpixel_order=%s refresh_rate=%.3f",
+                     " %10s: +%d+%dx%dx%d mm=%dx%d dpi=%.1fx%.1f "
+                     "subpixel_order=%s refresh_rate=%.3f",
                      output->name,
                      output->x, output->y, output->width, output->height,
                      output->mm_width, output->mm_height,
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index e7f83ab..11b0cc1 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -199,7 +199,8 @@ update_output (CoglOnscreen *onscreen)
   width = cogl_framebuffer_get_width (framebuffer);
   height = cogl_framebuffer_get_height (framebuffer);
   output = _cogl_xlib_renderer_output_for_rectangle (display->renderer,
-                                                     xlib_onscreen->x, xlib_onscreen->y,
+                                                     xlib_onscreen->x,
+                                                     xlib_onscreen->y,
                                                      width, height);
   if (xlib_onscreen->output != output)
     {
@@ -217,7 +218,8 @@ static void
 notify_resize (CoglContext *context,
                XConfigureEvent *configure_event)
 {
-  CoglOnscreen *onscreen = find_onscreen_for_xid (context, configure_event->window);
+  CoglOnscreen *onscreen = find_onscreen_for_xid (context,
+                                                  configure_event->window);
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   CoglDisplay *display = context->display;
   CoglGLXDisplay *glx_display = display->winsys;
@@ -230,7 +232,9 @@ notify_resize (CoglContext *context,
   glx_onscreen = onscreen->winsys;
   xlib_onscreen = onscreen->winsys;
 
-  _cogl_framebuffer_winsys_update_size (framebuffer, configure_event->width, configure_event->height);
+  _cogl_framebuffer_winsys_update_size (framebuffer,
+                                        configure_event->width,
+                                        configure_event->height);
 
   /* We only want to notify that a resize happened when the
      application calls cogl_context_dispatch so instead of immediately
-- 
1.7.7.6



More information about the Cogl mailing list