]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a warning by clang
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 Jan 2011 22:51:37 +0000 (22:51 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 Jan 2011 22:51:37 +0000 (22:51 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10690 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.h

index ab2a5121833d813747eddf2cd3e0d625a0d1d255..9d67f60b97cfe834e49112b9487399daac59f83f 100644 (file)
@@ -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