diff options
Diffstat (limited to '')
-rw-r--r-- | src/Noise/Noise.h | 2 | ||||
-rw-r--r-- | src/Noise/OctavedNoise.h | 4 |
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(); } |