[Commits] Rev 2860: Fix problem of bitmap which can not hold values for all rows numbers (found due to windows visual C compiler warnings) in file:///home/bell/maria/bzr/work-maria-5.3-bitmap/

sanja at askmonty.org sanja at askmonty.org
Tue Nov 30 18:24:20 EET 2010


At file:///home/bell/maria/bzr/work-maria-5.3-bitmap/

------------------------------------------------------------
revno: 2860
revision-id: sanja at askmonty.org-20101130162420-9wj4e3w0kw09rfur
parent: monty at mysql.com-20101129232714-2x2s9vj0btbtq8vy
committer: sanja at askmonty.org
branch nick: work-maria-5.3-bitmap
timestamp: Tue 2010-11-30 18:24:20 +0200
message:
  Fix problem of bitmap which can not hold values for all rows numbers (found due to windows visual C compiler warnings)
-------------- next part --------------
=== modified file 'include/my_bitmap.h'
--- a/include/my_bitmap.h	2010-10-06 08:45:30 +0000
+++ b/include/my_bitmap.h	2010-11-30 16:24:20 +0000
@@ -35,33 +35,33 @@ typedef struct st_bitmap
   pthread_mutex_t *mutex;
 #endif
   my_bitmap_map last_word_mask;
-  uint32	n_bits; /* number of bits occupied by the above */
+  uint64 n_bits; /* number of bits occupied by the above */
 } MY_BITMAP;
 
 #ifdef	__cplusplus
 extern "C" {
 #endif
 extern void create_last_word_mask(MY_BITMAP *map);
-extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
+extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, ulong n_bits,
                            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_prefix(const MY_BITMAP *map, ulong prefix_size);
 extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
 extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2);
 extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
                                      const MY_BITMAP *map2);
-extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
-extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
-extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
+extern my_bool bitmap_test_and_set(MY_BITMAP *map, ulong bitmap_bit);
+extern my_bool bitmap_test_and_clear(MY_BITMAP *map, ulong bitmap_bit);
+extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, ulong bitmap_bit);
 extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
                                        const MY_BITMAP *map2);
-extern uint bitmap_set_next(MY_BITMAP *map);
-extern uint bitmap_get_first(const MY_BITMAP *map);
-extern uint bitmap_get_first_set(const MY_BITMAP *map);
-extern uint bitmap_bits_set(const MY_BITMAP *map);
+extern ulong bitmap_set_next(MY_BITMAP *map);
+extern ulong bitmap_get_first(const MY_BITMAP *map);
+extern ulong bitmap_get_first_set(const MY_BITMAP *map);
+extern ulong bitmap_bits_set(const MY_BITMAP *map);
 extern void bitmap_free(MY_BITMAP *map);
-extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit);
-extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size);
+extern void bitmap_set_above(MY_BITMAP *map, ulong from_byte, ulong use_bit);
+extern void bitmap_set_prefix(MY_BITMAP *map, ulong prefix_size);
 extern void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2);
 extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
 extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
@@ -69,24 +69,24 @@ extern void bitmap_xor(MY_BITMAP *map, c
 extern void bitmap_invert(MY_BITMAP *map);
 extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
 
-extern uint bitmap_lock_set_next(MY_BITMAP *map);
-extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);
+extern ulong bitmap_lock_set_next(MY_BITMAP *map);
+extern void bitmap_lock_clear_bit(MY_BITMAP *map, ulong bitmap_bit);
 #ifdef NOT_USED
-extern uint bitmap_lock_bits_set(const MY_BITMAP *map);
+extern ulong bitmap_lock_bits_set(const MY_BITMAP *map);
 extern my_bool bitmap_lock_is_set_all(const MY_BITMAP *map);
-extern uint bitmap_lock_get_first(const MY_BITMAP *map);
-extern uint bitmap_lock_get_first_set(const MY_BITMAP *map);
+extern ulong bitmap_lock_get_first(const MY_BITMAP *map);
+extern ulong bitmap_lock_get_first_set(const MY_BITMAP *map);
 extern my_bool bitmap_lock_is_subset(const MY_BITMAP *map1,
                                      const MY_BITMAP *map2);
-extern my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size);
-extern my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit);
+extern my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, ulong prefix_size);
+extern my_bool bitmap_lock_is_set(const MY_BITMAP *map, ulong bitmap_bit);
 extern my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map);
 extern my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2);
 extern void bitmap_lock_set_all(MY_BITMAP *map);
 extern void bitmap_lock_clear_all(MY_BITMAP *map);
