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:
-rw-r--r--source/blender/blenkernel/intern/boids.c2
-rw-r--r--source/blender/blenkernel/intern/brush.c12
-rw-r--r--source/blender/blenkernel/intern/colortools.c20
-rw-r--r--source/blender/blenkernel/intern/constraint.c2
-rw-r--r--source/blender/blenkernel/intern/tracking.c12
-rw-r--r--source/blender/blenlib/intern/pbvh.c8
-rw-r--r--source/blender/blenlib/intern/scanfill.c2
-rw-r--r--source/blender/blenlib/intern/voronoi.c4
-rw-r--r--source/blender/bmesh/intern/bmesh_interp.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c20
-rw-r--r--source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp6
-rw-r--r--source/blender/editors/interface/interface_panel.c9
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c24
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/space_clip/clip_draw.c10
-rw-r--r--source/blender/editors/space_clip/clip_editor.c2
-rw-r--r--source/blender/editors/space_clip/clip_ops.c4
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c14
-rw-r--r--source/blender/editors/space_clip/tracking_select.c6
-rw-r--r--source/blender/editors/space_image/image_ops.c2
-rw-r--r--source/blender/editors/space_nla/nla_edit.c4
-rw-r--r--source/blender/editors/space_node/drawnode.c2
-rw-r--r--source/blender/editors/space_node/node_draw.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c6
-rw-r--r--source/blender/editors/transform/transform.c4
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp2
-rw-r--r--source/blender/imbuf/intern/divers.c2
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c2
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c2
-rw-r--r--source/blender/makesrna/intern/rna_main.c2
-rw-r--r--source/blender/makesrna/intern/rna_mask.c24
-rw-r--r--source/blender/makesrna/intern/rna_nla.c2
-rw-r--r--source/blender/makesrna/intern/rna_rna.c2
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c12
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c6
-rw-r--r--source/blender/modifiers/intern/MOD_skin.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_common.c10
-rw-r--r--source/blender/render/intern/source/imagetexture.c28
-rw-r--r--source/blender/render/intern/source/rayshade.c2
-rw-r--r--source/blender/render/intern/source/render_texture.c2
-rw-r--r--source/blender/render/intern/source/rendercore.c3
-rw-r--r--source/blender/render/intern/source/shadbuf.c2
-rw-r--r--source/blender/render/intern/source/sss.c2
-rw-r--r--source/blender/render/intern/source/zbuf.c6
48 files changed, 151 insertions, 151 deletions
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index edb3120cf87..e6259cc9faf 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index f54e6595fe6..468861242d0 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 194b41f9aaa..20fae973756 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -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++) {
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index c2b38442a6b..8298023161b 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 3c00397dfa5..5d50e8c491e 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -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;
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 14f9001814c..9b05f0fc976 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -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]);
}
}
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index 1f0bd445831..25191370130 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -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;
diff --git a/source/blender/blenlib/intern/voronoi.c b/source/blender/blenlib/intern/voronoi.c
index dc76fb1493d..f61df9c11f5 100644
--- a/source/blender/blenlib/intern/voronoi.c
+++ b/source/blender/blenlib/intern/voronoi.c
@@ -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;
}
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index c39096d0800..74d3df01fd0 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -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 {
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 03b72aefee6..5d63172dbfa 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -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;
diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
index daf517876e5..e28e77a5f5e 100644
--- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
@@ -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;
}
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
index d431ce29554..c8052667fa0 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
@@ -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);
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 76485571096..d04c1af2769 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -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);
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index a869886355a..fa7df050a42 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -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);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 2a497d599aa..306724de301 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -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;
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 8e13bc61ee8..96eb6002840 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -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;
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 54ee691b63b..349303afbf2 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -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;
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index f7222dae75f..20d47063cd4 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -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);
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 77c4b527a11..153287eecdd 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -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;
}
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c
index 9581d7708fb..559fe8c840d 100644
--- a/source/blender/editors/space_clip/tracking_select.c
+++ b/source/blender/editors/space_clip/tracking_select.c
@@ -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))
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 4626600f2cf..d34f734c6c2 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -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);
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 5c9994e46d3..a3e9ca1c4a2 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -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);
}
}
}
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index ad3e1954e68..c546eda1998 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -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;
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 8c9f057efc1..f8ce572ee46 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -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.
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 057382549b6..4034c9f98f0 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -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;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ac31d0d622e..85a4d911df5 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -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) {
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 440f7344616..ba665cfb89c 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -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));
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index 3efd7c252fe..561e97a8393 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -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
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index f7fbc7002a2..feab96d6ddf 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -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;
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 652b16a7c65..1154605c673 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -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)
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index d46bf4fca4d..54903c83835 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -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]);
}
}
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 3b4f87d8b95..5f1ce4f2773 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -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);
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c
index 6739e5b71fa..4f9f2009a14 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -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);
}
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index c98e1f3312b..96c5ff991f6 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -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);
}
diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c
index 2d972d26398..382f5501ca4 100644
--- a/source/blender/makesrna/intern/rna_mask.c
+++ b/source/blender/makesrna/intern/rna_mask.c
@@ -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++)
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index b47f957ac76..16753961852 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -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;
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 4920b40c854..db309ed8f1f 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -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);
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index dfbfbd22475..21836453eed 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -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);
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index 14735810cad..bf5f6cd095e 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -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]);
}
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index 50e7a3e6da9..0eacfd392b9 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -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++) {
diff --git a/source/blender/nodes/composite/nodes/node_composite_common.c b/source/blender/nodes/composite/nodes/node_composite_common.c
index f3e0edfc691..3a3f94f05cc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_common.c
+++ b/source/blender/nodes/composite/nodes/node_composite_common.c
@@ -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;
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 3e6d0f281fd..c4c89bd06a6 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -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;
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index cb7122c834c..aa35d73f3b5 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -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) {
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index d47fdff8076..e5bbb212def 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -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 */
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 63aa6cdd139..a6b2c98f9d3 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -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);
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index db9e201704f..4c90c3b4a6f 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -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);
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 5ca1262107b..69e738e840d 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -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);
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index e09529fd8ac..8d228473de7 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -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);