Code cleanup: avoid some warnings due to implicit uint/int/float/double conversion.

This commit is contained in:
Brecht Van Lommel
2013-06-07 16:06:17 +00:00
parent c24be7ec6e
commit d835d2f4e6
23 changed files with 96 additions and 62 deletions

View File

@@ -51,9 +51,9 @@ __device_noinline float4 voronoi_Fn(float3 p, float e, int n1, int n2)
/* returns distances in da and point coords in pa */
int xx, yy, zz, xi, yi, zi;
xi = (int)floorf(p.x);
yi = (int)floorf(p.y);
zi = (int)floorf(p.z);
xi = floor_to_int(p.x);
yi = floor_to_int(p.y);
zi = floor_to_int(p.z);
da[0] = 1e10f;
da[1] = 1e10f;
@@ -186,7 +186,7 @@ __device float noise_wave(NodeWaveBasis wave, float a)
}
else if(wave == NODE_WAVE_SAW) {
float b = 2.0f*M_PI_F;
int n = (int)(a / b);
int n = float_to_int(a / b);
a -= n*b;
if(a < 0.0f) a += b;
@@ -212,7 +212,7 @@ __device_noinline float noise_turbulence(float3 p, NodeNoiseBasis basis, float o
int i, n;
octaves = clamp(octaves, 0.0f, 16.0f);
n = (int)octaves;
n = float_to_int(octaves);
for(i = 0; i <= n; i++) {
float t = noise_basis(fscale*p, basis);