-extern void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit);
-extern void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit);
-extern void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size);
+extern void bitmap_lock_set_bit(MY_BITMAP *map, ulong bitmap_bit);
+extern void bitmap_lock_flip_bit(MY_BITMAP *map, ulong bitmap_bit);
+extern void bitmap_lock_set_prefix(MY_BITMAP *map, ulong prefix_size);
 extern void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2);
 extern void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
 extern void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2);
@@ -119,25 +119,25 @@ extern void bitmap_lock_invert(MY_BITMAP
 */
 #ifndef DBUG_OFF
 static inline void
-bitmap_set_bit(MY_BITMAP *map,uint bit)
+bitmap_set_bit(MY_BITMAP *map, ulong bit)
 {
   DBUG_ASSERT(bit < (map)->n_bits);
   _bitmap_set_bit(map,bit);
 }
 static inline void
-bitmap_flip_bit(MY_BITMAP *map,uint bit)
+bitmap_flip_bit(MY_BITMAP *map, ulong bit)
 {
   DBUG_ASSERT(bit < (map)->n_bits);
   _bitmap_flip_bit(map,bit);
 }
 static inline void
-bitmap_clear_bit(MY_BITMAP *map,uint bit)
+bitmap_clear_bit(MY_BITMAP *map, ulong bit)
 {
   DBUG_ASSERT(bit < (map)->n_bits);
   _bitmap_clear_bit(map,bit);
 }
 static inline uint
-bitmap_is_set(const MY_BITMAP *map,uint bit)
+bitmap_is_set(const MY_BITMAP *map, ulong bit)
 {
   DBUG_ASSERT(bit < (map)->n_bits);
   return _bitmap_is_set(map,bit);

=== modified file 'mysys/my_bitmap.c'
--- a/mysys/my_bitmap.c	2010-10-06 08:45:30 +0000
+++ b/mysys/my_bitmap.c	2010-11-30 16:24:20 +0000
@@ -43,10 +43,10 @@
 
 /* Create a mask of the significant bits for the last byte (1,3,7,..255) */
 
-static inline uchar last_byte_mask(uint bits)
+static inline uchar last_byte_mask(ulong bits)
 {
   /* Get the number of used bits-1 (0..7) in the last byte */
-  unsigned int const used= (bits - 1U) & 7U;
+  unsigned long const used= (bits - 1U) & 7U;
   /* Return bitmask for the significant bits */
   return ((2U << used) - 1);
 }
@@ -56,7 +56,7 @@ static inline uchar last_byte_mask(uint
   bits clear. The bits within each byte is stored in big-endian order.
 */
 
-static inline uchar invers_last_byte_mask(uint bits)
+static inline uchar invers_last_byte_mask(ulong bits)
 {
   return last_byte_mask(bits) ^ 255;
 }
@@ -115,14 +115,14 @@ static inline void bitmap_unlock(MY_BITM
 }
 
 
-my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
+my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, ulong n_bits,
 		    my_bool thread_safe __attribute__((unused)))
 {
   DBUG_ENTER("bitmap_init");
   if (!buf)
   {
-    uint size_in_bytes= bitmap_buffer_size(n_bits);
-    uint extra= 0;
+    ulong size_in_bytes= bitmap_buffer_size(n_bits);
+    ulong extra= 0;
 #ifdef THREAD
     if (thread_safe)
     {
@@ -185,7 +185,7 @@ void bitmap_free(MY_BITMAP *map)
     !=0  bit was set
 */
 
-my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit)
+my_bool bitmap_fast_test_and_set(MY_BITMAP *map, ulong bitmap_bit)
 {
   uchar *value= ((uchar*) map->bitmap) + (bitmap_bit / 8);
   uchar bit= 1 << ((bitmap_bit) & 7);
@@ -208,7 +208,7 @@ my_bool bitmap_fast_test_and_set(MY_BITM
     !=0  bit was set
 */
 
-my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit)
+my_bool bitmap_test_and_set(MY_BITMAP *map, ulong bitmap_bit)
 {
   my_bool res;
   DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
@@ -231,7 +231,7 @@ my_bool bitmap_test_and_set(MY_BITMAP *m
     !=0  bit was set
 */
 
-my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit)
+my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, ulong bitmap_bit)
 {
   uchar *byte= (uchar*) map->bitmap + (bitmap_bit / 8);
   uchar bit= 1 << ((bitmap_bit) & 7);
@@ -241,7 +241,7 @@ my_bool bitmap_fast_test_and_clear(MY_BI
 }
 
 
-my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit)
+my_bool bitmap_test_and_clear(MY_BITMAP *map, ulong bitmap_bit)
 {
   my_bool res;
   DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
@@ -252,9 +252,9 @@ my_bool bitmap_test_and_clear(MY_BITMAP
 }
 
 
-uint bitmap_set_next(MY_BITMAP *map)
+ulong bitmap_set_next(MY_BITMAP *map)
 {
-  uint bit_found;
+  ulong bit_found;
   DBUG_ASSERT(map->bitmap);
   if ((bit_found= bitmap_get_first(map)) != MY_BIT_NONE)
     bitmap_set_bit(map, bit_found);
@@ -262,13 +262,13 @@ uint bitmap_set_next(MY_BITMAP *map)
 }
 
 
-void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size)
+void bitmap_set_prefix(MY_BITMAP *map, ulong prefix_size)
 {
-  uint prefix_bytes, prefix_bits, d;
+  ulong prefix_bytes, prefix_bits, d;
   uchar *m= (uchar *)map->bitmap;
 
   DBUG_ASSERT(map->bitmap &&
-	      (prefix_size <= map->n_bits || prefix_size == (uint) ~0));
+	      (prefix_size <= map->n_bits || prefix_size == (ulong) ~0));
   set_if_smaller(prefix_size, map->n_bits);
   if ((prefix_bytes= prefix_size / 8))
     memset(m, 0xff, prefix_bytes);
@@ -280,9 +280,9 @@ void bitmap_set_prefix(MY_BITMAP *map, u
 }
 
 
-my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size)
+my_bool bitmap_is_prefix(const MY_BITMAP *map, ulong prefix_size)
 {
-  uint prefix_mask= last_byte_mask(prefix_size);
+  ulong prefix_mask= last_byte_mask(prefix_size);
   uchar *m= (uchar*) map->bitmap;
   uchar *end_prefix= m+(prefix_size-1)/8;
   uchar *end;
@@ -373,7 +373,7 @@ my_bool bitmap_is_overlapping(const MY_B
 void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2)
 {
   my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end;
-  uint len= no_words_in_map(map), len2 = no_words_in_map(map2);
+  ulong len= no_words_in_map(map), len2 = no_words_in_map(map2);
 
   DBUG_ASSERT(map->bitmap && map2->bitmap);
 
@@ -428,7 +428,7 @@ my_bool bitmap_union_is_set_all(const MY
     void
 */
 
-void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit)
+void bitmap_set_above(MY_BITMAP *map, ulong from_byte, ulong use_bit)
 {
   uchar use_byte= use_bit ? 0xff : 0;
   uchar *to= (uchar *)map->bitmap + from_byte;
@@ -487,11 +487,11 @@ void bitmap_invert(MY_BITMAP *map)
 }
 
 
-uint bitmap_bits_set(const MY_BITMAP *map)
-{  
+ulong bitmap_bits_set(const MY_BITMAP *map)
+{
   uchar *m= (uchar*)map->bitmap;
   uchar *end= m + no_bytes_in_map(map) - 1;
-  uint res= 0;
+  ulong res= 0;
 
   DBUG_ASSERT(map->bitmap);
   while (m < end)
@@ -512,10 +512,10 @@ void bitmap_copy(MY_BITMAP *map, const M
 }
 
 
-uint bitmap_get_first_set(const MY_BITMAP *map)
+ulong bitmap_get_first_set(const MY_BITMAP *map)
 {
   uchar *byte_ptr;
-  uint i,j,k;
+  ulong i,j,k;
   my_bitmap_map *data_ptr, *end= map->last_word_ptr;
 
   DBUG_ASSERT(map->bitmap);
@@ -547,10 +547,10 @@ found:
 }
 
 
-uint bitmap_get_first(const MY_BITMAP *map)
+ulong bitmap_get_first(const MY_BITMAP *map)
 {
   uchar *byte_ptr;
-  uint i,j,k;
+  ulong i,j,k;
   my_bitmap_map *data_ptr, *end= map->last_word_ptr;
 
   DBUG_ASSERT(map->bitmap);
@@ -583,9 +583,9 @@ found:
 }
 
 
-uint bitmap_lock_set_next(MY_BITMAP *map)
+ulong bitmap_lock_set_next(MY_BITMAP *map)
 {
-  uint bit_found;
+  ulong bit_found;
   bitmap_lock(map);
   bit_found= bitmap_set_next(map);
   bitmap_unlock(map);
@@ -593,7 +593,7 @@ uint bitmap_lock_set_next(MY_BITMAP *map
 }
 
 
-void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit)
+void bitmap_lock_clear_bit(MY_BITMAP *map, ulong bitmap_bit)
 {
   bitmap_lock(map);
   DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
@@ -603,7 +603,7 @@ void bitmap_lock_clear_bit(MY_BITMAP *ma
 
 
 #ifdef NOT_USED
-my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size)
+my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, ulong prefix_size)
 {
   my_bool res;
   bitmap_lock((MY_BITMAP *)map);
@@ -629,7 +629,7 @@ void bitmap_lock_clear_all(MY_BITMAP *ma
 }
 
 
-void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size)
+void bitmap_lock_set_prefix(MY_BITMAP *map, ulong prefix_size)
 {
   bitmap_lock(map);
   bitmap_set_prefix(map, prefix_size);
@@ -639,7 +639,7 @@ void bitmap_lock_set_prefix(MY_BITMAP *m
 
 my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map)
 {
-  uint res;
+  ulong res;
   bitmap_lock((MY_BITMAP *)map);
   res= bitmap_is_clear_all(map);
   bitmap_unlock((MY_BITMAP *)map);
@@ -649,7 +649,7 @@ my_bool bitmap_lock_is_clear_all(const M
 
 my_bool bitmap_lock_is_set_all(const MY_BITMAP *map)
 {
-  uint res;
+  ulong res;
   bitmap_lock((MY_BITMAP *)map);
   res= bitmap_is_set_all(map);
   bitmap_unlock((MY_BITMAP *)map);
@@ -657,7 +657,7 @@ my_bool bitmap_lock_is_set_all(const MY_
 }
 
 
-my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit)
+my_bool bitmap_lock_is_set(const MY_BITMAP *map, ulong bitmap_bit)
 {
   my_bool res;
   DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
@@ -670,7 +670,7 @@ my_bool bitmap_lock_is_set(const MY_BITM
 
 my_bool bitmap_lock_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2)
 {
-  uint res;
+  my_bool res;
   bitmap_lock((MY_BITMAP *)map1);
   bitmap_lock((MY_BITMAP *)map2);
   res= bitmap_is_subset(map1, map2);
@@ -682,7 +682,7 @@ my_bool bitmap_lock_is_subset(const MY_B
 
 my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
 {
-  uint res;
+  my_bool res;
 
   DBUG_ASSERT(map1->bitmap && map2->bitmap &&
               map1->n_bits==map2->n_bits);
@@ -732,9 +732,9 @@ void bitmap_lock_union(MY_BITMAP *map, c
   RETURN
     Number of set bits in the bitmap.
 */
-uint bitmap_lock_bits_set(const MY_BITMAP *map)
+ulong bitmap_lock_bits_set(const MY_BITMAP *map)
 {
-  uint res;
+  ulong res;
   bitmap_lock((MY_BITMAP *)map);
   DBUG_ASSERT(map->bitmap);
   res= bitmap_bits_set(map);
@@ -750,9 +750,9 @@ uint bitmap_lock_bits_set(const MY_BITMA
   RETURN 
     Number of first unset bit in the bitmap or MY_BIT_NONE if all bits are set.
 */
-uint bitmap_lock_get_first(const MY_BITMAP *map)
+ulong bitmap_lock_get_first(const MY_BITMAP *map)
 {
-  uint res;
+  ulong res;
   bitmap_lock((MY_BITMAP*)map);
   res= bitmap_get_first(map);
   bitmap_unlock((MY_BITMAP*)map);
@@ -760,9 +760,9 @@ uint bitmap_lock_get_first(const MY_BITM
 }
 
 
-uint bitmap_lock_get_first_set(const MY_BITMAP *map)
+ulong bitmap_lock_get_first_set(const MY_BITMAP *map)
 {
-  uint res;
+  ulong res;
   bitmap_lock((MY_BITMAP*)map);
   res= bitmap_get_first_set(map);
   bitmap_unlock((MY_BITMAP*)map);
@@ -770,7 +770,7 @@ uint bitmap_lock_get_first_set(const MY_
 }
 
 
-void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit)
+void bitmap_lock_set_bit(MY_BITMAP *map, ulong bitmap_bit)
 {
   DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
   bitmap_lock(map);
@@ -779,7 +779,7 @@ void bitmap_lock_set_bit(MY_BITMAP *map,
 }
 
 
-void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit)
+void bitmap_lock_flip_bit(MY_BITMAP *map, ulong bitmap_bit)
 {
   DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
   bitmap_lock(map);
@@ -789,15 +789,15 @@ void bitmap_lock_flip_bit(MY_BITMAP *map
 #endif
 #ifdef MAIN
 
-uint get_rand_bit(uint bitsize)
+ulong get_rand_bit(ulong bitsize)
 {
   return (rand() % bitsize);
 }
 
-my_bool test_set_get_clear_bit(MY_BITMAP *map, uint bitsize)
+my_bool test_set_get_clear_bit(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, test_bit;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, test_bit;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   for (i=0; i < no_loops; i++)
   {
     test_bit= get_rand_bit(bitsize);
@@ -817,10 +817,10 @@ error2:
   return TRUE;
 }
 
-my_bool test_flip_bit(MY_BITMAP *map, uint bitsize)
+my_bool test_flip_bit(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, test_bit;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, test_bit;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   for (i=0; i < no_loops; i++)
   {
     test_bit= get_rand_bit(bitsize);
@@ -841,14 +841,14 @@ error2:
 }
 
 my_bool test_operators(MY_BITMAP *map __attribute__((unused)),
-                    uint bitsize __attribute__((unused)))
+                    ulong bitsize __attribute__((unused)))
 {
   return FALSE;
 }
 
-my_bool test_get_all_bits(MY_BITMAP *map, uint bitsize)
+my_bool test_get_all_bits(MY_BITMAP *map, ulong bitsize)
 {
-  uint i;
+  ulong i;
   bitmap_set_all(map);
   if (!bitmap_is_set_all(map))
     goto error1;
@@ -888,10 +888,10 @@ error6:
   return TRUE;
 }
 
-my_bool test_compare_operators(MY_BITMAP *map, uint bitsize)
+my_bool test_compare_operators(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, j, test_bit1, test_bit2, test_bit3,test_bit4;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, j, test_bit1, test_bit2, test_bit3,test_bit4;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   MY_BITMAP map2_obj, map3_obj;
   MY_BITMAP *map2= &map2_obj, *map3= &map3_obj;
   my_bitmap_map map2buf[1024];
@@ -994,10 +994,10 @@ error5:
   return TRUE;
 }
 
-my_bool test_count_bits_set(MY_BITMAP *map, uint bitsize)
+my_bool test_count_bits_set(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, bit_count=0, test_bit;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, bit_count=0, test_bit;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   for (i=0; i < no_loops; i++)
   {
     test_bit=get_rand_bit(bitsize);
@@ -1020,10 +1020,10 @@ error2:
   return TRUE;
 }
 
-my_bool test_get_first_bit(MY_BITMAP *map, uint bitsize)
+my_bool test_get_first_bit(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, test_bit;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, test_bit;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   for (i=0; i < no_loops; i++)
   {
     test_bit=get_rand_bit(bitsize);
@@ -1045,10 +1045,10 @@ error2:
   return TRUE;
 }
 
-my_bool test_get_next_bit(MY_BITMAP *map, uint bitsize)
+my_bool test_get_next_bit(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, j, test_bit;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, j, test_bit;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   for (i=0; i < no_loops; i++)
   {
     test_bit=get_rand_bit(bitsize);
@@ -1064,10 +1064,10 @@ error1:
   return TRUE;
 }
 
-my_bool test_prefix(MY_BITMAP *map, uint bitsize)
+my_bool test_prefix(MY_BITMAP *map, ulong bitsize)
 {
-  uint i, j, test_bit;
-  uint no_loops= bitsize > 128 ? 128 : bitsize;
+  ulong i, j, test_bit;
+  ulong no_loops= bitsize > 128 ? 128 : bitsize;
   for (i=0; i < no_loops; i++)
   {
     test_bit=get_rand_bit(bitsize);
@@ -1099,7 +1099,7 @@ error3:
 }
 
 
-my_bool do_test(uint bitsize)
+my_bool do_test(ulong bitsize)
 {
   MY_BITMAP map;
   my_bitmap_map buf[1024];

=== modified file 'sql/sql_bitmap.h'
--- a/sql/sql_bitmap.h	2010-09-23 22:00:32 +0000
+++ b/sql/sql_bitmap.h	2010-11-30 16:24:20 +0000
@@ -21,7 +21,7 @@
 
 #include <my_bitmap.h>
 
-template <uint default_width> class Bitmap
+template <ulong default_width> class Bitmap
 {
   MY_BITMAP map;
   uint32 buffer[(default_width+31)/32];



More information about the commits mailing list