mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
redefine BITARRAY_MASK as a function of BITARRAY_SHIFT
svn:r11160
This commit is contained in:
parent
c5893e5035
commit
0713606469
@ -268,13 +268,12 @@ void* strmap_remove_lc(strmap_t *map, const char *key);
|
|||||||
|
|
||||||
#if SIZEOF_INT == 4
|
#if SIZEOF_INT == 4
|
||||||
#define BITARRAY_SHIFT 5
|
#define BITARRAY_SHIFT 5
|
||||||
#define BITARRAY_MASK 31
|
|
||||||
#elif SIZEOF_INT == 8
|
#elif SIZEOF_INT == 8
|
||||||
#define BITARRAY_SHIFT 6
|
#define BITARRAY_SHIFT 6
|
||||||
#define BITARRAY_MASK 63
|
|
||||||
#else
|
#else
|
||||||
#error "int is neither 4 nor 8 bytes. I can't deal with that."
|
#error "int is neither 4 nor 8 bytes. I can't deal with that."
|
||||||
#endif
|
#endif
|
||||||
|
#define BITARRAY_MASK ((1u<<BITARRAY_SHIFT)-1)
|
||||||
|
|
||||||
/** A random-access array of one-bit-wide elements. */
|
/** A random-access array of one-bit-wide elements. */
|
||||||
typedef unsigned int bitarray_t;
|
typedef unsigned int bitarray_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user