]> Dogcows Code - chaz/openbox/commitdiff
Make clang happier
authorMikael Magnusson <mikachu@gmail.com>
Thu, 5 Nov 2009 21:29:38 +0000 (22:29 +0100)
committerDana Jansens <danakj@orodu.net>
Sat, 7 Nov 2009 22:07:05 +0000 (17:07 -0500)
Add asserts to default: in switch statements
Store pointed to variables locally so it knows they don't change
Remove some dead assignments
Mark ob_exit_with_error as noreturn
Use "%s", msg instead of just msg to printf style functions
Use the c_pfocus variable

19 files changed:
obt/parse.c
openbox/actions/desktop.c
openbox/actions/moverelative.c
openbox/actions/session.c
openbox/client.c
openbox/config.c
openbox/debug.c
openbox/event.c
openbox/focus_cycle_popup.c
openbox/menuframe.c
openbox/moveresize.c
openbox/openbox.c
openbox/openbox.h
openbox/popup.c
openbox/prompt.c
openbox/resist.c
openbox/screen.c
openbox/stacking.c
render/font.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 50caa22ffa0b231caba07ce84bc7f8bc4e7af29e..3b33afbd08e7f5394d892d1314551e0c72bb09a4 100644 (file)
@@ -179,6 +179,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         d = screen_find_desktop(screen_desktop,
                                 o->u.rel.dir, o->u.rel.wrap, o->u.rel.linear);
         break;
+    default:
+        g_assert_not_reached();
     }
 
     if (d < screen_num_desktops && d != screen_desktop) {
index ccdff545d5702d02c4a470e98df31b3249c7e823..4e6e5998a62a988bc3d1cd463e143328cc4d3335 100644 (file)
@@ -42,15 +42,15 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         gint x, y, lw, lh, w, h;
 
         c = data->client;
-        x = data->client->area.x + o->x;
-        y = data->client->area.y + o->y;
-        w = data->client->area.width;
-        h = data->client->area.height;
-        client_try_configure(data->client, &x, &y, &w, &h, &lw, &lh, TRUE);
-        client_find_onscreen(data->client, &x, &y, w, h, FALSE);
+        x = c->area.x + o->x;
+        y = c->area.y + o->y;
+        w = c->area.width;
+        h = c->area.height;
+        client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
+        client_find_onscreen(c, &x, &y, w, h, FALSE);
 
         actions_client_move(data, TRUE);
-        client_configure(data->client, x, y, w, h, TRUE, TRUE, FALSE);
+        client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
         actions_client_move(data, FALSE);
     }
 
