code cleanup: replace MIN2/MAX2 with minf/maxf
authorCampbell Barton <ideasman42@gmail.com>
Sun, 29 Jul 2012 16:59:51 +0000 (16:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 29 Jul 2012 16:59:51 +0000 (16:59 +0000)
48 files changed:
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/intern/pbvh.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/voronoi.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
source/blender/editors/interface/interface_panel.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_clip/tracking_select.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/transform/transform.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/imbuf/intern/divers.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_dynamicpaint.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_mask.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_rna.c
source/blender/modifiers/intern/MOD_ocean.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/nodes/composite/nodes/node_composite_common.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/zbuf.c

index edb3120cf87923a5b9833842c48eb38bc7b8b31c..e6259cc9faf823652bf0f2444be3ab9cec7728af 100644 (file)
@@ -1168,7 +1168,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
                        /* constrain direction with maximum angular velocity */
                        angle = saacos(dot_v3v3(old_dir, wanted_dir));
-                       angle = MIN2(angle, val.max_ave);
+                       angle = minf(angle, val.max_ave);
 
                        cross_v3_v3v3(nor, old_dir, wanted_dir);
                        axis_angle_to_quat(q, nor, angle);
index f54e6595fe6e285f689a7e8b8455d07f2392cc23..468861242d0e03416deb6f612fdc798e653a3972 100644 (file)
@@ -1052,13 +1052,13 @@ void BKE_brush_painter_break_stroke(BrushPainter *painter)
 static void brush_pressure_apply(BrushPainter *painter, Brush *brush, float pressure)
 {
        if (BKE_brush_use_alpha_pressure(painter->scene, brush))
-               brush_alpha_set(painter->scene, brush, MAX2(0.0f, painter->startalpha * pressure));
+               brush_alpha_set(painter->scene, brush, maxf(0.0f, painter->startalpha * pressure));
        if (BKE_brush_use_size_pressure(painter->scene, brush))
-               BKE_brush_size_set(painter->scene, brush, MAX2(1.0f, painter->startsize * pressure));
+               BKE_brush_size_set(painter->scene, brush, maxf(1.0f, painter->startsize * pressure));
        if (brush->flag & BRUSH_JITTER_PRESSURE)
-               brush->jitter = MAX2(0.0f, painter->startjitter * pressure);
+               brush->jitter = maxf(0.0f, painter->startjitter * pressure);
        if (brush->flag & BRUSH_SPACING_PRESSURE)
-               brush->spacing = MAX2(1.0f, painter->startspacing * (1.5f - pressure));
+               brush->spacing = maxf(1.0f, painter->startspacing * (1.5f - pressure));
 }
 
 void BKE_brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], float jitterpos[2])
@@ -1158,7 +1158,7 @@ int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float p
                /* compute brush spacing adapted to brush radius, spacing may depend
                 * on pressure, so update it */
                brush_pressure_apply(painter, brush, painter->lastpressure);
-               spacing = MAX2(1.0f, radius) * brush->spacing * 0.01f;
+               spacing = maxf(1.0f, radius) * brush->spacing * 0.01f;
 
                /* setup starting distance, direction vector and accumulated distance */
                startdistance = painter->accumdistance;
@@ -1176,7 +1176,7 @@ int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float p
                                t = step / len;
                                press = (1.0f - t) * painter->lastpressure + t * pressure;
                                brush_pressure_apply(painter, brush, press);
-                               spacing = MAX2(1.0f, radius) * brush->spacing * 0.01f;
+                               spacing = maxf(1.0f, radius) * brush->spacing * 0.01f;
 
                                BKE_brush_jitter_pos(scene, brush, paintpos, finalpos);
 
index 194b41f9aaa712510438d42aa0c50bb954716f8b..20fae9737568497f0fc58fd1f093ff47bf327ee9 100644 (file)
@@ -66,10 +66,10 @@ CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, floa
        cumap->flag = CUMA_DO_CLIP;
        if (tot == 4) cumap->cur = 3;   /* rhms, hack for 'col' curve? */
        
-       clipminx = MIN2(minx, maxx);
-       clipminy = MIN2(miny, maxy);
-       clipmaxx = MAX2(minx, maxx);
-       clipmaxy = MAX2(miny, maxy);
+       clipminx = minf(minx, maxx);
+       clipminy = minf(miny, maxy);
+       clipmaxx = maxf(minx, maxx);
+       clipmaxy = maxf(miny, maxy);
        
        BLI_rctf_init(&cumap->curr, clipminx, clipmaxx, clipminy, clipmaxy);
        cumap->clipr = cumap->curr;
