home · contact · privacy
Slightly improved code style and comments in sorted_wintoggle_and_activate().
authorChristian Heller <c.heller@plomlompom.de>
Mon, 25 Nov 2013 01:08:17 +0000 (02:08 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 25 Nov 2013 01:08:17 +0000 (02:08 +0100)
src/wincontrol.c

index 6fb9acb8a4c9f575ff93761efa9ccac9405c9615..ee547ebe1305e9e87098cb882d1a26c87ac6d9c1 100644 (file)
@@ -388,17 +388,17 @@ extern void sorted_wintoggle_and_activate()
 {
     char * f_name = "sorted_wintoggle_and_activate()";
 
+    /* Read from file order of windows to be toggled + active win selection. */
     char * path = "config/windows/toggle_order_and_active";
     FILE * file = try_fopen(path, "r", f_name);
     uint16_t linemax = get_linemax(file, f_name);
     char win_order[linemax + 1];
     try_fgets(win_order, linemax + 1, file, f_name);
-
-    uint8_t a = 0;
+    uint8_t a;
     exit_trouble(read_uint8(file, &a), f_name, "read_uint8()");
-
     try_fclose(file, f_name);
 
+    /* Toggle windows and set active window selection. */
     uint8_t i = 0;
     for (; i < strlen(win_order) - 1; i++)
     {
@@ -407,7 +407,6 @@ extern void sorted_wintoggle_and_activate()
             continue;
         }
         toggle_window(win_order[i]);
-
         if (a == (uint8_t) win_order[i])
         {
             world.wmeta->active = get_win_by_id(win_order[i]);