index 58652adb46021c9d314bf4b20730133891311ace..b9e33b7461e283bd515afa96c6b9fec22baa4589 100644 (file)
@@ -33,9 +33,9 @@ static gpointer setup_func(xmlNodePtr node)
 
 static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data)
 {
-    Options *o = data;
     if (result) {
 #ifdef USE_SM
+        Options *o = data;
         session_request_logout(o->silent);
 #else
         /* TRANSLATORS: Don't translate the word "SessionLogout" as it's the
index a62aa5b6c9f2e94a7c96553824e43c19aaae79b0..5bf22fb7fa546d0f23ff63d0787af3c906c16dde 100644 (file)
@@ -2378,7 +2378,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;
@@ -3639,6 +3639,8 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2)
                 value = self->demands_attention;
             else if (state == OBT_PROP_ATOM(OB_WM_STATE_UNDECORATED))
                 value = undecorated;
+            else
+                g_assert_not_reached();
             action = value ? OBT_PROP_ATOM(NET_WM_STATE_REMOVE) :
                              OBT_PROP_ATOM(NET_WM_STATE_ADD);
         }
index e3be728e42a1fb2fffcbe831cb4f8055afdd8263..9e111b847972307a02c7de26c24a3d39af1980ec 100644 (file)
@@ -200,7 +200,7 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d)
     gboolean x_pos_given;
 
     while (app) {
-        name_set = class_set = type_set = x_pos_given = FALSE;
+        x_pos_given = FALSE;
 
         class_set = obt_parse_attr_string(app, "class", &class);
         name_set = obt_parse_attr_string(app, "name", &name);
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 3f5c154314896ae28fd7abde9bac3b9bb96c9888..2c73289ef2ce761a3a63cfafd08dcce1516096c8 100644 (file)
@@ -417,6 +417,7 @@ static void print_focusevent(XEvent *e)
     case NotifyGrab:         modestr="NotifyGrab";         break;
     case NotifyUngrab:       modestr="NotifyUngrab";       break;
     case NotifyWhileGrabbed: modestr="NotifyWhileGrabbed"; break;
+    default:                 g_assert_not_reached();
     }
     switch (detail) {
     case NotifyAncestor:    detailstr="NotifyAncestor";    break;
@@ -427,6 +428,7 @@ static void print_focusevent(XEvent *e)
     case NotifyPointer:     detailstr="NotifyPointer";     break;
     case NotifyPointerRoot: detailstr="NotifyPointerRoot"; break;
     case NotifyDetailNone:  detailstr="NotifyDetailNone";  break;
+    default:                g_assert_not_reached();
     }
 
     if (mode == NotifyGrab || mode == NotifyUngrab)
@@ -1598,6 +1600,8 @@ static void event_handle_client(ObClient *client, XEvent *e)
                         client->shaped_input = ((XShapeEvent*)e)->shaped;
                         kind = ShapeInput;
                         break;
+                    default:
+                        g_assert_not_reached();
                 }
                 frame_adjust_shape_kind(client->frame, kind);
             }
index c7921fa991db3b09db6e1618fd1444e7083d6e4f..8a87f667600b426db1bbfc277f231e26790ded81 100644 (file)
@@ -326,10 +326,10 @@ 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;
+    ObFocusCyclePopupMode mode = p->mode;
     gint icons_per_row;
     gint icon_rows;
     gint textw, texth;
@@ -347,8 +347,8 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
     gint up_arrow_y, down_arrow_y;
     gboolean showing_arrows = FALSE;
 
-    g_assert(p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ||
-             p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST);
+    g_assert(mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ||
+             mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST);
 
     screen_area = screen_physical_area_active();
 
@@ -363,7 +363,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
 
     /* get the width from the text and keep it within limits */
     w = l + r + p->maxtextw;
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
         /* when in list mode, there are icons down the side */
         w += list_mode_icon_column_w;
     w = MIN(w, MAX(screen_area->width/3, POPUP_WIDTH)); /* max width */
@@ -371,12 +371,12 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
 
     /* get the text height */
     texth = RrMinHeight(p->a_hilite_text);
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
         texth = MAX(MAX(texth, RrMinHeight(p->a_text)), HILITE_SIZE);
     else
         texth += TEXT_BORDER * 2;
 
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
         /* how many icons will fit in that row? make the width fit that */
         w -= l + r;
         icons_per_row = (w + HILITE_SIZE - 1) / HILITE_SIZE;
@@ -398,7 +398,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
 
     /* get the text width */
     textw = w - l - r;
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
         /* leave space on the side for the icons */
         textw -= list_mode_icon_column_w;
 
@@ -408,7 +408,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
 
     /* find the height of the dialog */
     h = t + b + (icon_rows * MAX(HILITE_SIZE, texth));
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS)
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS)
         /* in icon mode the text sits below the icons, so make some space */
         h += OUTSIDE_BORDER + texth;
 
@@ -427,7 +427,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
 
     /* scroll the list if needed */
     last_scroll = p->scroll;
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
         const gint top = p->scroll + SCROLL_MARGIN;
         const gint bottom = p->scroll + icon_rows - SCROLL_MARGIN;
         const gint min_scroll = 0;
@@ -443,14 +443,14 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
     }
 
     /* show the scroll arrows when appropriate */
