From: Christian Heller Date: Mon, 10 Mar 2014 13:49:41 +0000 (+0100) Subject: Added -Wextra to compiler flags, found out about redundant test. X-Git-Tag: tce~828 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bprefix%7D%7D/balance?a=commitdiff_plain;h=e23ea3a560a432304851b6bcd7781f18181873e6;p=plomrogue Added -Wextra to compiler flags, found out about redundant test. --- diff --git a/Makefile b/Makefile index c7831bd..3280dd3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-Wall -g +CFLAGS=-Wall -Wextra -g TARGET_SERVER=roguelike-server TARGET_CLIENT=roguelike-client SRCDIR=src diff --git a/src/server/map.c b/src/server/map.c index 8bae81a..0edd955 100644 --- a/src/server/map.c +++ b/src/server/map.c @@ -55,8 +55,7 @@ extern void init_map() extern uint8_t is_passable(struct yx_uint8 pos) { uint8_t passable = 0; - if ( 0 <= pos.x && pos.x < world.map.size.x - && 0 <= pos.y && pos.y < world.map.size.y) + if (pos.x < world.map.size.x && pos.y < world.map.size.y) { passable = ('.' == world.map.cells[(pos.y * world.map.size.x) + pos.x]); }