}
+#define BLOOM2_HEADERLEN 16
+
typedef struct {
uint32_t high;
unsigned char low;
} bits40_t;
-
static void to_bloom_address_bitmask4(const bits40_t *buf,
const int nbits, uint64_t *v, unsigned char *bitmask)
{
*bitmask = 1 << bit;
}
-
#define BLOOM_SET_BIT(name, address, itype, otype) \
static void name(unsigned char *bloom, const void *buf, const int nbits)\
{\
unsigned char bitmask;\
otype v;\
address((itype *)buf, nbits, &v, &bitmask);\
- bloom[16+v] |= bitmask;\
+ bloom[BLOOM2_HEADERLEN+v] |= bitmask;\
}
BLOOM_SET_BIT(bloom_set_bit4, to_bloom_address_bitmask4, bits40_t, uint64_t)
BLOOM_SET_BIT(bloom_set_bit5, to_bloom_address_bitmask5, uint32_t, uint32_t)
unsigned char bitmask;\
otype v;\
address((itype *)buf, nbits, &v, &bitmask);\
- return bloom[16+v] & bitmask;\
+ return bloom[BLOOM2_HEADERLEN+v] & bitmask;\
}
BLOOM_GET_BIT(bloom_get_bit4, to_bloom_address_bitmask4, bits40_t, uint64_t)
BLOOM_GET_BIT(bloom_get_bit5, to_bloom_address_bitmask5, uint32_t, uint32_t)