From: Christian Heller Date: Mon, 10 Mar 2014 14:03:34 +0000 (+0100) Subject: Added -Werror to compiler flags, fixed other warnings/errors triggered. X-Git-Tag: tce~826 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Byoutube_prefix%7D%7D%7B%7Bvideo_id%7D%7D?a=commitdiff_plain;h=39ab34a368fbe30dc6639e021da89b1a20243fd6;p=plomrogue Added -Werror to compiler flags, fixed other warnings/errors triggered. --- diff --git a/Makefile b/Makefile index 3280dd3..6a6fe5b 100644 --- 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 diff --git a/src/client/windows.c b/src/client/windows.c index d355485..da83037 100644 --- a/src/client/windows.c +++ b/src/client/windows.c @@ -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); diff --git a/src/server/map_object_actions.c b/src/server/map_object_actions.c index c3ffaf1..694300d 100644 --- a/src/server/map_object_actions.c +++ b/src/server/map_object_actions.c @@ -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) {