summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-04-02 23:51:08 +0200
committerGitHub <noreply@github.com>2018-04-02 23:51:08 +0200
commit2481ea27ce0f423f3e6f3522539d20e1500cf572 (patch)
tree73251dcbf9146d7499177f59b266d8c60b0eaae7 /src/script
parente98fd934ce17a7af0b4629fc88158373303c88a0 (diff)
downloadminetest-2481ea27ce0f423f3e6f3522539d20e1500cf572.tar.gz
minetest-2481ea27ce0f423f3e6f3522539d20e1500cf572.tar.bz2
minetest-2481ea27ce0f423f3e6f3522539d20e1500cf572.zip
Fix many issues reported by clang-tidy (#7189)
* Fix many issues reported by clang-tidy We have many issues in code related to some performance to float <-> double. Clang-tidy reported it in performance-type-promotion-in-math-fn I fixed many of them. It's not ready for a promote to blocking Also fix some value which should be const-ref
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_object.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index b3c3bdf66..52bb0a784 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "lua_api/l_object.h"
+#include <cmath>
#include "lua_api/l_internal.h"
#include "lua_api/l_inventory.h"
#include "lua_api/l_item.h"
@@ -1060,7 +1061,8 @@ int ObjectRef::l_get_look_dir(lua_State *L)
// Do it
float pitch = co->getRadPitchDep();
float yaw = co->getRadYawDep();
- v3f v(cos(pitch)*cos(yaw), sin(pitch), cos(pitch)*sin(yaw));
+ v3f v(std::cos(pitch) * std::cos(yaw), std::sin(pitch), std::cos(pitch) *
+ std::sin(yaw));
push_v3f(L, v);
return 1;
}