~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/ut0ut.h

  • Committer: Mark Atwood
  • Date: 2011-08-10 21:48:03 UTC
  • mfrom: (2258.3.6 percona-sign-problem)
  • Revision ID: me@mark.atwood.name-20110810214803-5y47vom6tw7ssw0e
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
@param n        in: number to round down
173
173
@param m        in: alignment, must be a power of two
174
174
@return         n rounded down to the biggest possible integer multiple of m */
175
 
#define ut_2pow_round(n, m) ((n) & ~((m) - 1))
 
175
#define ut_2pow_round(n, m) ((n) & ~(typeof(n))((m) - 1))
176
176
/** Align a number down to a multiple of a power of two.
177
177
@param n        in: number to round down
178
178
@param m        in: alignment, must be a power of two
184
184
@param n        in: number to round up
185
185
@param m        in: alignment, must be a power of two
186
186
@return         n rounded up to the smallest possible integer multiple of m */
187
 
#define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~((m) - 1))
 
187
#define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~(typeof(n))((m) - 1))
188
188
/*************************************************************//**
189
189
Calculates fast the 2-logarithm of a number, rounded upward to an
190
190
integer.