-    if (p->scroll && p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
+    if (p->scroll && mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
         XMapWindow(obt_display, p->list_mode_up);
         showing_arrows = TRUE;
     } else
         XUnmapWindow(obt_display, p->list_mode_up);
 
     if (p->scroll < p->n_targets - icon_rows &&
-        p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+        mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
     {
         XMapWindow(obt_display, p->list_mode_down);
         showing_arrows = TRUE;
@@ -463,12 +463,12 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
             + ob_rr_theme->down_arrow_mask->height + OUTSIDE_BORDER;
 
     /* center the icons if there is less than one row */
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS && icon_rows == 1)
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS && icon_rows == 1)
         icons_center_x = (w - p->n_targets * HILITE_SIZE) / 2;
     else
         icons_center_x = 0;
 
-    if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
+    if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
         /* get the position of the text */
         icon_mode_textx = l;
         icon_mode_texty = h - texth - b;
@@ -480,17 +480,11 @@ 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);
 
-        if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
+        if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
             /* position the text */
             XMoveResizeWindow(obt_display, p->icon_mode_text,
                               icon_mode_textx, icon_mode_texty, textw, texth);
@@ -523,7 +517,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
         RrPaint(p->a_bg, p->bg, w, h);
 
     /* draw the scroll arrows */
-    if (!p->mapped && p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
+    if (!p->mapped && mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
         p->a_arrow->texture[0].data.mask.mask =
             ob_rr_theme->up_arrow_mask;
         p->a_arrow->surface.parent = p->a_bg;
@@ -576,7 +570,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
                               iconx, icony, HILITE_SIZE, HILITE_SIZE);
 
             /* position the text */
-            if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+            if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
                 XMoveResizeWindow(obt_display, target->textwin,
                                   list_mode_textx, list_mode_texty,
                                   textw, texth);
@@ -584,13 +578,13 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
             /* show/hide the right windows */
             if (row >= 0 && row < icon_rows) {
                 XMapWindow(obt_display, target->iconwin);
-                if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+                if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
                     XMapWindow(obt_display, target->textwin);
                 else
                     XUnmapWindow(obt_display, target->textwin);
             } else {
                 XUnmapWindow(obt_display, target->textwin);
-                if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+                if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
                     XUnmapWindow(obt_display, target->iconwin);
                 else
                     XMapWindow(obt_display, target->iconwin);
@@ -615,19 +609,19 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
             RrPaint(p->a_icon, target->iconwin, HILITE_SIZE, HILITE_SIZE);
 
             /* draw the text */
-            if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST ||
+            if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST ||
                 target == newtarget)
             {
                 text = (target == newtarget) ? p->a_hilite_text : p->a_text;
                 text->texture[0].data.text.string = target->text;
                 text->surface.parentx =
-                    p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
+                    mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
                     icon_mode_textx : list_mode_textx;
                 text->surface.parenty =
-                    p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
+                    mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
                     icon_mode_texty : list_mode_texty;
                 RrPaint(text,
-                        (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
+                        (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
                          p->icon_mode_text : target->textwin),
                         textw, texth);
             }
index 1e767e965f45cdbdc92830b7190aa6319376ece0..1dbc6d4e9e95ee8d1ce9340a05a063fa395007aa 100644 (file)
@@ -396,7 +396,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
                   ob_rr_theme->a_menu_text_normal);
         sub = self->entry->data.submenu.submenu;
         text_a->texture[0].data.text.string = sub ? sub->title : "";
-        if (sub->shortcut && (self->frame->menu->show_all_shortcuts ||
+        if (sub && sub->shortcut && (self->frame->menu->show_all_shortcuts ||
                               sub->shortcut_always_show ||
                               sub->shortcut_position > 0))
         {
@@ -414,6 +414,8 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
         else
             text_a = ob_rr_theme->a_menu_text_normal;
         break;
+    default:
+        g_assert_not_reached();
     }
 
     switch (self->entry->type) {
@@ -482,6 +484,8 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
                     2*ob_rr_theme->menu_sep_paddingy);
         }
         break;
+    default:
+        g_assert_not_reached();
     }
 
     if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
@@ -750,6 +754,8 @@ void menu_frame_render(ObMenuFrame *self)
                     2*ob_rr_theme->menu_sep_paddingy - 2*PADDING;
             }
             break;
