summaryrefslogtreecommitdiff
path: root/src/utils/mathutils.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/utils/mathutils.h
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
manaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
manaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
manaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/utils/mathutils.h')
-rw-r--r--src/utils/mathutils.h8
1 files changed, 4 insertions, 4 deletions
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<uint16_t>(
+ 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<int>(v + 0.5) : static_cast<int>(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<int>(square_roots[n]);
- return static_cast<int>(sqrt(n));
+ return CAST_S32(square_roots[n]);
+ return CAST_S32(sqrt(n));
}
#endif // UTILS_MATHUTILS_H