diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-09 21:45:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-09 21:45:22 +0400 |
commit | 43361487bad926a9b32ce879f5b6961154507dfc (patch) | |
tree | 6a91b1e7709fbd85c9b70e735e81db71edb20ab2 /intern/cycles/kernel | |
parent | 0fbb6bff27139d66951fe223ff322c609d368a18 (diff) |
code cleanup: quiet all warnings about double promotion (either by changing the type or explicitly casting).
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_random.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_gradient.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_musgrave.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_texture.h | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h index 008ef2061a2..9083b7cbfd7 100644 --- a/intern/cycles/kernel/kernel_random.h +++ b/intern/cycles/kernel/kernel_random.h @@ -119,7 +119,7 @@ __device_inline float path_rng(KernelGlobals *kg, RNG *rng, int sample, int dime else shift = (*rng & 0xFFFF)/((float)0xFFFF); - return r + shift - floor(r + shift); + return r + shift - floorf(r + shift); #endif } diff --git a/intern/cycles/kernel/svm/svm_gradient.h b/intern/cycles/kernel/svm/svm_gradient.h index ce551a680b8..b29abed4edc 100644 --- a/intern/cycles/kernel/svm/svm_gradient.h +++ b/intern/cycles/kernel/svm/svm_gradient.h @@ -45,7 +45,7 @@ __device float svm_gradient(float3 p, NodeGradientType type) return (x + y)/2.0f; } else if(type == NODE_BLEND_RADIAL) { - return atan2(y, x)/(2.0f*M_PI_F) + 0.5f; + return atan2f(y, x) / (2.0f * M_PI_F) + 0.5f; } else { float r = fmaxf(1.0f - sqrtf(x*x + y*y + z*z), 0.0f); diff --git a/intern/cycles/kernel/svm/svm_musgrave.h b/intern/cycles/kernel/svm/svm_musgrave.h index 9444dc20e6e..425909e59f1 100644 --- a/intern/cycles/kernel/svm/svm_musgrave.h +++ b/intern/cycles/kernel/svm/svm_musgrave.h @@ -41,7 +41,7 @@ __device_noinline float noise_musgrave_fBm(float3 p, NodeNoiseBasis basis, float p *= lacunarity; } - rmd = octaves - floor(octaves); + rmd = octaves - floorf(octaves); if(rmd != 0.0f) value += rmd * snoise(p) * pwr; @@ -69,7 +69,7 @@ __device_noinline float noise_musgrave_multi_fractal(float3 p, NodeNoiseBasis ba p *= lacunarity; } - rmd = octaves - floor(octaves); + rmd = octaves - floorf(octaves); if(rmd != 0.0f) value *= (rmd * pwr * snoise(p) + 1.0f); /* correct? */ @@ -102,7 +102,7 @@ __device_noinline float noise_musgrave_hetero_terrain(float3 p, NodeNoiseBasis b p *= lacunarity; } - rmd = octaves - floor(octaves); + rmd = octaves - floorf(octaves); if(rmd != 0.0f) { increment = (snoise(p) + offset) * pwr * value; value += rmd * increment; @@ -141,7 +141,7 @@ __device_noinline float noise_musgrave_hybrid_multi_fractal(float3 p, NodeNoiseB p *= lacunarity; } - rmd = octaves - floor(octaves); + rmd = octaves - floorf(octaves); if(rmd != 0.0f) result += rmd * ((snoise(p) + offset) * pwr); diff --git a/intern/cycles/kernel/svm/svm_texture.h b/intern/cycles/kernel/svm/svm_texture.h index d8582621132..d12a85a5402 100644 --- a/intern/cycles/kernel/svm/svm_texture.h +++ b/intern/cycles/kernel/svm/svm_texture.h @@ -191,7 +191,7 @@ __device float noise_basis_hard(float3 p, NodeNoiseBasis basis, int hard) __device float noise_wave(NodeWaveBasis wave, float a) { if(wave == NODE_WAVE_SINE) { - return 0.5f + 0.5f*sin(a); + return 0.5f + 0.5f * sinf(a); } else if(wave == NODE_WAVE_SAW) { float b = 2.0f*M_PI_F; @@ -234,7 +234,7 @@ __device_noinline float noise_turbulence(float3 p, NodeNoiseBasis basis, float o fscale *= 2.0f; } - float rmd = octaves - floor(octaves); + float rmd = octaves - floorf(octaves); if(rmd != 0.0f) { float t = noise_basis(fscale*p, basis); |