Count the total number of bits set in the supplied buffer, taken to be of the supplied size.

Return TypeFunction nameArguments
uint32_tCountBits(const void*,uint32_t,)

Declared in file: hzIntset.h
Defined in file : hzIntset.cpp

Function Logic:

0:START 1:unknown 2:Return -1 3:uber 4:unknown 5:nBits 6:Return nBits

Function body:

uint32_t CountBits (const void* buf)uint32_t nBytes, 
{
   //  Category: Bitwise
   //  
   //  Count the total number of bits set in the supplied buffer, taken to be of the supplied size.
   //  
   //  Arguments: 1) buf  The const void* buffer
   //     2) nBytes The number of bytes
   //  
   //  Returns: Number of bits found to be set
   const uchar*    uber ;      //  Buffer as a series of chars
   uint32_t        nCount ;    //  Buffer iterator
   uint32_t        nBits ;     //  Cumulative bit counter
   if (!buf)
       return -1;
   uber = (uchar*) buf ;
   for (nBits = nCount = 0; nCount < nBytes ; nCount++)
       nBits += s_BitArray[uber[nCount]] ;
   return nBits ;
}