~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_bit.h

Merged build changes from Antony.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    Comments shows how this works with 01100000000000000000000000001011
67
67
*/
68
68
 
69
 
static inline uint32 my_round_up_to_next_power(uint32 v)
 
69
static inline uint32_t my_round_up_to_next_power(uint32_t v)
70
70
{
71
71
  v--;                  /* 01100000000000000000000000001010 */
72
72
  v|= v >> 1;           /* 01110000000000000000000000001111 */
77
77
  return v+1;           /* 10000000000000000000000000000000 */
78
78
}
79
79
 
80
 
static inline uint32 my_clear_highest_bit(uint32 v)
 
80
static inline uint32_t my_clear_highest_bit(uint32_t v)
81
81
{
82
 
  uint32 w=v >> 1;
 
82
  uint32_t w=v >> 1;
83
83
  w|= w >> 1;
84
84
  w|= w >> 2;
85
85
  w|= w >> 4;
88
88
  return v & w;
89
89
}
90
90
 
91
 
static inline uint32 my_reverse_bits(uint32 key)
 
91
static inline uint32_t my_reverse_bits(uint32_t key)
92
92
{
93
93
  return
94
94
    (_my_bits_reverse_table[ key      & 255] << 24) |