From: divverent Date: Sun, 2 Jan 2011 22:51:37 +0000 (+0000) Subject: fix a warning by clang X-Git-Tag: xonotic-v0.5.0~438^2~151 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=85fd729da291daea50c664e12f15d03341fa8088 fix a warning by clang git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10690 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_brush.h b/model_brush.h index ab2a5121..9d67f60b 100644 --- a/model_brush.h +++ b/model_brush.h @@ -703,9 +703,10 @@ typedef struct q3mbrushside_s } q3mbrushside_t; -#define CHECKPVSBIT(pvs,b) ((b) >= 0 ? ((pvs)[(b) >> 3] & (1 << ((b) & 7))) : false) -#define SETPVSBIT(pvs,b) ((b) >= 0 ? ((pvs)[(b) >> 3] |= (1 << ((b) & 7))) : false) -#define CLEARPVSBIT(pvs,b) ((b) >= 0 ? ((pvs)[(b) >> 3] &= ~(1 << ((b) & 7))) : false) +// the first cast is to shut up a stupid warning by clang, the second cast is to make both sides have the same type +#define CHECKPVSBIT(pvs,b) ((b) >= 0 ? (unsigned char) ((pvs)[(b) >> 3] & (1 << ((b) & 7))) : (unsigned char) false) +#define SETPVSBIT(pvs,b) ((b) >= 0 ? (unsigned char) ((pvs)[(b) >> 3] |= (1 << ((b) & 7))) : (unsigned char) false) +#define CLEARPVSBIT(pvs,b) ((b) >= 0 ? (unsigned char) ((pvs)[(b) >> 3] &= ~(1 << ((b) & 7))) : (unsigned char) false) #endif