From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/utils/mathutils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/utils/mathutils.h') diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h index c5b6a515d..4bc3cf104 100644 --- a/src/utils/mathutils.h +++ b/src/utils/mathutils.h @@ -185,7 +185,7 @@ inline uint16_t getCrc16(const std::string &str) while (f != 0) { f --; - crc16 = static_cast( + crc16 = CAST_U16( crc_table[(crc16 ^ (str[f])) & 0xff] ^ (crc16 >> 8)); } @@ -225,7 +225,7 @@ constexpr inline float weightedAverage(const float n1, const float n2, constexpr inline int roundDouble(const double v) { - return (v > 0.0) ? static_cast(v + 0.5) : static_cast(v - 0.5); + return (v > 0.0) ? CAST_S32(v + 0.5) : CAST_S32(v - 0.5); } constexpr2 inline int powerOfTwo(const unsigned int input) @@ -239,8 +239,8 @@ constexpr2 inline int powerOfTwo(const unsigned int input) constexpr2 inline int fastSqrtInt(const unsigned int n) { if (n < 1000) - return static_cast(square_roots[n]); - return static_cast(sqrt(n)); + return CAST_S32(square_roots[n]); + return CAST_S32(sqrt(n)); } #endif // UTILS_MATHUTILS_H -- cgit v1.2.3-70-g09d2