Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-01-31 09:23:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-01-31 17:17:21 +0300
commit9e9cd77b8de68015a98659671272cc9d78710e69 (patch)
treea705baa2b3d4c2667085815c865a826c1f884173 /source/blender/blenkernel/intern/particle_child.c
parent535de7ec1fee94eae1769630b512c6ef4eb5bcad (diff)
Compiler warning: double-promotion
Diffstat (limited to 'source/blender/blenkernel/intern/particle_child.c')
-rw-r--r--source/blender/blenkernel/intern/particle_child.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c
index df03f39f62a..24fba604d1e 100644
--- a/source/blender/blenkernel/intern/particle_child.c
+++ b/source/blender/blenkernel/intern/particle_child.c
@@ -138,14 +138,15 @@ static void do_kink_spiral_deform(ParticleKey *state, const float dir[3], const
* and goes up to the Golden Spiral for 1.0
* http://en.wikipedia.org/wiki/Golden_spiral
*/
- const float b = shape * (1.0f + sqrtf(5.0f)) / M_PI * 0.25f;
+ const float b = shape * (1.0f + sqrtf(5.0f)) / (float)M_PI * 0.25f;
/* angle of the spiral against the curve (rotated opposite to make a smooth transition) */
- const float start_angle = (b != 0.0f ? atanf(1.0f / b) : -M_PI*0.5f) + (b > 0.0f ? -M_PI*0.5f : M_PI*0.5f);
+ const float start_angle = ((b != 0.0f) ? atanf(1.0f / b) :
+ (float)-M_PI_2) + (b > 0.0f ? -(float)M_PI_2 : (float)M_PI_2);
float spiral_axis[3], rot[3][3];
float vec[3];
- float theta = freq * time * 2.0f*M_PI;
+ float theta = freq * time * 2.0f * (float)M_PI;
float radius = amplitude * expf(b * theta);
/* a bit more intuitive than using negative frequency for this */
@@ -269,7 +270,7 @@ static void do_kink_spiral(ParticleThreadContext *ctx, ParticleTexture *ptex, co
normalize_v3(kink);
if (kink_axis_random > 0.0f) {
- float a = kink_axis_random * (psys_frand(ctx->sim.psys, 7112 + seed) * 2.0f - 1.0f) * M_PI;
+ float a = kink_axis_random * (psys_frand(ctx->sim.psys, 7112 + seed) * 2.0f - 1.0f) * (float)M_PI;
float rot[3][3];
axis_angle_normalized_to_mat3(rot, dir, a);