summaryrefslogtreecommitdiffstats
path: root/src/Noise
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2016-11-13 20:00:01 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2016-11-13 20:00:01 +0100
commit944fdd173f40c0fcc718d6aa2af191bf993adc70 (patch)
tree28436adf7e20c58427c8d48685d944b964e11147 /src/Noise
parentMerge pull request #3430 from cuberite/Overrides (diff)
downloadcuberite-WarningsFixes.tar
cuberite-WarningsFixes.tar.gz
cuberite-WarningsFixes.tar.bz2
cuberite-WarningsFixes.tar.lz
cuberite-WarningsFixes.tar.xz
cuberite-WarningsFixes.tar.zst
cuberite-WarningsFixes.zip
Diffstat (limited to '')
-rw-r--r--src/Noise/Noise.h2
-rw-r--r--src/Noise/OctavedNoise.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Noise/Noise.h b/src/Noise/Noise.h
index 03f61643d..d4c56492e 100644
--- a/src/Noise/Noise.h
+++ b/src/Noise/Noise.h
@@ -269,7 +269,7 @@ NOISE_DATATYPE cNoise::CubicInterpolate(NOISE_DATATYPE a_A, NOISE_DATATYPE a_B,
NOISE_DATATYPE cNoise::CosineInterpolate(NOISE_DATATYPE a_A, NOISE_DATATYPE a_B, NOISE_DATATYPE a_Pct)
{
const NOISE_DATATYPE ft = a_Pct * static_cast<NOISE_DATATYPE>(3.1415927);
- const NOISE_DATATYPE f = static_cast<NOISE_DATATYPE>(static_cast<NOISE_DATATYPE>(1 - cos(ft)) * static_cast<NOISE_DATATYPE>(0.5));
+ const NOISE_DATATYPE f = static_cast<NOISE_DATATYPE>(static_cast<NOISE_DATATYPE>(1 - cos(static_cast<double>(ft))) * static_cast<NOISE_DATATYPE>(0.5));
return a_A * (1 - f) + a_B * f;
}
diff --git a/src/Noise/OctavedNoise.h b/src/Noise/OctavedNoise.h
index 6dd79365f..0b1a25549 100644
--- a/src/Noise/OctavedNoise.h
+++ b/src/Noise/OctavedNoise.h
@@ -61,7 +61,7 @@ public:
std::unique_ptr<NOISE_DATATYPE[]> workspaceHeap;
if (a_Workspace == nullptr)
{
- workspaceHeap.reset(new NOISE_DATATYPE[a_SizeX * a_SizeY]);
+ workspaceHeap.reset(new NOISE_DATATYPE[static_cast<size_t>(a_SizeX * a_SizeY)]);
a_Workspace = workspaceHeap.get();
}
@@ -121,7 +121,7 @@ public:
std::unique_ptr<NOISE_DATATYPE[]> workspaceHeap;
if (a_Workspace == nullptr)
{
- workspaceHeap.reset(new NOISE_DATATYPE[a_SizeX * a_SizeY * a_SizeZ]);
+ workspaceHeap.reset(new NOISE_DATATYPE[static_cast<size_t>(a_SizeX * a_SizeY * a_SizeZ)]);
a_Workspace = workspaceHeap.get();
}