Some cleanups pointed out by clang
authorMikael Magnusson <mikachu@gmail.com>
Thu, 5 Nov 2009 14:51:35 +0000 (15:51 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Thu, 5 Nov 2009 14:51:35 +0000 (15:51 +0100)
obt/parse.c
openbox/client.c
openbox/debug.c
openbox/focus_cycle_popup.c
openbox/openbox.c
openbox/prompt.c
openbox/resist.c
openbox/screen.c

index d181b67920ec4894e7a2f4413808a3d5bdbac6dd..a792188ff9dc07e48d92b12a1a8bc2f3b28fbab2 100644 (file)
@@ -99,7 +99,7 @@ void obt_parse_register(ObtParseInst *i, const gchar *tag,
 {
     struct Callback *c;
 
-    if ((c = g_hash_table_lookup(i->callbacks, tag))) {
+    if (g_hash_table_lookup(i->callbacks, tag)) {
         g_error("Tag '%s' already registered", tag);
         return;
     }
index 6f13d9fe480713e4c37c13e1bf7ce74972cd03b9..42d8c6e119c57a20f51693d76ef20307fcea2794 100644 (file)
@@ -2379,7 +2379,7 @@ ObClient *client_search_focus_tree_full(ObClient *self)
 
         for (it = self->parents; it; it = g_slist_next(it)) {
             ObClient *c = it->data;
-            if ((c = client_search_focus_tree_full(it->data))) return c;
+            if ((c = client_search_focus_tree_full(c))) return c;
         }
 
         return NULL;
index db18784cc39342c2559b230a2d406599e55075a6..c1180c33c79b07f62a704d928a964df55fce506e 100644 (file)
@@ -161,7 +161,7 @@ static inline void log_argv(ObDebugType type,
         g_free(a);
     }
 
-    g_debug(message);
+    g_debug("%s", message);
     g_free(message);
 }
 
index c7921fa991db3b09db6e1618fd1444e7083d6e4f..3ac51b93b8a6575087186ac42787f87c9d8f3512 100644 (file)
@@ -326,7 +326,6 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
     gint l, t, r, b;
     gint x, y, w, h;
     Rect *screen_area = NULL;
-    gint rgbax, rgbay, rgbaw, rgbah;
     gint i;
     GList *it;
     const ObFocusCyclePopupTarget *newtarget;
@@ -480,12 +479,6 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
     y = screen_area->y + (screen_area->height -
                           (h + ob_rr_theme->obwidth * 2)) / 2;
 
-    /* get the dimensions of the target hilite texture */
-    rgbax = ml;
-    rgbay = mt;
-    rgbaw = w - ml - mr;
-    rgbah = h - mt - mb;
-
     if (!p->mapped) {
         /* position the background but don't draw it */
         XMoveResizeWindow(obt_display, p->bg, x, y, w, h);
index 9b331834c66c354832caeabdf5415df7e750c8cd..8dc60ec6b918d0f36f2d7f658d59ed1cba4947bc 100644 (file)
@@ -667,7 +667,7 @@ static Cursor load_cursor(const gchar *name, guint fontval)
 
 void ob_exit_with_error(const gchar *msg)
 {
-    g_message(msg);
+    g_message("%s", msg);
     session_shutdown(TRUE);
     exit(EXIT_FAILURE);
 }
index 720bb3103919d87c795f33f74860fb7c2d0fe81b..f2ddfd33e5a221c3c4f6fd9cd04a5c6197f6ae72 100644 (file)
@@ -95,7 +95,7 @@ void prompt_startup(gboolean reconfig)
     prompt_a_button->texture[0].data.text.color = c_button;
     prompt_a_focus->texture[0].data.text.color = c_focus;
     prompt_a_press->texture[0].data.text.color = c_press;
-    prompt_a_pfocus->texture[0].data.text.color = c_press;
+    prompt_a_pfocus->texture[0].data.text.color = c_pfocus;
 
     prompt_a_focus->texture[1].data.lineart.color = c_focus;
     prompt_a_focus->texture[2].data.lineart.color = c_focus;
index 87c397a8498c331daffeeef3ba91ab757213a6e2..9f622a01f0b92f7c2f64422db2e37d04ca7e3c9f 100644 (file)
@@ -351,7 +351,6 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *h,
     Rect *area, *parea;
     gint al, at, ar, ab; /* screen boundaries */
     gint pl, pt, pr, pb; /* physical screen boundaries */
-    gint incw, inch;
     guint i;
     Rect desired_area;
 
@@ -362,9 +361,6 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *h,
     t = RECT_TOP(c->frame->area);
     b = RECT_BOTTOM(c->frame->area);
 
-    incw = c->size_inc.width;
-    inch = c->size_inc.height;
-
     RECT_SET(desired_area, c->area.x, c->area.y, *w, *h);
 
     for (i = 0; i < screen_num_monitors; ++i) {
index 3402d20c0eeb08001b76cff5eb740cb5eae4b4d7..68b23a5172126c69539720068a6f96c068c4d604 100644 (file)
@@ -511,7 +511,6 @@ void screen_resize(void)
 
 void screen_set_num_desktops(guint num)
 {
-    guint old;
     gulong *viewport;
     GList *it, *stacking_copy;
 
@@ -519,7 +518,6 @@ void screen_set_num_desktops(guint num)
 
     if (screen_num_desktops == num) return;
 
-    old = screen_num_desktops;
     screen_num_desktops = num;
     OBT_PROP_SET32(obt_root(ob_screen), NET_NUMBER_OF_DESKTOPS, CARDINAL, num);
 
@@ -1590,7 +1588,7 @@ Rect* screen_area(guint desktop, guint head, Rect *search)
 {
     Rect *a;
     GSList *it;
-    gint l, r, t, b, al, ar, at, ab;
+    gint l, r, t, b;
     guint i, d;
     gboolean us = search != NULL; /* user provided search */
 
@@ -1616,30 +1614,30 @@ Rect* screen_area(guint desktop, guint head, Rect *search)
 
     /* only include monitors which the search area lines up with */
     if (RECT_INTERSECTS_RECT(monitor_area[screen_num_monitors], *search)) {
-        al = l = RECT_RIGHT(monitor_area[screen_num_monitors]);
-        at = t = RECT_BOTTOM(monitor_area[screen_num_monitors]);
-        ar = r = RECT_LEFT(monitor_area[screen_num_monitors]);
-        ab = b = RECT_TOP(monitor_area[screen_num_monitors]);
+        l = RECT_RIGHT(monitor_area[screen_num_monitors]);
+        t = RECT_BOTTOM(monitor_area[screen_num_monitors]);
+        r = RECT_LEFT(monitor_area[screen_num_monitors]);
+        b = RECT_TOP(monitor_area[screen_num_monitors]);
         for (i = 0; i < screen_num_monitors; ++i) {
             /* add the monitor if applicable */
             if (RANGES_INTERSECT(search->x, search->width,
                                  monitor_area[i].x, monitor_area[i].width))
             {
-                at = t = MIN(t, RECT_TOP(monitor_area[i]));
-                ab = b = MAX(b, RECT_BOTTOM(monitor_area[i]));
+                t = MIN(t, RECT_TOP(monitor_area[i]));
+                b = MAX(b, RECT_BOTTOM(monitor_area[i]));
             }
             if (RANGES_INTERSECT(search->y, search->height,
                                  monitor_area[i].y, monitor_area[i].height))
             {
-                al = l = MIN(l, RECT_LEFT(monitor_area[i]));
-                ar = r = MAX(r, RECT_RIGHT(monitor_area[i]));
+                l = MIN(l, RECT_LEFT(monitor_area[i]));
+                r = MAX(r, RECT_RIGHT(monitor_area[i]));
             }
         }
     } else {
-        al = l = RECT_LEFT(monitor_area[screen_num_monitors]);
-        at = t = RECT_TOP(monitor_area[screen_num_monitors]);
-        ar = r = RECT_RIGHT(monitor_area[screen_num_monitors]);
-        ab = b = RECT_BOTTOM(monitor_area[screen_num_monitors]);
+        l = RECT_LEFT(monitor_area[screen_num_monitors]);
+        t = RECT_TOP(monitor_area[screen_num_monitors]);
+        r = RECT_RIGHT(monitor_area[screen_num_monitors]);
+        b = RECT_BOTTOM(monitor_area[screen_num_monitors]);
     }
 
     for (d = 0; d < screen_num_desktops; ++d) {