core: instead of cpp-style, use C-style comments
This commit is contained in:
parent
3d4d9c7902
commit
aa57ea5b74
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
unsigned bitarithm_msb(unsigned v)
|
unsigned bitarithm_msb(unsigned v)
|
||||||
{
|
{
|
||||||
register unsigned r; // result of log2(v) will go here
|
register unsigned r; /* result of log2(v) will go here */
|
||||||
|
|
||||||
#if ARCH_32_BIT
|
#if ARCH_32_BIT
|
||||||
register unsigned shift;
|
register unsigned shift;
|
||||||
@ -37,7 +37,7 @@ unsigned bitarithm_msb(unsigned v)
|
|||||||
r |= (v >> 1);
|
r |= (v >> 1);
|
||||||
#else
|
#else
|
||||||
r = 0;
|
r = 0;
|
||||||
while (v >>= 1) { // unroll for more speed...
|
while (v >>= 1) { /* unroll for more speed... */
|
||||||
r++;
|
r++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,10 +48,10 @@ unsigned bitarithm_msb(unsigned v)
|
|||||||
|
|
||||||
unsigned bitarithm_bits_set(unsigned v)
|
unsigned bitarithm_bits_set(unsigned v)
|
||||||
{
|
{
|
||||||
unsigned c; // c accumulates the total bits set in v
|
unsigned c; /* c accumulates the total bits set in v */
|
||||||
|
|
||||||
for (c = 0; v; c++) {
|
for (c = 0; v; c++) {
|
||||||
v &= v - 1; // clear the least significant bit set
|
v &= v - 1; /* clear the least significant bit set */
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user