src/macros.h
changeset 8328 6909973c8359
parent 8325 1552eb5e5430
child 8329 77e50bd6ad67
equal deleted inserted replaced
8327:8bb4cdc7c5cc 8328:6909973c8359
   430  * Counts the number of set bits in a variable.
   430  * Counts the number of set bits in a variable.
   431  *
   431  *
   432  * @param value the value to count the number of bits in.
   432  * @param value the value to count the number of bits in.
   433  * @return the number of bits.
   433  * @return the number of bits.
   434  */
   434  */
   435 template<typename T> static inline uint COUNTBITS(T value)
   435 template<typename T> static inline uint CountBits(T value)
   436 {
   436 {
   437 	register uint num;
   437 	register uint num;
   438 
   438 
   439 	/* This loop is only called once for every bit set by clearing the lowest
   439 	/* This loop is only called once for every bit set by clearing the lowest
   440 	 * bit in each loop. The number of bits is therefore equal to the number of
   440 	 * bit in each loop. The number of bits is therefore equal to the number of