+        default:
+            g_assert_not_reached();
         }
         tw += 2*PADDING;
         th += 2*PADDING;
index e748cd3dcfdbfd17478fd07dde54a8cb63d23c1d..d89c31ca22ac416ebff735d2713b0dd2bcfedf5c 100644 (file)
@@ -662,7 +662,7 @@ static void move_with_keys(gint keycode, gint state)
 static void resize_with_keys(gint keycode, gint state)
 {
     gint dw = 0, dh = 0, pdx = 0, pdy = 0, opx, opy, px, py;
-    gint dist = 0, resist = 0;
+    gint resist = 0;
     ObDirection dir;
 
     /* pick the edge if it needs to move */
@@ -674,8 +674,7 @@ static void resize_with_keys(gint keycode, gint state)
             key_resize_edge = OB_DIRECTION_EAST;
             return;
         }
-    }
-    if (keycode == ob_keycode(OB_KEY_LEFT)) {
+    } else if (keycode == ob_keycode(OB_KEY_LEFT)) {
         dir = OB_DIRECTION_WEST;
         if (key_resize_edge != OB_DIRECTION_WEST &&
             key_resize_edge != OB_DIRECTION_EAST)
@@ -683,8 +682,7 @@ static void resize_with_keys(gint keycode, gint state)
             key_resize_edge = OB_DIRECTION_WEST;
             return;
         }
-    }
-    if (keycode == ob_keycode(OB_KEY_UP)) {
+    } else if (keycode == ob_keycode(OB_KEY_UP)) {
         dir = OB_DIRECTION_NORTH;
         if (key_resize_edge != OB_DIRECTION_NORTH &&
             key_resize_edge != OB_DIRECTION_SOUTH)
@@ -692,8 +690,7 @@ static void resize_with_keys(gint keycode, gint state)
             key_resize_edge = OB_DIRECTION_NORTH;
             return;
         }
-    }
-    if (keycode == ob_keycode(OB_KEY_DOWN)) {
+    } else /* if (keycode == ob_keycode(OB_KEY_DOWN)) */ {
         dir = OB_DIRECTION_SOUTH;
         if (key_resize_edge != OB_DIRECTION_NORTH &&
             key_resize_edge != OB_DIRECTION_SOUTH)
@@ -756,27 +753,27 @@ static void resize_with_keys(gint keycode, gint state)
 
         if (key_resize_edge == OB_DIRECTION_WEST) {
             if (dir == OB_DIRECTION_WEST)
-                dw = (dist = distw);
+                dw = distw;
             else
-                dw = -(dist = distw);
+                dw = -distw;
         }
         else if (key_resize_edge == OB_DIRECTION_EAST) {
             if (dir == OB_DIRECTION_EAST)
-                dw = (dist = distw);
+                dw = distw;
             else
-                dw = -(dist = distw);
+                dw = -distw;
         }
         else if (key_resize_edge == OB_DIRECTION_NORTH) {
             if (dir == OB_DIRECTION_NORTH)
-                dh = (dist = disth);
+                dh = disth;
             else
-                dh = -(dist = disth);
+                dh = -disth;
         }
         else /*if (key_resize_edge == OB_DIRECTION_SOUTH)*/ {
             if (dir == OB_DIRECTION_SOUTH)
-                dh = (dist = disth);
+                dh = disth;
             else
-                dh = -(dist = disth);
+                dh = -disth;
         }
     }
 
index e71465a68db6cb9e075b5a15bbf413901e0e8583..dd8ba12dfdb5652a4063d5ab19b958245f7cae20 100644 (file)
@@ -664,7 +664,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 2a938c5d1154edc4e02a3529f3e22776b6034bfa..b2e9c4cbd0a4513d73ca08415ac30b21eea2a136 100644 (file)
@@ -58,7 +58,7 @@ void ob_exit_replace(void);
 
 void ob_reconfigure(void);
 
-void ob_exit_with_error(const gchar *msg);
+void ob_exit_with_error(const gchar *msg) G_GNUC_NORETURN;
 
 Cursor ob_cursor(ObCursor cursor);
 