@@ -463,8 +463,8 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
        bezt = MEM_callocN(cuma->totpoint * sizeof(BezTriple), "beztarr");
        
        for (a = 0; a < cuma->totpoint; a++) {
-               cuma->mintable = MIN2(cuma->mintable, cmp[a].x);
-               cuma->maxtable = MAX2(cuma->maxtable, cmp[a].x);
+               cuma->mintable = minf(cuma->mintable, cmp[a].x);
+               cuma->maxtable = maxf(cuma->maxtable, cmp[a].x);
                bezt[a].vec[1][0] = cmp[a].x;
                bezt[a].vec[1][1] = cmp[a].y;
                if (cmp[a].flag & CUMA_VECTOR)
@@ -655,13 +655,13 @@ void curvemapping_changed(CurveMapping *cumap, int rem_doubles)
                for (a = 0; a < cuma->totpoint; a++) {
                        if (cmp[a].flag & CUMA_SELECT) {
                                if (cmp[a].x < clipr->xmin)
-                                       dx = MIN2(dx, cmp[a].x - clipr->xmin);
+                                       dx = minf(dx, cmp[a].x - clipr->xmin);
                                else if (cmp[a].x > clipr->xmax)
-                                       dx = MAX2(dx, cmp[a].x - clipr->xmax);
+                                       dx = maxf(dx, cmp[a].x - clipr->xmax);
                                if (cmp[a].y < clipr->ymin)
-                                       dy = MIN2(dy, cmp[a].y - clipr->ymin);
+                                       dy = minf(dy, cmp[a].y - clipr->ymin);
                                else if (cmp[a].y > clipr->ymax)
-                                       dy = MAX2(dy, cmp[a].y - clipr->ymax);
+                                       dy = maxf(dy, cmp[a].y - clipr->ymax);
                        }
                }
                for (a = 0; a < cuma->totpoint; a++) {
index c2b38442a6bed1c64c0fabb6fbbb14f3e3c5b1c5..8298023161b8e946f2bd4795f418d70669200167 100644 (file)
@@ -3624,7 +3624,7 @@ static void damptrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                cross_v3_v3v3(raxis, obvec, tarvec);
                
                rangle = dot_v3v3(obvec, tarvec);
-               rangle = acos(MAX2(-1.0f, MIN2(1.0f, rangle)) );
+               rangle = acos(maxf(-1.0f, minf(1.0f, rangle)));
                
                /* construct rotation matrix from the axis-angle rotation found above 
                 *      - this call takes care to make sure that the axis provided is a unit vector first
index 3c00397dfa566c10cb7c8fa3a91df73ec43745d7..5d50e8c491efa98fb9241c88bcb3085bf5ebad23 100644 (file)
@@ -995,8 +995,8 @@ void BKE_tracking_marker_clamp(MovieTrackingMarker *marker, int event)
        if (event == CLAMP_PAT_DIM) {
                for (a = 0; a < 2; a++) {
                        /* search shouldn't be resized smaller than pattern */
-                       marker->search_min[a] = MIN2(pat_min[a], marker->search_min[a]);
-                       marker->search_max[a] = MAX2(pat_max[a], marker->search_max[a]);
+                       marker->search_min[a] = minf(pat_min[a], marker->search_min[a]);
+                       marker->search_max[a] = maxf(pat_max[a], marker->search_max[a]);
                }
        }
        else if (event == CLAMP_PAT_POS) {
@@ -1020,8 +1020,8 @@ void BKE_tracking_marker_clamp(MovieTrackingMarker *marker, int event)
        else if (event == CLAMP_SEARCH_DIM) {
                for (a = 0; a < 2; a++) {
                        /* search shouldn't be resized smaller than pattern */
-                       marker->search_min[a] = MIN2(pat_min[a], marker->search_min[a]);
-                       marker->search_max[a] = MAX2(pat_max[a], marker->search_max[a]);
+                       marker->search_min[a] = minf(pat_min[a], marker->search_min[a]);
+                       marker->search_max[a] = maxf(pat_max[a], marker->search_max[a]);
                }
        }
        else if (event == CLAMP_SEARCH_POS) {
@@ -3272,7 +3272,7 @@ static float stabilization_calculate_autoscale_factor(MovieTracking *tracking, i
 
                                                S = (-w * I - h * J) / (dx * I + dy * J + K);
 
-                                               scale = MAX2(scale, S);
+                                               scale = maxf(scale, S);
                                        }
                                }
                        }
@@ -3281,7 +3281,7 @@ static float stabilization_calculate_autoscale_factor(MovieTracking *tracking, i
                stab->scale = scale;
 
                if (stab->maxscale > 0.0f)
-                       stab->scale = MIN2(stab->scale, stab->maxscale);
+                       stab->scale = minf(stab->scale, stab->maxscale);
        }
        else {
                stab->scale = 1.0f;
index 14f9001814c93c2a3045838a54f639fc3c691afe..9b05f0fc9768eae14b33b186af9305a786c30fdc 100644 (file)
@@ -189,8 +189,8 @@ static void BB_expand(BB *bb, float co[3])
 {
        int i;
        for (i = 0; i < 3; ++i) {
-               bb->bmin[i] = MIN2(bb->bmin[i], co[i]);
-               bb->bmax[i] = MAX2(bb->bmax[i], co[i]);
+               bb->bmin[i] = minf(bb->bmin[i], co[i]);
+               bb->bmax[i] = maxf(bb->bmax[i], co[i]);
        }
 }
 
@@ -199,8 +199,8 @@ static void BB_expand_with_bb(BB *bb, BB *bb2)
 {
        int i;
        for (i = 0; i < 3; ++i) {
-               bb->bmin[i] = MIN2(bb->bmin[i], bb2->bmin[i]);
-               bb->bmax[i] = MAX2(bb->bmax[i], bb2->bmax[i]);
+               bb->bmin[i] = minf(bb->bmin[i], bb2->bmin[i]);
+               bb->bmax[i] = maxf(bb->bmax[i], bb2->bmax[i]);
        }
 }
 
index 1f0bd445831516093f1518d2012be8e6b90e0646..2519137013092a1f8c4271d9ba227652007d0e0f 100644 (file)
@@ -658,7 +658,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf)
                                if (v1 == v2 || v2 == v3) break;
                                /* printf("test verts %x %x %x\n",v1,v2,v3); */
                                miny = minf(v1->xy[1], v3->xy[1]);
-                               /*  miny= MIN2(v1->xy[1],v3->xy[1]); */
+                               /*  miny= minf(v1->xy[1],v3->xy[1]); */
                                sc1 = sc + 1;
                                test = 0;
 
index dc76fb1493d728fefe233b5aa6e19e10c6c1ba5f..f61df9c11f591d5f3b234349bbe839acb691524e 100644 (file)
@@ -259,9 +259,9 @@ static float voronoi_getXOfEdge(VoronoiProcess *process, VoronoiParabola *par, f
        x2 = (-b - sqrtf(disc)) / (2 * a);
 
        if (p[1] < r[1])
-               ry = MAX2(x1, x2);
+               ry = maxf(x1, x2);
        else
-               ry = MIN2(x1, x2);
+               ry = minf(x1, x2);
 
        return ry;
 }
