diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-04 10:55:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-04 10:55:29 +0400 |
commit | deec4ce0bc77519f68392bc5b29ef211a31f1588 (patch) | |
tree | 81865ab303df791e61d9b50e849c53791be0ce0a /source/blender | |
parent | a05fdb837b89f2fba04587e99d0eecaa9cf174c3 (diff) |
Code Cleanup: avoid double promotion.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_scopes.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 4 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshdeform.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/occlusion.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/zbuf.c | 2 |
15 files changed, 20 insertions, 20 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 0e7cbb8cf1c..ab7ef8072a9 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -305,7 +305,7 @@ static void blf_texture_draw(float uv[2][2], float dx, float y1, float dx1, floa /* When a string is being rendered as individual glyphs (as in the game * engine), the leading edge needs to be raised a fraction to prevent * z-fighting for kerned characters. - z0r */ - float twist = (dx1 - dx) * 0.0002; + const float twist = (dx1 - dx) * 0.0002f; glBegin(GL_QUADS); glTexCoord2f(uv[0][0], uv[0][1]); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index d86fc5c9aef..1beaa59baad 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1151,7 +1151,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) spring->kl = MAX2(mface[i].v4, mface[i].v2); spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest); spring->type = CLOTH_SPRING_TYPE_SHEAR; - spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0; + spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0f; BLI_linklist_append ( &edgelist[spring->ij], spring ); BLI_linklist_append ( &edgelist[spring->kl], spring ); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 33b17f27ac8..ad89a9c959f 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -492,7 +492,7 @@ static void contarget_get_mesh_mat (Object *ob, const char *substring, float mat copy_v3_v3(plane, tmat[1]); cross_v3_v3v3(mat[0], normal, plane); - if(len_v3(mat[0]) < 1e-3) { + if(len_v3(mat[0]) < 1e-3f) { copy_v3_v3(plane, tmat[0]); cross_v3_v3v3(mat[0], normal, plane); } @@ -1263,7 +1263,7 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr /* If the curve is cyclic, enable looping around if the time is * outside the bounds 0..1 */ if ((curvetime < 0.0f) || (curvetime > 1.0f)) { - curvetime -= floor(curvetime); + curvetime -= floorf(curvetime); } } else { diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 318165af804..5feeb4c300d 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1987,7 +1987,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++) { /* use if the key is directly on the frame, rare cases this is needed else we get 0.0 instead. */ - if(fabs(bezt->vec[1][0] - evaltime) < SMALL_NUMBER) { + if(fabsf(bezt->vec[1][0] - evaltime) < SMALL_NUMBER) { cvalue= bezt->vec[1][1]; } /* evaltime occurs within the interval defined by these two keyframes */ diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index a8f89b0a1eb..9edcc7a73e8 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1583,7 +1583,7 @@ typedef struct WipeZone { static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo) { wipezone->flip = (wipe->angle < 0); - wipezone->angle = tan(DEG2RAD(fabsf(wipe->angle))); + wipezone->angle = tanf(DEG2RADF(fabsf(wipe->angle))); wipezone->xo = xo; wipezone->yo = yo; wipezone->width = (int)(wipe->edgeWidth*((xo+yo)/2.0f)); @@ -1602,9 +1602,9 @@ static float in_band(float width,float dist,int side,int dir) return (float)side; if(side == 1) - alpha = (dist+0.5*width) / (width); + alpha = (dist+0.5f*width) / (width); else - alpha = (0.5*width-dist) / (width); + alpha = (0.5f*width-dist) / (width); if(dir == 0) alpha = 1-alpha; diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index ca2aeca8f36..b9772b1f3b4 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -561,7 +561,7 @@ void BLI_init_srgb_conversion(void) for (i = 0; i < 0x10000; i++) { float f = linearrgb_to_srgb(index_to_float(i))*255.0f; if (f <= 0) BLI_color_to_srgb_table[i] = 0; - else if (f < 255) BLI_color_to_srgb_table[i] = (unsigned short)(f*0x100+.5); + else if (f < 255) BLI_color_to_srgb_table[i] = (unsigned short)(f*0x100+0.5f); else BLI_color_to_srgb_table[i] = 0xff00; } diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 9b7c49023c5..93cb0f8ae97 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1533,8 +1533,8 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc zoomx= (float)width / (scopes->track_preview->x-2*margin); zoomy= (float)height / (scopes->track_preview->y-2*margin); - off_x= ((int)track_pos[0]-track_pos[0]+0.5)*zoomx; - off_y= ((int)track_pos[1]-track_pos[1]+0.5)*zoomy; + off_x= ((int)track_pos[0]-track_pos[0]+0.5f)*zoomx; + off_y= ((int)track_pos[1]-track_pos[1]+0.5f)*zoomy; drawibuf= scale_trackpreview_ibuf(scopes->track_preview, track_pos, width, height, margin); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index dbc153de108..c528d8cd078 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -109,7 +109,7 @@ static float get_fluid_viscosity(FluidsimSettings *settings) return 2.0e-3; case 1: /* manual */ default: - return (1.0/pow(10.0, settings->viscosityExponent)) * settings->viscosityValue; + return (1.0f/powf(10.0f, settings->viscosityExponent)) * settings->viscosityValue; } } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index ce84e43955b..d05582512ae 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3153,7 +3153,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, dx = cache->mouse[0] - cache->initial_mouse[0]; dy = cache->mouse[1] - cache->initial_mouse[1]; - cache->vertex_rotation = -atan2(dx, dy) * cache->bstrength; + cache->vertex_rotation = -atan2f(dx, dy) * cache->bstrength; sd->draw_anchored = 1; copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse); diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index 6a56de26689..f902422ab43 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -450,7 +450,7 @@ void CLIP_OT_graph_view_all(wmOperatorType *ot) void ED_clip_graph_center_current_frame(Scene *scene, ARegion *ar) { View2D *v2d = &ar->v2d; - float extra = (v2d->cur.xmax - v2d->cur.xmin) / 2.0; + float extra = (v2d->cur.xmax - v2d->cur.xmin) / 2.0f; /* set extents of view to start/end frames */ v2d->cur.xmin = (float)CFRA - extra; diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 2bb40ce51f4..c13a5202c19 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -170,7 +170,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) for (x = 0; x < ibuf->x; x++) { unsigned char * rgb = src + 4 * (ibuf->x * y + x); - float v = (float)rgb_to_luma_byte(rgb) / 255.0; + float v = (float)rgb_to_luma_byte(rgb) / 255.0f; unsigned char * p = tgt; p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 41e7356ad10..9d368476f03 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5566,9 +5566,9 @@ static void headerTimeTranslate(TransInfo *t, char *str) /* apply snapping + frame->seconds conversions */ if (autosnap == SACTSNAP_STEP) { if (doTime) - val= floor((double)val/secf + 0.5f); + val= floorf((double)val/secf + 0.5f); else - val= floor(val + 0.5f); + val= floorf(val + 0.5f); } else { if (doTime) diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index e6e2c0fd621..d80c6715f9d 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -298,7 +298,7 @@ static void meshdeformModifier_do( fac= 1.0f - fac; } - if (fac <= 0.0) { + if (fac <= 0.0f) { continue; } } diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 782e0b59388..669355c9977 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1408,7 +1408,7 @@ static void sample_occ_tree(Render *re, OcclusionTree *tree, OccFace *exclude, f occlusion= (1.0f-correction)*(1.0f-occ); CLAMP(occlusion, 0.0f, 1.0f); if(correction != 0.0f) - occlusion += correction*exp(-occ); + occlusion += correction*expf(-occ); if(env) { /* sky shading using bent normal */ diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 0d5aed7dadb..807a3d7d0eb 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -245,7 +245,7 @@ int testclip(const float v[4]) /* if we set clip flags, the clipping should be at least larger than epsilon. prevents issues with vertices lying exact on borders */ - abs4= fabs(v[3]) + FLT_EPSILON; + abs4= fabsf(v[3]) + FLT_EPSILON; if( v[0] < -abs4) c+=1; else if( v[0] > abs4) c+=2; |