[or-cvs] r11160: redefine BITARRAY_MASK as a function of BITARRAY_SHIFT (tor/trunk/src/common)

weasel at seul.org weasel at seul.org
Fri Aug 17 22:43:00 UTC 2007


Author: weasel
Date: 2007-08-17 18:43:00 -0400 (Fri, 17 Aug 2007)
New Revision: 11160

Modified:
   tor/trunk/src/common/container.h
Log:
redefine BITARRAY_MASK as a function of BITARRAY_SHIFT

Modified: tor/trunk/src/common/container.h
===================================================================
--- tor/trunk/src/common/container.h	2007-08-17 21:55:24 UTC (rev 11159)
+++ tor/trunk/src/common/container.h	2007-08-17 22:43:00 UTC (rev 11160)
@@ -268,13 +268,12 @@
 
 #if SIZEOF_INT == 4
 #define BITARRAY_SHIFT 5
-#define BITARRAY_MASK 31
 #elif SIZEOF_INT == 8
 #define BITARRAY_SHIFT 6
-#define BITARRAY_MASK 63
 #else
 #error "int is neither 4 nor 8 bytes. I can't deal with that."
 #endif
+#define BITARRAY_MASK ((1u<<BITARRAY_SHIFT)-1)
 
 /** A random-access array of one-bit-wide elements. */
 typedef unsigned int bitarray_t;



More information about the tor-commits mailing list