Codechange: replace hand written function to find first/last bit with C++ variant

This commit is contained in:
Rubidium
2024-01-18 18:40:52 +01:00
committed by rubidium42
parent 903119115b
commit 8faaedeff9
4 changed files with 31 additions and 60 deletions

View File

@@ -440,7 +440,7 @@ protected:
* integer, so at about 31 bits because of the sign bit, the
* least significant bits are removed.
*/
int mult_range = FindLastBit(x_axis_offset) + FindLastBit(abs(datapoint));
int mult_range = FindLastBit<uint32_t>(x_axis_offset) + FindLastBit<uint64_t>(abs(datapoint));
int reduce_range = std::max(mult_range - 31, 0);
/* Handle negative values differently (don't shift sign) */