From 39ab34a368fbe30dc6639e021da89b1a20243fd6 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 10 Mar 2014 15:03:34 +0100 Subject: [PATCH] Added -Werror to compiler flags, fixed other warnings/errors triggered. --- Makefile | 2 +- src/client/windows.c | 7 +++++-- src/server/map_object_actions.c | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) 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) { -- 2.30.2