diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2005-06-02 18:40:25 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2005-06-02 18:40:25 +0200 |
commit | 15ca553ab4574a28fd942155066d1492c87b121a (patch) | |
tree | 3380fac1e38c78273621c53282f01b7b49747471 /include/my_bitmap.h | |
parent | a46f4cf4975a60ff6d8d2848a84fc25fe348aa40 (diff) | |
download | mariadb-git-15ca553ab4574a28fd942155066d1492c87b121a.tar.gz |
bitmap bug fixes and interface change
Diffstat (limited to 'include/my_bitmap.h')
-rw-r--r-- | include/my_bitmap.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/my_bitmap.h b/include/my_bitmap.h index a5df6389488..109a12034ba 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -24,7 +24,7 @@ typedef struct st_bitmap { - uchar *bitmap; + uint32 *bitmap; uint bitmap_size; /* number of bits occupied by the above */ uint32 last_word_mask; uint32 *last_word_ptr; @@ -41,7 +41,7 @@ typedef struct st_bitmap #ifdef __cplusplus extern "C" { #endif -extern my_bool bitmap_init(MY_BITMAP *map, uchar *buf, uint bitmap_size, my_bool thread_safe); +extern my_bool bitmap_init(MY_BITMAP *map, uint32 *buf, uint bitmap_size, my_bool thread_safe); extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); extern my_bool bitmap_is_set_all(const MY_BITMAP *map); @@ -84,10 +84,10 @@ extern void bitmap_lock_invert(MY_BITMAP *map); #define no_bytes_in_map(map) ((map->bitmap_size + 7)/8) #define no_words_in_map(map) ((map->bitmap_size + 31)/32) #define bytes_word_aligned(bytes) (4*((bytes + 3)/4)) -#define bitmap_set_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 8] |= (1 << ((BIT) & 7))) -#define bitmap_flip_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 8] ^= (1 << ((BIT) & 7))) -#define bitmap_clear_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 8] &= ~ (1 << ((BIT) & 7))) -#define bitmap_is_set(MAP, BIT) ((MAP)->bitmap[(BIT) / 8] & (1 << ((BIT) & 7))) +#define bitmap_set_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] |= (1 << ((BIT) & 31))) +#define bitmap_flip_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] ^= (1 << ((BIT) & 31))) +#define bitmap_clear_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] &= ~ (1 << ((BIT) & 31))) +#define bitmap_is_set(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] & (1 << ((BIT) & 31))) #define bitmap_cmp(MAP1, MAP2) \ (memcmp((MAP1)->bitmap, (MAP2)->bitmap, 4*no_words_in_map((MAP1)))==0) #define bitmap_clear_all(MAP) \ |