diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-19 09:11:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-19 09:11:24 +0400 |
commit | 02b28e9162784933f470c5381b290f2582706a51 (patch) | |
tree | 1e1ed7c5c79eb20a57435eebc5a5f359a6feb90f /source/blender | |
parent | 445003973434da55614e90fcee2f99f1765afd8f (diff) |
replace MIN2 / MAX2 with minf / maxf to avoid calling functions multiple times.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pixelshading.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 9edcc7a73e8..d88a5c26c2c 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1697,7 +1697,7 @@ float hyp3,hyp4,b4,b5 hyp2 = fabsf(angle*x+y+(-(yo-posy*0.5f)-angle*(xo-posx*0.5f)))*wipezone->pythangle; } - hwidth= MIN2(hwidth, fabsf(b3-b1)/2.0f); + hwidth = minf(hwidth, fabsf(b3-b1)/2.0f); if(b2 < b1 && b2 < b3 ){ output = in_band(hwidth,hyp,0,1); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index dbf03e34c32..ceba6755821 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3472,7 +3472,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) view3d_operator_needs_opengl(C); selected= (short)count_selected_keys(scene, edit); - dmax = MAX2(fabs(dx), fabs(dy)); + dmax = maxf(fabsf(dx), fabsf(dy)); tot_steps = dmax/(0.2f * brush->size) + 1; dx /= (float)tot_steps; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9d368476f03..8749328c454 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4881,8 +4881,8 @@ static int doEdgeSlide(TransInfo *t, float perc) upVert = editedge_getOtherVert(tempsv->up, centerVert); downVert = editedge_getOtherVert(tempsv->down, centerVert); - len = MIN2(perc, len_v3v3(upVert->co,downVert->co)); - len = MAX2(len, 0); + len = minf(perc, len_v3v3(upVert->co, downVert->co)); + len = maxf(len, 0.0f); //Adjust Edgeloop if(prop) { diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index ef2abb20cf3..0ddaf07c67e 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1071,7 +1071,7 @@ static void do_material_tex(GPUShadeInput *shi) else newnor = tnor; - norfac = MIN2(fabsf(mtex->norfac), 1.0f); + norfac = minf(fabsf(mtex->norfac), 1.0f); if(norfac == 1.0f && !GPU_link_changed(stencil)) { shi->vn = newnor; diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 24683ec57f7..9746a6dbd86 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -161,7 +161,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) copy_v3_v3(lvrot, lv); mul_m3_v3(lar->imat, lvrot); - x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); + x = maxf(fabsf(lvrot[0]/lvrot[2]), fabsf(lvrot[1]/lvrot[2])); /* 1.0/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ inpr= 1.0/(sqrt(1.0f+x*x)); diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 2f620bb96d4..78420aa6ca8 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1204,7 +1204,7 @@ float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *d copy_v3_v3(lvrot, lv); mul_m3_v3(lar->imat, lvrot); - x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); + x = maxf(fabsf(lvrot[0]/lvrot[2]), fabsf(lvrot[1]/lvrot[2])); /* 1.0f/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ inpr= 1.0f/(sqrt(1.0f+x*x)); |