aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mg_ore.cpp
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/mapgen/mg_ore.cpp
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/mapgen/mg_ore.cpp')
-rw-r--r--src/mapgen/mg_ore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mapgen/mg_ore.cpp b/src/mapgen/mg_ore.cpp
index 672af7cdb..f83933ed1 100644
--- a/src/mapgen/mg_ore.cpp
+++ b/src/mapgen/mg_ore.cpp
@@ -345,7 +345,7 @@ void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed,
float ydist = (s32)y1 - (s32)csize / 2;
float zdist = (s32)z1 - (s32)csize / 2;
- noiseval -= (sqrt(xdist * xdist + ydist * ydist + zdist * zdist) / csize);
+ noiseval -= std::sqrt(xdist * xdist + ydist * ydist + zdist * zdist) / csize;
if (noiseval < nthresh)
continue;
@@ -469,7 +469,7 @@ void OreStratum::generate(MMVManip *vm, int mapseed, u32 blockseed,
noise_stratum_thickness->result[index] : (float)stratum_thickness) /
2.0f;
float nmid = noise->result[index];
- y0 = MYMAX(nmin.Y, ceil(nmid - nhalfthick));
+ y0 = MYMAX(nmin.Y, std::ceil(nmid - nhalfthick));
y1 = MYMIN(nmax.Y, nmid + nhalfthick);
} else { // Simple horizontal stratum
y0 = nmin.Y;