From 1fcc02e803d83ae8415ff44f9696cb215f475daa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Feb 2014 13:30:39 +0300 Subject: fix signed shifts. --- src/utils/mathutils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utils/mathutils.h') diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h index 545a1cc4b..f5a3dc102 100644 --- a/src/utils/mathutils.h +++ b/src/utils/mathutils.h @@ -70,7 +70,7 @@ inline float fastSqrt(const float x) A_WARN_UNUSED; constexpr inline float weightedAverage(const float n1, const float n2, const float w) A_WARN_UNUSED; constexpr inline int roundDouble(const double v) A_WARN_UNUSED; -inline int powerOfTwo(const int input) A_WARN_UNUSED; +inline int powerOfTwo(const unsigned int input) A_WARN_UNUSED; inline uint16_t getCrc16(const std::string &str) { @@ -123,9 +123,9 @@ constexpr inline int roundDouble(const double v) return (v > 0.0) ? static_cast(v + 0.5) : static_cast(v - 0.5); } -inline int powerOfTwo(const int input) +inline int powerOfTwo(const unsigned int input) { - int value = 1; + unsigned int value = 1; while (value < input) value <<= 1; return value; -- cgit v1.2.3-70-g09d2