index bddf137db29d555c930b750062cfc255a27517bf..af1c511cbc3d67ff9a0e207006c0c7d43ee76779 100644 (file)
@@ -157,11 +157,12 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
     gint textx, texty, textw, texth;
     gint iconx, icony, iconw, iconh;
     Rect *area, mon;
+    gboolean hasicon = self->hasicon;
 
     /* when there is no icon and the text is not parent relative, then
        fill the whole dialog with the text appearance, don't use the bg at all
     */
-    if (self->hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
+    if (hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
         RrMargins(self->a_bg, &l, &t, &r, &b);
     else
         l = t = r = b = 0;
@@ -189,7 +190,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
     iconx = textx = l + ob_rr_theme->paddingx;
 
     emptyx = l + r + ob_rr_theme->paddingx * 2;
-    if (self->hasicon) {
+    if (hasicon) {
         iconw = texth * self->iconwm;
         iconh = texth * self->iconhm;
         textx += iconw + ob_rr_theme->paddingx;
@@ -204,7 +205,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
     /* when there is no icon, then fill the whole dialog with the text
        appearance
     */
-    if (!self->hasicon)
+    if (!hasicon)
     {
         textx = texty = 0;
         texth += emptyy;
@@ -276,7 +277,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
     /* when there is no icon and the text is not parent relative, then
        fill the whole dialog with the text appearance, don't use the bg at all
     */
-    if (self->hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
+    if (hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
         RrPaint(self->a_bg, self->bg, w, h);
 
     if (textw) {
@@ -287,7 +288,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
         RrPaint(self->a_text, self->text, textw, texth);
     }
 
-    if (self->hasicon)
+    if (hasicon)
         self->draw_icon(iconx, icony, iconw, iconh, self->draw_icon_data);
 
     /* do the actual showing */
index 52223f1949911e477a9449502be81e13b8cbb86a..5151100566db9e8176a70112ae8df1f89d86184e 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 3bcb95ffc4db5779f870d29b47f7fdb6fbd9f129..dc5e343c03b6cfa64b35bcf70af348e512dfcabb 100644 (file)
@@ -328,7 +328,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;
 
@@ -339,9 +338,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 09d5003c4eeaba5d52964ec6e672fa713563606a..6aecaa059e6be9626bd93e35a0a7eea852e65c07 100644 (file)
@@ -505,7 +505,6 @@ void screen_resize(void)
 
 void screen_set_num_desktops(guint num)
 {
-    guint old;
     gulong *viewport;
     GList *it, *stacking_copy;
 
@@ -513,7 +512,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);
 
@@ -1582,7 +1580,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 */
 
@@ -1608,30 +1606,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) {
index 3c05df49c64c0c23f470a87aa4e090ee33fb4d29..2a34f71dc4eea10305c1037a0ae24b64d9d4025b 100644 (file)
@@ -69,6 +69,8 @@ static void do_restack(GList *wins, GList *before)
 
 #ifdef DEBUG
     GList *next;
+
+    g_assert(wins);
     /* pls only restack stuff in the same layer at a time */
     for (it = wins; it; it = next) {
         next = g_list_next(it);
index 583c9f7d7af277b2986429a4036fabc38500f907..cde0d0309bf92a01f6d3c45255df8a427f03360d 100644 (file)
@@ -217,7 +217,7 @@ static inline int font_calculate_baseline(RrFont *f, gint height)
 
 void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
 {
-    gint x,y,w,h;
+    gint x,y,w;
     XftColor c;
     gint mw;
     PangoRectangle rect;
@@ -240,7 +240,7 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
     w = area->width;
     if (t->flow) w = MAX(w, t->maxwidth);
     w -= 4;
-    h = area->height;
+    /* h = area->height; */
 
     if (t->flow)
         ell = PANGO_ELLIPSIZE_NONE;
@@ -258,6 +258,8 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
         case RR_ELLIPSIZE_END:
             ell = PANGO_ELLIPSIZE_END;
             break;
+        default:
+            g_assert_not_reached();
         }
     }
 
This page took 0.053517 seconds and 4 git commands to generate.