index c39096d08003b14391f821993908bd08880b088d..74d3df01fd03870844719370f86f62b7f583fac2 100644 (file)
@@ -236,7 +236,7 @@ static float quad_coord(float aa[3], float bb[3], float cc[3], float dd[3], int
 
                f1 = fabsf(f1);
                f2 = fabsf(f2);
-               f1 = MIN2(f1, f2);
+               f1 = minf(f1, f2);
                CLAMP(f1, 0.0f, 1.0f + FLT_EPSILON);
        }
        else {
index 03b72aefee6f530c6e7d233e4399321281ac6b29..5d63172dbfab5d24aaecb6ad33c6ace6c97517ac 100644 (file)
@@ -507,8 +507,8 @@ static int linecrossesf(const float v1[2], const float v2[2], const float v3[2],
 
 #define GETMIN2_AXIS(a, b, ma, mb, axis)   \
        {                                      \
-               ma[axis] = MIN2(a[axis], b[axis]); \
-               mb[axis] = MAX2(a[axis], b[axis]); \
+               ma[axis] = minf(a[axis], b[axis]); \
+               mb[axis] = maxf(a[axis], b[axis]); \
        } (void)0
 
 #define GETMIN2(a, b, ma, mb)          \
@@ -538,17 +538,17 @@ static int linecrossesf(const float v1[2], const float v2[2], const float v3[2],
        
        /* do an interval test on the x and y axes */
        /* first do x axis */
-       if (ABS(v1[1] - v2[1]) < EPS &&
-           ABS(v3[1] - v4[1]) < EPS &&
-           ABS(v1[1] - v3[1]) < EPS)
+       if (fabsf(v1[1] - v2[1]) < EPS &&
+           fabsf(v3[1] - v4[1]) < EPS &&
+           fabsf(v1[1] - v3[1]) < EPS)
        {
                return (mv4[0] >= mv1[0] && mv3[0] <= mv2[0]);
        }
 
        /* now do y axis */
-       if (ABS(v1[0] - v2[0]) < EPS &&
-           ABS(v3[0] - v4[0]) < EPS &&
-           ABS(v1[0] - v3[0]) < EPS)
+       if (fabsf(v1[0] - v2[0]) < EPS &&
+           fabsf(v3[0] - v4[0]) < EPS &&
+           fabsf(v1[0] - v3[0]) < EPS)
        {
                return (mv4[1] >= mv1[1] && mv3[1] <= mv2[1]);
        }
@@ -994,8 +994,8 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
 
        for (i = 0, l = BM_FACE_FIRST_LOOP(f); i < f->len; i++, l = l->next) {
                p1 = projverts[i];
-               out[0] = MAX2(out[0], p1[0]) + 0.01f;
-               out[1] = MAX2(out[1], p1[1]) + 0.01f;
+               out[0] = maxf(out[0], p1[0]) + 0.01f;
+               out[1] = maxf(out[1], p1[1]) + 0.01f;
                out[2] = 0.0f;
                p1[2] = 0.0f;
 
index daf517876e5ddcc0b0132d166ccefa1a65d6f89d..e28e77a5f5e2d7e7a5c0cbd0ee1ac6430f8c59a2 100644 (file)
@@ -95,7 +95,7 @@ void ProjectorLensDistortionOperation::updateDispersion()
                float result[4];
                this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
                this->m_dispersion = result[0];
-               this->m_kr = 0.25f * MAX2(MIN2(this->m_dispersion, 1.f), 0.f);
+               this->m_kr = 0.25f * maxf(minf(this->m_dispersion, 1.0f), 0.0f);
                this->m_kr2 = this->m_kr * 20;
                this->m_dispersionAvailable = true;
        }
index d431ce2955460d70d827f845bc7235db511f9013..c8052667fa0f41ac9bc6b765c3cf290167c36093 100644 (file)
@@ -301,11 +301,11 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input
 
 void ScreenLensDistortionOperation::updateVariables(float distortion, float dispersion)
 {
-       this->m_kg = MAX2(MIN2(distortion, 1.f), -0.999f);
+       this->m_kg = maxf(minf(distortion, 1.0f), -0.999f);
        // smaller dispersion range for somewhat more control
        const float d = 0.25f * MAX2(MIN2(dispersion, 1.f), 0.f);
-       this->m_kr = MAX2(MIN2((this->m_kg + d), 1.0f), -0.999f);
-       this->m_kb = MAX2(MIN2((this->m_kg - d), 1.0f), -0.999f);
+       this->m_kr = maxf(minf((this->m_kg + d), 1.0f), -0.999f);
+       this->m_kb = maxf(minf((this->m_kg - d), 1.0f), -0.999f);
        this->m_maxk = MAX3(this->m_kr, this->m_kg, this->m_kb);
        this->m_sc = (this->m_data->fit && (this->m_maxk > 0.f)) ? (1.f / (1.f + 2.f * this->m_maxk)) : (1.f / (1.f + this->m_maxk));
        this->m_drg = 4.f * (this->m_kg - this->m_kr);
index 76485571096e4ad0d0ef5df73a1c4b30728b4199..d04c1af2769851329ca2fb7ebf7da9ebe8c0e267 100644 (file)
@@ -831,14 +831,15 @@ static void ui_do_animate(const bContext *C, Panel *panel)
        float fac;
 
        fac = (PIL_check_seconds_timer() - data->starttime) / ANIMATION_TIME;
-       fac = sqrt(fac);
-       fac = MIN2(fac, 1.0f);
+       fac = minf(sqrt(fac), 1.0f);
 
        /* for max 1 second, interpolate positions */
-       if (uiAlignPanelStep(sa, ar, fac, 0))
+       if (uiAlignPanelStep(sa, ar, fac, 0)) {
                ED_region_tag_redraw(ar);
-       else
+       }
+       else {
                fac = 1.0f;
+       }
 
        if (fac >= 1.0f) {
                panel_activate_state(C, panel, PANEL_STATE_EXIT);
index a869886355a9ebcbbe8ed60cbd1820debfaacbac..fa7df050a42ecc72f8c430eb9faf47b742523b6d 100644 (file)
@@ -2624,21 +2624,21 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
                                m1 = MAXSLOPE;
                                b1 = x12;
                        }
-                       x2max = MAX2(x21, x22) + 0.001f; /* prevent missed edges   */
-                       x2min = MIN2(x21, x22) - 0.001f; /* due to round off error */
-                       y2max = MAX2(y21, y22) + 0.001f;
-                       y2min = MIN2(y21, y22) - 0.001f;
+                       x2max = maxf(x21, x22) + 0.001f; /* prevent missed edges   */
+                       x2min = minf(x21, x22) - 0.001f; /* due to round off error */
+                       y2max = maxf(y21, y22) + 0.001f;
+                       y2min = minf(y21, y22) - 0.001f;
                        
                        /* Found an intersect,  calc intersect point */
                        if (m1 == m2) { /* co-incident lines */
                                /* cut at 50% of overlap area */
-                               x1max = MAX2(x11, x12);
-                               x1min = MIN2(x11, x12);
-                               xi = (MIN2(x2max, x1max) + MAX2(x2min, x1min)) / 2.0f;
+                               x1max = maxf(x11, x12);
+                               x1min = minf(x11, x12);
+                               xi = (minf(x2max, x1max) + maxf(x2min, x1min)) / 2.0f;
                                
-                               y1max = MAX2(y11, y12);
-                               y1min = MIN2(y11, y12);
-                               yi = (MIN2(y2max, y1max) + MAX2(y2min, y1min)) / 2.0f;
+                               y1max = maxf(y11, y12);
+                               y1min = minf(y11, y12);
+                               yi = (minf(y2max, y1max) + maxf(y2min, y1min)) / 2.0f;
                        }
                        else if (m2 == MAXSLOPE) {
                                xi = x22;
@@ -4983,7 +4983,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, wmEvent *event)
 
                if (handleNumInput(&opdata->num_input, event)) {
                        applyNumInput(&opdata->num_input, amounts);
-                       amounts[0] = MAX2(amounts[0], 0.0f);
+                       amounts[0] = maxf(amounts[0], 0.0f);
                        RNA_float_set(op->ptr, "thickness", amounts[0]);
                        RNA_float_set(op->ptr, "depth", amounts[1]);
 
@@ -5024,7 +5024,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, wmEvent *event)
                                if (opdata->modify_depth)
                                        RNA_float_set(op->ptr, "depth", amount);
                                else {
-                                       amount = MAX2(amount, 0.0f);
+                                       amount = maxf(amount, 0.0f);
                                        RNA_float_set(op->ptr, "thickness", amount);
                                }
 
index 2a497d599aa4e37e223087f0eee2292c6de4dcab..306724de30167cc9921648bf652acea4ecb1ba24 100644 (file)
@@ -5236,7 +5236,7 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
                           !(ts->use_uv_sculpt && (scene->basact->object->mode == OB_MODE_EDIT));
 
                if (use_zoom) {
-                       pixel_size = MAX2(size * zoomx, size * zoomy);
+                       pixel_size = size * maxf(zoomx, zoomy);
                }
                else {
                        pixel_size = size;
index 8e13bc61ee85adab15fd7f337f2b051745ae4f44..96eb60028406e4235c8bd185004bce22b3c5ab38 100644 (file)
@@ -732,7 +732,7 @@ static float get_shortest_pattern_side(MovieTrackingMarker *marker)
 
                cur_len = len_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]);
 
-               len = MIN2(cur_len, len);
+               len = minf(cur_len, len);
        }
 
        return len;
@@ -804,11 +804,11 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
        dy = 6.0f / height / sc->zoom;
 
        side = get_shortest_pattern_side(marker);
-       patdx = MIN2(dx * 2.0f / 3.0f, side / 6.0f);
-       patdy = MIN2(dy * 2.0f / 3.0f, side * width / height / 6.0f);
+       patdx = minf(dx * 2.0f / 3.0f, side / 6.0f);
+       patdy = minf(dy * 2.0f / 3.0f, side * width / height / 6.0f);
 
-       searchdx = MIN2(dx, (marker->search_max[0] - marker->search_min[0]) / 6.0f);
-       searchdy = MIN2(dy, (marker->search_max[1] - marker->search_min[1]) / 6.0f);
+       searchdx = minf(dx, (marker->search_max[0] - marker->search_min[0]) / 6.0f);
+       searchdy = minf(dy, (marker->search_max[1] - marker->search_min[1]) / 6.0f);
 
        px[0] = 1.0f / sc->zoom / width / sc->scale;
        px[1] = 1.0f / sc->zoom / height / sc->scale;
index 54ee691b63b60f798c0d875f439156a3bca6cd81..349303afbf225c8062f3b3068d1ea6e1589b505f 100644 (file)
@@ -351,7 +351,7 @@ int ED_clip_view_selection(const bContext *C, ARegion *ar, int fit)
                zoomx = (float)width / w / aspx;
                zoomy = (float)height / h / aspy;
 
-               newzoom = 1.0f / power_of_2(1.0f / MIN2(zoomx, zoomy));
+               newzoom = 1.0f / power_of_2(1.0f / minf(zoomx, zoomy));
 
                if (fit || sc->zoom > newzoom)
                        sc->zoom = newzoom;
index f7222dae75fb2672f539277c081d22b4163f3f3f..20d47063cd4af19c8680a79f93b561373388472f 100644 (file)
@@ -735,7 +735,7 @@ static int view_all_exec(bContext *C, wmOperator *op)
                zoomx = (float) width / (w + 2 * margin);
                zoomy = (float) height / (h + 2 * margin);
 
-               sclip_zoom_set(C, MIN2(zoomx, zoomy), NULL);
+               sclip_zoom_set(C, minf(zoomx, zoomy), NULL);
        }
        else {
                if ((w >= width || h >= height) && (width > 0 && height > 0)) {
@@ -743,7 +743,7 @@ static int view_all_exec(bContext *C, wmOperator *op)
                        zoomy = (float) height / h;
 
                        /* find the zoom value that will fit the image in the image space */
-                       sclip_zoom_set(C, 1.0f / power_of_2(1.0f / MIN2(zoomx, zoomy)), NULL);
+                       sclip_zoom_set(C, 1.0f / power_of_2(1.0f / minf(zoomx, zoomy)), NULL);
                }
                else
                        sclip_zoom_set(C, 1.0f, NULL);
index 77c4b527a110c73921e137d6ba5dcacae95999cf..153287eecdd62f34605e092cd3309ed321a14b8b 100644 (file)
@@ -373,8 +373,8 @@ static int mouse_on_slide_zone(SpaceClip *sc, MovieTrackingMarker *marker,
        dx = size / width / sc->zoom;
        dy = size / height / sc->zoom;
 
-       dx = MIN2(dx, (max[0] - min[0]) / 6.0f);
-       dy = MIN2(dy, (max[1] - min[1]) / 6.0f);
+       dx = minf(dx, (max[0] - min[0]) / 6.0f);
+       dy = minf(dy, (max[1] - min[1]) / 6.0f);
 
        return IN_RANGE_INCL(co[0], slide_zone[0] - dx, slide_zone[0] + dx) &&
               IN_RANGE_INCL(co[1], slide_zone[1] - dy, slide_zone[1] + dy);
@@ -425,14 +425,14 @@ static int get_mouse_pattern_corner(SpaceClip *sc, MovieTrackingMarker *marker,
 
                cur_len = len_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]);
 
-               len = MIN2(cur_len, len);
+               len = minf(cur_len, len);
        }
 
        dx = 12.0f / width / sc->zoom;
        dy = 12.0f / height / sc->zoom;
 
-       dx = MIN2(dx, len * 2.0f / 3.0f);
-       dy = MIN2(dy, len * width / height * 2.0f / 3.0f);
+       dx = minf(dx, len * 2.0f / 3.0f);
+       dy = minf(dy, len * width / height * 2.0f / 3.0f);
 
        for (i = 0; i < 4; i++) {
                float crn[2];
@@ -463,8 +463,8 @@ static int mouse_on_offset(SpaceClip *sc, MovieTrackingTrack *track, MovieTracki
        dx = 12.0f / width / sc->zoom;
        dy = 12.0f / height / sc->zoom;
 
-       dx = MIN2(dx, (pat_max[0] - pat_min[0]) / 2.0f);
-       dy = MIN2(dy, (pat_max[1] - pat_min[1]) / 2.0f);
+       dx = minf(dx, (pat_max[0] - pat_min[0]) / 2.0f);
+       dy = minf(dy, (pat_max[1] - pat_min[1]) / 2.0f);
 
        return co[0] >= pos[0] - dx && co[0] <= pos[0] + dx && co[1] >= pos[1] - dy && co[1] <= pos[1] + dy;
 }
index 9581d7708fb3d4e55d09416a21f31a809cb234ea..559fe8c840dd86dc7e5ce0e70fa38085be87a06b 100644 (file)
@@ -107,7 +107,7 @@ static int mouse_on_crns(float co[2], float pos[2], float crns[4][2], float epsx
 {
        float dist = dist_to_crns(co, pos, crns);
 
-       return dist < MAX2(epsx, epsy);
+       return dist < maxf(epsx, epsy);
 }
 
 static int track_mouse_area(const bContext *C, float co[2], MovieTrackingTrack *track)
@@ -128,8 +128,8 @@ static int track_mouse_area(const bContext *C, float co[2], MovieTrackingTrack *
        epsy = MIN4(pat_min[1] - marker->search_min[1], marker->search_max[1] - pat_max[1],
                    fabsf(pat_min[1]), fabsf(pat_max[1])) / 2;
 
-       epsx = MAX2(epsx, 2.0f / width);
-       epsy = MAX2(epsy, 2.0f / height);
+       epsx = maxf(epsx, 2.0f / width);
+       epsy = maxf(epsy, 2.0f / height);
 
        if (sc->flag & SC_SHOW_MARKER_SEARCH) {
                if (mouse_on_rect(co, marker->pos, marker->search_min, marker->search_max, epsx, epsy))
index 4626600f2cf49106af7f55c52fe5abe154caaec0..d34f734c6c2b5dc2c009bc5d8e30b676a4722c20 100644 (file)
@@ -582,7 +582,7 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op))
                /* find the zoom value that will fit the image in the image space */
                zoomx = width / w;
                zoomy = height / h;
-               sima_zoom_set(sima, ar, 1.0f / power_of_2(1 / MIN2(zoomx, zoomy)), NULL);
+               sima_zoom_set(sima, ar, 1.0f / power_of_2(1.0f / minf(zoomx, zoomy)), NULL);
        }
        else
                sima_zoom_set(sima, ar, 1.0f, NULL);
index 5c9994e46d354e17206ee027e6ac83f8075ebb41..a3e9ca1c4a26cd0aaf7cca74b97cf66b4c2a2aa2 100644 (file)
@@ -266,8 +266,8 @@ static void get_nlastrip_extents(bAnimContext *ac, float *min, float *max, const
                                /* only consider selected strips? */
                                if ((onlySel == 0) || (strip->flag & NLASTRIP_FLAG_SELECT)) {
                                        /* extend range if appropriate */
-                                       *min = MIN2(*min, strip->start);
-                                       *max = MAX2(*max, strip->end);
+                                       *min = minf(*min, strip->start);
+                                       *max = maxf(*max, strip->end);
                                }
                        }
                }
index ad3e1954e68ec2929685828ef27d502b107b8ec8..c546eda19982cd53c6680292b028b4c1adc1ce98 100644 (file)
@@ -3155,7 +3155,7 @@ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
                                float zoomx, zoomy;
                                zoomx = (float)sa->winx / ibuf->x;
                                zoomy = (float)sa->winy / ibuf->y;
-                               zoom = MIN2(zoomx, zoomy);
+                               zoom = minf(zoomx, zoomy);
                        }
                        
                        x = (sa->winx - zoom * ibuf->x) / 2 + snode->xof;
