home · contact · privacy
Removed redundant "return".
[plomrogue] / src / client / windows.c
index cd3ad8ced7805fc5f2f7fcecc868b2948935a6e5..e15a65ac0becfbb33053c3c57ab2fc5bc194fc5b 100644 (file)
@@ -11,6 +11,7 @@
 #include <stdint.h> /* uint8_t, uint16_t, uint32_t, UINT16_MAX */
 #include <stdio.h> /* sprintf() */
 #include <string.h> /* memcpy(), strlen(), strnlen(), strchr(), memset() */
+#include "../common/err_try_fgets.h" /* err_try_fgets(), err_line() */
 #include "../common/readwrite.h" /* try_fputc(), try_write(), try_fgetc() */
 #include "../common/rexit.h" /* exit_trouble(), exit_err() */
 #include "../common/try_malloc.h" /* try_malloc() */
@@ -22,8 +23,7 @@
                         * draw_win_keybindings_winconf_geometry(),
                         * draw_win_keybindings_global()
                         */
-#include "err_try_fgets.h" /* err_try_fgets(), err_line() */
-#include "keybindings.h" /* free_keybindings(), write_keybidings_to_file(),
+#include "keybindings.h" /* write_keybidings_to_file(),
                           * read_keybindings_from_file()
                           */
 #include "misc.h" /* array_append() */
@@ -180,7 +180,10 @@ static void * get_drawfunc_by_char(char c)
         || match_func(c, &f, 'm', draw_win_map)
         || match_func(c, &f, '0', draw_win_keybindings_global)
         || match_func(c, &f, '1', draw_win_keybindings_winconf_geometry)
-        || match_func(c, &f, '2', draw_win_keybindings_winconf_keybindings));
+        || match_func(c, &f, '2', draw_win_keybindings_winconf_keybindings))
+    {
+        ;
+    }
     return f;
 }
 
@@ -240,7 +243,7 @@ static void refit_v_screen()
     /* Only resize .v_screen if the rightmost window column has changed. */
     char * err_s = "refit_v_screen() grows virtual screen beyond legal sizes.";
     char * err_m = "refit_v_screen() triggers memory alloc error in wresize().";
-    if (getmaxx(world.winDB.v_screen) + 1 != lastwcol)
+    if ((uint32_t) getmaxx(world.winDB.v_screen) + 1 != lastwcol)
     {
         uint8_t t = (lastwcol + 2 > UINT16_MAX);
         exit_err(t, err_s);
@@ -502,7 +505,7 @@ static void draw_wins(struct Win * w)
     struct Win * next = get_win_after(w->id);
     if (next)
     {
-        return draw_wins(next);
+        draw_wins(next);
     }
 }
 
@@ -551,8 +554,8 @@ static void suspend_win(struct Win * w)
 
 
 
-extern uint16_t center_offset(uint16_t position, uint16_t mapsize,
-                              uint16_t frame_size)
+extern uint16_t center_offset(uint16_t position, uint32_t mapsize,
+                              uint32_t frame_size)
 {
     uint16_t offset = 0;
     if (mapsize > frame_size)
@@ -739,7 +742,8 @@ extern void free_winDB()
     {
         struct Win * wc = get_win_by_id(id);
         free(wc->title);
-        free_keybindings(wc->kb.kbs);
+        free(wc->kb.kbs);
+        wc->kb.kbs = NULL;
     }
     free(world.winDB.ids);  /* NULL this too since add_win_to_winDB() checks  */
     world.winDB.ids = NULL; /* for it to detect its first post-DB-purge round.*/
@@ -749,7 +753,7 @@ extern void free_winDB()
 
 
 
-extern void winch_called(int signal)
+extern void winch_called()
 {
     world.winch = 1;
 }