src/macros.h
changeset 7927 3a3289a049f9
parent 7926 01d19beae592
child 7928 63e18de69e50
equal deleted inserted replaced
7926:01d19beae592 7927:3a3289a049f9
   551  * @note n must be a power of 2
   551  * @note n must be a power of 2
   552  * @param x The min value
   552  * @param x The min value
   553  * @param n The base of the number we are searching
   553  * @param n The base of the number we are searching
   554  * @return The smallest multiple of n equal or greater than x
   554  * @return The smallest multiple of n equal or greater than x
   555  */
   555  */
   556 template<typename T> static inline T ALIGN(const T x, uint n) {
   556 template<typename T> static inline T Align(const T x, uint n) {
   557 	n--;
   557 	n--;
   558 	return (T)((x + n) & ~(n));
   558 	return (T)((x + n) & ~(n));
   559 }
   559 }
   560 
   560 
   561 /** return the largest value that can be entered in a variable.
   561 /** return the largest value that can be entered in a variable.