104
104
#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
105
105
& (1 << ((BIT) & 7)))
109
The below symbols are inline functions in DEBUG builds and macros in
110
non-DEBUG builds. The latter evaluate their 'bit' argument twice.
112
107
NEVER use an increment/decrement operator with the 'bit' argument.
113
It would work with DEBUG builds, but fails later in production builds!
115
109
FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index);
119
bitmap_set_bit(MY_BITMAP *map,uint bit)
121
DBUG_ASSERT(bit < (map)->n_bits);
122
_bitmap_set_bit(map,bit);
125
bitmap_flip_bit(MY_BITMAP *map,uint bit)
127
DBUG_ASSERT(bit < (map)->n_bits);
128
_bitmap_flip_bit(map,bit);
131
bitmap_clear_bit(MY_BITMAP *map,uint bit)
133
DBUG_ASSERT(bit < (map)->n_bits);
134
_bitmap_clear_bit(map,bit);
137
bitmap_is_set(const MY_BITMAP *map,uint bit)
139
DBUG_ASSERT(bit < (map)->n_bits);
140
return _bitmap_is_set(map,bit);
143
111
#define bitmap_set_bit(MAP, BIT) _bitmap_set_bit(MAP, BIT)
144
112
#define bitmap_flip_bit(MAP, BIT) _bitmap_flip_bit(MAP, BIT)
145
113
#define bitmap_clear_bit(MAP, BIT) _bitmap_clear_bit(MAP, BIT)
146
114
#define bitmap_is_set(MAP, BIT) _bitmap_is_set(MAP, BIT)
149
116
static inline bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)