diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-04-02 23:51:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 23:51:08 +0200 |
commit | 2481ea27ce0f423f3e6f3522539d20e1500cf572 (patch) | |
tree | 73251dcbf9146d7499177f59b266d8c60b0eaae7 /src/mapgen/cavegen.cpp | |
parent | e98fd934ce17a7af0b4629fc88158373303c88a0 (diff) | |
download | minetest-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/mapgen/cavegen.cpp')
-rw-r--r-- | src/mapgen/cavegen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mapgen/cavegen.cpp b/src/mapgen/cavegen.cpp index d4cb5733b..6f571ba1f 100644 --- a/src/mapgen/cavegen.cpp +++ b/src/mapgen/cavegen.cpp @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "util/numeric.h" +#include <cmath> #include "map.h" #include "mapgen.h" #include "mapgen_v5.h" @@ -248,7 +249,7 @@ bool CavernsNoise::generateCaverns(MMVManip *vm, v3s16 nmin, v3s16 nmax) VoxelArea::add_y(em, vi, -1), cavern_amp_index++) { content_t c = vm->m_data[vi].getContent(); - float n_absamp_cavern = fabs(noise_cavern->result[index3d]) * + float n_absamp_cavern = std::fabs(noise_cavern->result[index3d]) * cavern_amp[cavern_amp_index]; // Disable CavesRandomWalk at a safe distance from caverns // to avoid excessively spreading liquids in caverns. |