]> git.sur5r.net Git - i3/i3/commitdiff
Remove some dead code, add default paths to switch() to make static analyzers happy
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 10 Jun 2009 17:59:36 +0000 (19:59 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 10 Jun 2009 17:59:36 +0000 (19:59 +0200)
Check was done with scan-build from the LLVM suite. The remaining reports are false
positives and have been reported to llvm:

http://llvm.org/bugs/show_bug.cgi?id=4358
http://llvm.org/bugs/show_bug.cgi?id=4359

src/commands.c
src/handlers.c
src/layout.c
src/util.c

index d1ee5c69a41d73319ae2bc31daaa50f021bb15fd..80b94ab9d629a40306819c08f4da1db3bcca8c1c 100644 (file)
@@ -239,6 +239,9 @@ static void move_current_window(xcb_connection_t *conn, direction_t direction) {
 
                         new = CUR_TABLE[current_col][++current_row];
                         break;
+                /* To make static analyzers happy: */
+                default:
+                        return;
         }
 
         /* Remove it from the old container and put it into the new one */
@@ -312,6 +315,9 @@ static void move_current_container(xcb_connection_t *conn, direction_t direction
 
                         new = CUR_TABLE[current_col][++current_row];
                         break;
+                /* To make static analyzers happy: */
+                default:
+                        return;
         }
 
         LOG("old = %d,%d and new = %d,%d\n", container->col, container->row, new->col, new->row);
@@ -416,6 +422,9 @@ static void snap_current_container(xcb_connection_t *conn, direction_t direction
                         container->rowspan++;
                         break;
                 }
+                /* To make static analyzers happy: */
+                default:
+                        return;
         }
 
         render_layout(conn);
index 45cb37c198334c11a3e2d59d6bc5b665b3b9ced1..010dcaa5e5da97a836c132e43ab1d5aff97d2a38 100644 (file)
@@ -911,8 +911,7 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_w
 
         LOG("window is %08x / %s\n", client->child, client->name);
 
-        int base_width = 0, base_height = 0,
-            min_width = 0, min_height = 0;
+        int base_width = 0, base_height = 0;
 
         /* base_width/height are the desired size of the window.
            We check if either the program-specified size or the program-specified
@@ -925,14 +924,6 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_w
                 base_height = size_hints.min_height;
         }
 
-        if (size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) {
-                min_width = size_hints.min_width;
-                min_height = size_hints.min_height;
-        } else if (size_hints.flags & XCB_SIZE_HINT_P_SIZE) {
-                min_width = size_hints.base_width;
-                min_height = size_hints.base_height;
-        }
-
         double width = client->rect.width - base_width;
         double height = client->rect.height - base_height;
         /* Convert numerator/denominator to a double */
index 8b01471acbad5b966dd20dfe64e91023693dc2d6..426dd0277ed629e99894243edc4c6f57ebb58487 100644 (file)
@@ -336,9 +336,6 @@ void render_container(xcb_connection_t *conn, Container *container) {
                         xcb_configure_window(conn, stack_win->window, mask, values);
                 }
 
-                /* Reconfigure the currently focused client, if necessary. It is the only visible one */
-                client = container->currently_focused;
-
                 /* Render the decorations of all clients */
                 CIRCLEQ_FOREACH(client, &(container->clients), clients) {
                         /* If the client is in fullscreen mode, it does not get reconfigured */
index 40e39e84d61e19636b3eaebfa3448492e7fc4901..c0268358fa6c9aebed425cc965826786c46b1745 100644 (file)
@@ -451,7 +451,7 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
 Client *get_matching_client(xcb_connection_t *conn, const char *window_classtitle,
                             Client *specific) {
         char *to_class, *to_title, *to_title_ucs = NULL;
-        int to_title_ucs_len;
+        int to_title_ucs_len = 0;
         Client *matching = NULL;
 
         to_class = sstrdup(window_classtitle);