Browse Source

use inline instead of static for code that is header only

chirpmodem-v8.0.0
f4exb 5 years ago
parent
commit
1ef45efc4a
  1. 4
      sdrbase/util/poweroftwo.h

4
sdrbase/util/poweroftwo.h

@ -22,14 +22,14 @@ @@ -22,14 +22,14 @@
// Is x a power of two
// From: https://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2
static bool isPowerOfTwo(uint32_t x)
inline bool isPowerOfTwo(uint32_t x)
{
return (x & (x - 1)) == 0;
}
// Calculate next power of 2 lower than x
// From: https://stackoverflow.com/questions/2679815/previous-power-of-2
static uint32_t lowerPowerOfTwo(uint32_t x)
inline uint32_t lowerPowerOfTwo(uint32_t x)
{
x = x | (x >> 1);
x = x | (x >> 2);

Loading…
Cancel
Save