aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorLoïc Blot <loic.blot@unix-experience.fr>2018-04-03 18:16:17 +0200
committerLoïc Blot <loic.blot@unix-experience.fr>2018-04-03 18:16:17 +0200
commit67a4cb7d8a4461fe7d5206189fd4e9539beb20b7 (patch)
tree059f4bea1f880c297a54b02d8f8e99bb77d1359f /src/server
parentbaca933b6bcf8c321748defa19769a54b27a89ba (diff)
downloadminetest-67a4cb7d8a4461fe7d5206189fd4e9539beb20b7.tar.gz
minetest-67a4cb7d8a4461fe7d5206189fd4e9539beb20b7.tar.bz2
minetest-67a4cb7d8a4461fe7d5206189fd4e9539beb20b7.zip
Fix various clang-tidy reported performance-type-promotion-in-math-fn
Diffstat (limited to 'src/server')
-rw-r--r--src/server/serveractiveobjectmap.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/server/serveractiveobjectmap.cpp b/src/server/serveractiveobjectmap.cpp
index e2def776d..ac89d5d18 100644
--- a/src/server/serveractiveobjectmap.cpp
+++ b/src/server/serveractiveobjectmap.cpp
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "serveractiveobjectmap.h"
+#include <cmath>
#include "constants.h"
#include "log.h"
#include "serverobject.h"
@@ -27,12 +28,12 @@ static constexpr float granularity = 16.0 * BS;
static aabb3s16 calcBox(const aabb3f &cb)
{
return aabb3s16(
- floor(cb.MinEdge.X / granularity),
- floor(cb.MinEdge.Y / granularity),
- floor(cb.MinEdge.Z / granularity),
- ceil(cb.MaxEdge.X / granularity),
- ceil(cb.MaxEdge.Y / granularity),
- ceil(cb.MaxEdge.Z / granularity));
+ std::floor(cb.MinEdge.X / granularity),
+ std::floor(cb.MinEdge.Y / granularity),
+ std::floor(cb.MinEdge.Z / granularity),
+ std::ceil(cb.MaxEdge.X / granularity),
+ std::ceil(cb.MaxEdge.Y / granularity),
+ std::ceil(cb.MaxEdge.Z / granularity));
}
void ServerActiveObjectMap::addObject(ServerActiveObject *object)