Fix a warning in random number generator

console-destruction
Sven Eberhardt 2016-08-30 18:55:35 -04:00
parent c487c530e4
commit a291ba2144
1 changed files with 1 additions and 2 deletions

View File

@ -163,8 +163,7 @@ inline bitcount_t trailingzeros(uint32_t v)
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
return multiplyDeBruijnBitPos[((uint32_t)((v & -v) * 0x077CB531U)) >> 27];
return multiplyDeBruijnBitPos[((uint32_t)((v & (~v+1)) * 0x077CB531U)) >> 27];
}
inline bitcount_t flog2(uint64_t v)