index 8c9f057efc1aa861bd930eea3890b4da5cf1a28c..f8ce572ee46cf30d0021fc7cad1fedf0e782f0cd 100644 (file)
@@ -413,7 +413,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
        node->totr.xmin = locx;
        node->totr.xmax = locx + node->width;
        node->totr.ymax = locy;
-       node->totr.ymin = MIN2(dy, locy - 2 * NODE_DY);
+       node->totr.ymin = minf(dy, locy - 2 * NODE_DY);
        
        /* Set the block bounds to clip mouse events from underlying nodes.
         * Add a margin for sockets on each side.
index 057382549b6da8cbd91159c6404deeab10550cfc..4034c9f98f034c1b9b521f3df3aecc153a1034b8 100644 (file)
@@ -2111,7 +2111,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
                zoomY = ((float)height) / ((float)imgheight);
                sseq->zoom = (zoomX < zoomY) ? zoomX : zoomY;
 
-               sseq->zoom = 1.0f / power_of_2(1 / MIN2(zoomX, zoomY) );
+               sseq->zoom = 1.0f / power_of_2(1 / minf(zoomX, zoomY));
        }
        else {
                sseq->zoom = 1.0f;
index ac31d0d622e687defdad90c17651a315223206d5..85a4d911df5cc59808200b5d880a5720e4cfce0b 100644 (file)
@@ -1716,7 +1716,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
 
                        /* for some reason; zoomlevels down refuses to use GL_ALPHA_SCALE */
                        if (zoomx < 1.0f || zoomy < 1.0f) {
-                               float tzoom = MIN2(zoomx, zoomy);
+                               float tzoom = minf(zoomx, zoomy);
                                int mip = 0;
 
                                if ((ibuf->userflags & IB_MIPMAP_INVALID) != 0) {
index 440f73446161b38a4484f8ad3124f21888cf1b19..ba665cfb89cd2d8509d1c6a909683cd51b90dd56 100644 (file)
@@ -2435,7 +2435,7 @@ static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was
        xfac = (float)ar->winx / (float)(size[0] + 4);
        yfac = (float)ar->winy / (float)(size[1] + 4);
 
-       rv3d->camzoom = BKE_screen_view3d_zoom_from_fac(MIN2(xfac, yfac));
+       rv3d->camzoom = BKE_screen_view3d_zoom_from_fac(minf(xfac, yfac));
        CLAMP(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
 
        WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
index 3efd7c252fe9607a256c44c91b6bd138eea2168c..561e97a83937b7fb5a46afcba60e422687f4efe9 100644 (file)
@@ -549,7 +549,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
                                time_wheel = (float)(time_currwheel - fly->time_lastwheel);
                                fly->time_lastwheel = time_currwheel;
                                /* Mouse wheel delays range from (0.5 == slow) to (0.01 == fast) */
-                               time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
+                               time_wheel = 1.0f + (10.0f - (20.0f * minf(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
 
                                if (fly->speed < 0.0f) {
                                        fly->speed = 0.0f;
@@ -567,7 +567,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
                                time_currwheel = PIL_check_seconds_timer();
                                time_wheel = (float)(time_currwheel - fly->time_lastwheel);
                                fly->time_lastwheel = time_currwheel;
-                               time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
+                               time_wheel = 1.0f + (10.0f - (20.0f * minf(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
 
                                if (fly->speed > 0.0f) {
                                        fly->speed = 0;
@@ -843,7 +843,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
 #endif
                        time_current = PIL_check_seconds_timer();
                        time_redraw = (float)(time_current - fly->time_lastdraw);
-                       time_redraw_clamped = MIN2(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */
+                       time_redraw_clamped = minf(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */
                        fly->time_lastdraw = time_current;
 
                        /* Scale the time to use shift to scale the speed down- just like
index f7fbc7002a2cbb80f32c4ca953b7796c9c284688..feab96d6ddfbd6ea461ddb33517d09870fe19fe2 100644 (file)
@@ -972,7 +972,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                if (t->flag & T_PROP_EDIT) {
                                        t->prop_size *= 1.1f;
                                        if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO)
-                                               t->prop_size = MIN2(t->prop_size, ((View3D *)t->view)->far);
+                                               t->prop_size = minf(t->prop_size, ((View3D *)t->view)->far);
                                        calculatePropRatio(t);
                                }
                                t->redraw |= TREDRAW_HARD;
@@ -1142,7 +1142,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                if (event->alt && t->flag & T_PROP_EDIT) {
                                        t->prop_size *= 1.1f;
                                        if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO)
-                                               t->prop_size = MIN2(t->prop_size, ((View3D *)t->view)->far);
+                                               t->prop_size = minf(t->prop_size, ((View3D *)t->view)->far);
                                        calculatePropRatio(t);
                                }
                                t->redraw = 1;
index 652b16a7c6546e2bd19d5843bbc8e38a9e0f7df0..1154605c6735aecbcdfb65b7a3d5dbe577ee9581 100644 (file)
@@ -1255,7 +1255,7 @@ static IK_Scene *convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
                        joint += ":TY";
                        ret = arm->addSegment(joint, parent, KDL::Joint::TransY, rot[ikchan->ndof - 1]);
                        float ikstretch = pchan->ikstretch * pchan->ikstretch;
-                       weight[1] = (1.0 - MIN2(1.0 - ikstretch, 0.99));
+                       weight[1] = (1.0 - minf(1.0 - ikstretch, 0.99));
                        weights.push_back(weight[1]);
                }
                if (!ret)
index d46bf4fca4d5afdc52cd18ca5288b948e49c087c..54903c838350b2dc762a7a230807d21d04fac625 100644 (file)
@@ -752,7 +752,7 @@ void IMB_buffer_float_clamp(float *buf, int width, int height)
 {
        int i, total = width * height * 4;
        for (i = 0; i < total; i++) {
-               buf[i] = MIN2(1.0, buf[i]);
+               buf[i] = minf(1.0, buf[i]);
        }
 }
 
index 3b4f87d8b95c3e9f2ad3c99d362798a576f8fffc..5f1ce4f27736823ad1b04d9adf28df5e1100a204 100644 (file)
@@ -58,7 +58,7 @@ static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
 static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        Object *ob = (Object *)ptr->id.data;
-/*     ClothSimSettings *settings = (ClothSimSettings*)ptr->data; */
+/*     ClothSimSettings *settings = (ClothSimSettings *)ptr->data; */
        ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
 
        cloth_free_modifier(clmd);
index 6739e5b71fa33127ebd33131aecdd41772ada718..4f9f2009a142fa3e4c417b4e6053211ba671ab94 100644 (file)
@@ -170,7 +170,7 @@ static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
 static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 {
        DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
-       /*rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */
+       /*rna_iterator_array_begin(iter, (void *)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */
        rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL);
 }
 
index c98e1f3312bd9580025d26322d909c1dc5920b2d..96c5ff991f614088b46c03f64525bedc89ba0acf 100644 (file)
@@ -255,7 +255,7 @@ static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerR
 
 static void rna_Main_masks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 {
-       Main *bmain = (Main*)ptr->data;
+       Main *bmain = (Main *)ptr->data;
        rna_iterator_listbase_begin(iter, &bmain->mask, NULL);
 }
 
index 2d972d2639870371fd8516aee3918dd8cb2c26a1..382f5501ca477c0065a0529337e74efe6fdc5bac 100644 (file)
@@ -108,21 +108,21 @@ static void rna_Mask_update_parent(Main *bmain, Scene *scene, PointerRNA *ptr)
 /* note: this function exists only to avoid id refcounting */
 static void rna_MaskParent_id_set(PointerRNA *ptr, PointerRNA value)
 {
-       MaskParent *mpar = (MaskParent*) ptr->data;
+       MaskParent *mpar = (MaskParent *) ptr->data;
 
        mpar->id = value.data;
 }
 
 static StructRNA *rna_MaskParent_id_typef(PointerRNA *ptr)
 {
-       MaskParent *mpar = (MaskParent*) ptr->data;
+       MaskParent *mpar = (MaskParent *) ptr->data;
 
        return ID_code_to_RNA_type(mpar->id_type);
 }
 
 static void rna_MaskParent_id_type_set(PointerRNA *ptr, int value)
 {
-       MaskParent *mpar = (MaskParent*) ptr->data;
+       MaskParent *mpar = (MaskParent *) ptr->data;
 
        /* change ID-type to the new type */
        mpar->id_type = value;
@@ -248,49 +248,49 @@ static void rna_MaskLayer_active_spline_point_set(PointerRNA *ptr, PointerRNA va
 
 static void rna_MaskSplinePoint_handle1_get(PointerRNA *ptr, float *values)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
        copy_v2_v2(values, bezt->vec[0]);
 }
 
 static void rna_MaskSplinePoint_handle1_set(PointerRNA *ptr, const float *values)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
        copy_v2_v2(bezt->vec[0], values);
 }
 
 static void rna_MaskSplinePoint_handle2_get(PointerRNA *ptr, float *values)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
        copy_v2_v2(values, bezt->vec[2]);
 }
 
 static void rna_MaskSplinePoint_handle2_set(PointerRNA *ptr, const float *values)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
        copy_v2_v2(bezt->vec[2], values);
 }
 
 static void rna_MaskSplinePoint_ctrlpoint_get(PointerRNA *ptr, float *values)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
        copy_v2_v2(values, bezt->vec[1]);
 }
 
 static void rna_MaskSplinePoint_ctrlpoint_set(PointerRNA *ptr, const float *values)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
        copy_v2_v2(bezt->vec[1], values);
 }
 
 static int rna_MaskSplinePoint_handle_type_get(PointerRNA *ptr)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
 
        return bezt->h1;
@@ -298,7 +298,7 @@ static int rna_MaskSplinePoint_handle_type_get(PointerRNA *ptr)
 
 static void rna_MaskSplinePoint_handle_type_set(PointerRNA *ptr, int value)
 {
-       MaskSplinePoint *point = (MaskSplinePoint*) ptr->data;
+       MaskSplinePoint *point = (MaskSplinePoint *) ptr->data;
        BezTriple *bezt = &point->bezt;
 
        bezt->h1 = bezt->h2 = value;
@@ -336,7 +336,7 @@ static void rna_Mask_layers_clear(Mask *mask)
 
 static void rna_MaskLayer_spline_add(ID *id, MaskLayer *masklay, int number)
 {
-       Mask *mask = (Mask*) id;
+       Mask *mask = (Mask *) id;
        int i;
 
        for (i = 0; i < number; i++)
index b47f957ac76924ee2600f6cc143d9df52eba8eba..1675396185278c92a684b832c116ef1a25a87821 100644 (file)
@@ -362,7 +362,7 @@ static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *report
  */
 void rna_NlaTrack_solo_set(PointerRNA *ptr, int value)
 {
-       NlaTrack *data = (NlaTrack*)ptr->data;
+       NlaTrack *data = (NlaTrack *)ptr->data;
        AnimData *adt = BKE_animdata_from_id(ptr->id.data);
        NlaTrack *nt;
 
index 4920b40c85423a6debc137ef1f8248539c4cfcc8..db309ed8f1f2df1a8f4540e62312578baf047822 100644 (file)
@@ -829,7 +829,7 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point
        int totitem, free = 0;
        
        rna_idproperty_check(&prop, ptr);
-       /* eprop= (EnumPropertyRNA*)prop; */
+       /* eprop= (EnumPropertyRNA *)prop; */
        
        RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free);
        rna_iterator_array_begin(iter, (void *)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator);
index dfbfbd2247591fba89f4dc24de4c7f135f577e72..21836453eedf799dd1a7923ee49047790704f44e 100644 (file)
@@ -242,13 +242,13 @@ static void dm_get_bounds(DerivedMesh *dm, float *sx, float *sy, float *ox, floa
        copy_v3_v3(max, mvert->co);
 
        for (v = 1; v < totvert; v++, mvert++) {
-               min[0] = MIN2(min[0], mvert->co[0]);
-               min[1] = MIN2(min[1], mvert->co[1]);
-               min[2] = MIN2(min[2], mvert->co[2]);
+               min[0] = minf(min[0], mvert->co[0]);
+               min[1] = minf(min[1], mvert->co[1]);
+               min[2] = minf(min[2], mvert->co[2]);
 
-               max[0] = MAX2(max[0], mvert->co[0]);
-               max[1] = MAX2(max[1], mvert->co[1]);
-               max[2] = MAX2(max[2], mvert->co[2]);
+               max[0] = maxf(max[0], mvert->co[0]);
+               max[1] = maxf(max[1], mvert->co[1]);
+               max[2] = maxf(max[2], mvert->co[2]);
        }
 
        sub_v3_v3v3(delta, max, min);
index 14735810cad6b2dfe526f30a78c5c22158e1d731..bf5f6cd095e48b9e7ce3907b70ffc19ff7639d96 100644 (file)
@@ -161,7 +161,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
        if (smd->limit[0] < 0.0f) smd->limit[0] = 0.0f;
        if (smd->limit[0] > 1.0f) smd->limit[0] = 1.0f;
 
-       smd->limit[0] = MIN2(smd->limit[0], smd->limit[1]);  /* Upper limit >= than lower limit */
+       smd->limit[0] = minf(smd->limit[0], smd->limit[1]);  /* Upper limit >= than lower limit */
 
        //Calculate matrixs do convert between coordinate spaces
        if (smd->origin) {
@@ -190,8 +190,8 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
 
                        if (transf) space_transform_apply(transf, tmp);
 
-                       lower = MIN2(lower, tmp[limit_axis]);
-                       upper = MAX2(upper, tmp[limit_axis]);
+                       lower = minf(lower, tmp[limit_axis]);
+                       upper = maxf(upper, tmp[limit_axis]);
                }
 
 
index 50e7a3e6da97066e1f25f29ae9ac1e2f14ce9641..0eacfd392b9e39933aa0d1471cc03916eef9a103 100644 (file)
@@ -354,7 +354,7 @@ static void merge_frame_corners(Frame **frames, int totframe)
                                BLI_assert(frames[i] != frames[k]);
 
                                side_b = frame_len(frames[k]);
-                               thresh = MIN2(side_a, side_b) / 2.0f;
+                               thresh = minf(side_a, side_b) / 2.0f;
 
                                /* Compare with each corner of all other frames... */
                                for (l = 0; l < 4; l++) {
index f3e0edfc69159bea7942d309ce837da017cbcc46..3a3f94f05cc58133448a9770ee35cb88927c5d43 100644 (file)
@@ -114,7 +114,7 @@ static void move_stack(bNodeStack *to, bNodeStack *from)
 
 static void *group_initexec(bNode *node)
 {
-       bNodeTree *ngroup= (bNodeTree*)node->id;
+       bNodeTree *ngroup= (bNodeTree *)node->id;
        bNodeTreeExec *exec;
        bNodeSocket *sock;
        bNodeStack *ns;
@@ -138,7 +138,7 @@ static void *group_initexec(bNode *node)
 
 static void group_freeexec(bNode *UNUSED(node), void *nodedata)
 {
-       bNodeTreeExec *gexec= (bNodeTreeExec*)nodedata;
+       bNodeTreeExec *gexec= (bNodeTreeExec *)nodedata;
        
        if (gexec)
                ntreeCompositEndExecTree(gexec, 0);
@@ -193,7 +193,7 @@ static void group_free_internal(bNodeTreeExec *gexec)
 
 static void group_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out)
 {
-       bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
+       bNodeTreeExec *exec= (bNodeTreeExec *)nodedata;
        
        if (!exec)
                return;
@@ -265,7 +265,7 @@ static void loop_iteration_reset(bNodeTree *ngroup, bNodeStack *gstack)
 
 static void forloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out)
 {
-       bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
+       bNodeTreeExec *exec= (bNodeTreeExec *)nodedata;
        int totiterations= (int)in[0]->vec[0];
        bNodeSocket *sock;
        bNodeStack *ns;
@@ -323,7 +323,7 @@ void register_node_type_cmp_forloop(bNodeTreeType *ttype)
 #if 0 /* XXX loop nodes don't work nicely with current trees */
 static void whileloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out)
 {
-       bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
+       bNodeTreeExec *exec= (bNodeTreeExec *)nodedata;
        int condition= (in[0]->vec[0] > 0.0f);
        bNodeSocket *sock;
        bNodeStack *ns;
index 3e6d0f281fdcabe4c32de8f3de99ee0c9879bff9..c4c89bd06a6a28f74847bc5ba521270eec320612 100644 (file)
@@ -980,9 +980,9 @@ static void alpha_clip_aniso(ImBuf *ibuf, float minx, float miny, float maxx, fl
                rf.ymin = miny*(ibuf->y);
                rf.ymax = maxy*(ibuf->y);
 
-               alphaclip = clipx_rctf(&rf, 0.0, (float)(ibuf->x));
-               alphaclip*= clipy_rctf(&rf, 0.0, (float)(ibuf->y));
-               alphaclip= MAX2(alphaclip, 0.0f);
+               alphaclip  = clipx_rctf(&rf, 0.0, (float)(ibuf->x));
+               alphaclip *= clipy_rctf(&rf, 0.0, (float)(ibuf->y));
+               alphaclip  = maxf(alphaclip, 0.0f);
 
                if (alphaclip!=1.0f) {
                        /* premul it all */
@@ -1236,8 +1236,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
                        float fProbes;
                        a *= ff;
                        b *= ff;
-                       a = MAX2(a, 1.f);
-                       b = MAX2(b, 1.f);
+                       a = maxf(a, 1.0f);
+                       b = maxf(b, 1.0f);
                        fProbes = 2.f*(a / b) - 1.f;
                        AFD.iProbes = (int)floorf(fProbes + 0.5f);
                        AFD.iProbes = MIN2(AFD.iProbes, tex->afmax);
@@ -1253,8 +1253,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
                        if (ecc > (float)tex->afmax) b = a / (float)tex->afmax;
                        b *= ff;
                }
-               maxd = MAX2(b, 1e-8f);
-               levf = ((float)M_LOG2E)*logf(maxd);
+               maxd = maxf(b, 1e-8f);
+               levf = ((float)M_LOG2E) * logf(maxd);
 
                curmap = 0;
                maxlev = 1;
@@ -1338,8 +1338,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
                        imp2radangle(A, B, C, F, &a, &b, &th, &ecc);
                        a *= ff;
                        b *= ff;
-                       a = MAX2(a, 1.f);
-                       b = MAX2(b, 1.f);
+                       a = maxf(a, 1.0f);
+                       b = maxf(b, 1.0f);
                        fProbes = 2.f*(a / b) - 1.f;
                        /* no limit to number of Probes here */
                        AFD.iProbes = (int)floorf(fProbes + 0.5f);
@@ -1622,12 +1622,12 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
                ImBuf *previbuf, *curibuf;
                float bumpscale;
                
-               dx= minx;
-               dy= miny;
-               maxd= MAX2(dx, dy);
-               if (maxd>0.5f) maxd= 0.5f;
+               dx = minx;
+               dy = miny;
+               maxd = maxf(dx, dy);
+               if (maxd > 0.5f) maxd = 0.5f;
 
-               pixsize = 1.0f/ (float) MIN2(ibuf->x, ibuf->y);
+               pixsize = 1.0f / (float) MIN2(ibuf->x, ibuf->y);
                
                bumpscale= pixsize/maxd;
                if (bumpscale>1.0f) bumpscale= 1.0f;
index cb7122c834c664f901de9fb154acc2d2e4ae14d0..aa35d73f3b57b35043b0b718a8851a0aa4988a11 100644 (file)
@@ -1515,7 +1515,7 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
                if (!(shi->combinedflag & SCE_PASS_REFRACT))
                        sub_v3_v3v3(diff, diff, shr->refr);
                
-               shr->alpha= MIN2(1.0f, tracol[3]);
+               shr->alpha = minf(1.0f, tracol[3]);
        }
        
        if (do_mir) {
index d47fdff80763866eed0a6c2c26b37a1e75311454..e5bbb212def986f1ab8cc42559426988c3251307 100644 (file)
@@ -1733,7 +1733,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
        if (mtex->texco == TEXCO_UV) {
                /* for the uv case, use the same value for both du/dv,
                 * since individually scaling the normal derivatives makes them useless... */
-               du = MIN2(du, dv);
+               du = minf(du, dv);
                idu = (du < 1e-5f) ? bf : (bf/du);
 
                /* +u val */
index 63aa6cdd139444b9364624b96478ba41396fc6d4..a6b2c98f9d3c55d7b85fc0db718639871b3f5a73 100644 (file)
@@ -1541,8 +1541,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
 
        copy_v3_v3(shi->facenor, nor);
        shade_input_set_viewco(shi, x, y, sx, sy, z);
-       *area= len_v3(shi->dxco)*len_v3(shi->dyco);
-       *area= MIN2(*area, 2.0f*orthoarea);
+       *area = minf(len_v3(shi->dxco) * len_v3(shi->dyco), 2.0f * orthoarea);
 
        shade_input_set_uv(shi);
        shade_input_set_normals(shi);
index db9e201704fa38479e077b1337d34b2bdcc7ed63..4c90c3b4a6fd637ce19c64e73b9b156eb4c89aa9 100644 (file)
@@ -1391,7 +1391,7 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
                        }
                }
                
-               labda= MIN2(labdax, labday);
+               labda = minf(labdax, labday);
                if (labda==labdao || labda>=1.0f) break;
                
                zf= zf1 + labda*(zf2-zf1);
index 5ca1262107be6571105c7771d815fe3055093914..69e738e840d6d72fbc7a8ddeb19b9222e19fb5b5 100644 (file)
@@ -305,7 +305,7 @@ ScatterSettings *scatter_settings_new(float refl, float radius, float ior, float
        ss->Fdr= -1.440f/ior*ior + 0.710f/ior + 0.668f + 0.0636f*ior;
        ss->A= (1.0f + ss->Fdr)/(1.0f - ss->Fdr);
        ss->ld= radius;
-       ss->ro= MIN2(refl, 0.999f);
+       ss->ro= minf(refl, 0.999f);
        ss->color= ss->ro*reflfac + (1.0f-reflfac);
 
        ss->alpha_= compute_reduced_albedo(ss);
index e09529fd8ace2e20aee088518024da26133853c6..8d228473de73d466977133ca5c6cbccf74905e9e 100644 (file)
@@ -149,8 +149,8 @@ static void zbuf_add_to_span(ZSpan *zspan, const float *v1, const float *v2)
                xs0= dx0*(minv[1]-my2) + minv[0];
        }
        else {
-               dx0= 0.0f;
-               xs0= MIN2(minv[0], maxv[0]);
+               dx0 = 0.0f;
+               xs0 = minf(minv[0], maxv[0]);
        }
        
        /* empty span */
@@ -3874,7 +3874,7 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf
                                
                                addAlphaUnderFloat(samp_shr->combined, shr->combined);
                                
-                               samp_shr->z= MIN2(samp_shr->z, shr->z);
+                               samp_shr->z = minf(samp_shr->z, shr->z);
 
                                if (addpassflag & SCE_PASS_VECTOR) {
                                        copy_v4_v4(samp_shr->winspeed, shr->winspeed);