home · contact · privacy
Added -Werror to compiler flags, fixed other warnings/errors triggered.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 10 Mar 2014 14:03:34 +0000 (15:03 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 10 Mar 2014 14:03:34 +0000 (15:03 +0100)
Makefile
src/client/windows.c
src/server/map_object_actions.c

index 3280dd35c31aec8b2791fd23586e0bd9ed76cf0c..6a6fe5b7a9fdd537a74a5c49d9904a87bb187768 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Wextra -g
+CFLAGS=-Wall -Wextra -Werror -g
 TARGET_SERVER=roguelike-server
 TARGET_CLIENT=roguelike-client
 SRCDIR=src
index d35548570135c0efb532a166ec03d59c855ebedf..da830377e4d7d801e3382fe65aa4666177a744be 100644 (file)
@@ -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);
index c3ffaf1e287b71580ec3e55effca07ec01a78d10..694300dccef5116acfb2a1031d001c034490d7ff 100644 (file)
@@ -77,7 +77,7 @@ static void update_log(char * text)
             }
             last_stop--;
         }
-        if (   (last_stop + 1) - last_nl == strlen(text)
+        if (   (last_stop + 1) - last_nl == (uint16_t) strlen(text)
             && 0 == strncmp(world.log + last_nl, text, strlen(text)))
         {
             text = ".";
@@ -170,7 +170,10 @@ static void playerbonus_move(char d, uint8_t passable)
         || match_dir(d, &dsc_dir, '7', "north-west")
         || match_dir(d, &dsc_dir, '9', "north-east")
         || match_dir(d, &dsc_dir, '1', "south-west")
-        || match_dir(d, &dsc_dir, '3', "south-east"));
+        || match_dir(d, &dsc_dir, '3', "south-east"))
+    {
+        ;
+    }
     char * dsc_move = "You move ";
     if (0 == passable)
     {