convertBitVectorToExtended.c

snippets · 193 B · 2010-03-30

convertBitvectorToExtended: converts a regular 32-bit bitvector into an extended bit vector.

Download   « Back to the snippets list

EXT_BV convertBitvectorToExtended( int bv )
{
	EXT_BV newBV;
	xCLEAR_BITS(newBV);
	for ( int i = 0; i < 32; i++ )
		if ( IS_SET( bv, 1 << i ) )
			xSET_BIT( newBV, i );
	return newBV;
}

Site Stats

Snippets: 1791
Codebases: 571