1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-17 17:08:39 +00:00

Fix various clang-tidy reported performance-type-promotion-in-math-fn

This commit is contained in:
Loïc Blot 2018-04-03 18:16:17 +02:00
parent baca933b6b
commit 67a4cb7d8a
8 changed files with 20 additions and 17 deletions

View file

@ -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)