diff options
Diffstat (limited to 'source/blender/editors')
33 files changed, 97 insertions, 97 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 0f1d48ff8af..51b7a3aa984 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -563,7 +563,7 @@ static void heat_set_H(LaplacianSystem *sys, int vertex) /* compute H entry */ if (numclosest > 0) { - mindist = maxf(mindist, 1e-4f); + mindist = max_ff(mindist, 1e-4f); h = numclosest * C_WEIGHT / (mindist * mindist); } else diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index beb57b44248..6374314e4bb 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -238,7 +238,7 @@ static void ui_text_bounds_block(uiBlock *block, float offset) bt->rect.xmax = bt->rect.xmin + i + block->bounds; if (col == lastcol) { - bt->rect.xmax = maxf(bt->rect.xmax, offset + block->minbounds); + bt->rect.xmax = max_ff(bt->rect.xmax, offset + block->minbounds); } ui_check_but(bt); /* clips text again */ @@ -275,7 +275,7 @@ void ui_bounds_block(uiBlock *block) block->rect.ymax += block->bounds; } - block->rect.xmax = block->rect.xmin + maxf(BLI_rctf_size_x(&block->rect), block->minbounds); + block->rect.xmax = block->rect.xmin + max_ff(BLI_rctf_size_x(&block->rect), block->minbounds); /* hardcoded exception... but that one is annoying with larger safety */ bt = block->buttons.first; diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 426daa69272..a73954e2075 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -161,12 +161,12 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl glGetFloatv(GL_CURRENT_COLOR, color); /* 'shade' defines strength of shading */ - coltop[0] = minf(1.0f, color[0] + shadetop); - coltop[1] = minf(1.0f, color[1] + shadetop); - coltop[2] = minf(1.0f, color[2] + shadetop); - coldown[0] = maxf(0.0f, color[0] + shadedown); - coldown[1] = maxf(0.0f, color[1] + shadedown); - coldown[2] = maxf(0.0f, color[2] + shadedown); + coltop[0] = min_ff(1.0f, color[0] + shadetop); + coltop[1] = min_ff(1.0f, color[1] + shadetop); + coltop[2] = min_ff(1.0f, color[2] + shadetop); + coldown[0] = max_ff(0.0f, color[0] + shadedown); + coldown[1] = max_ff(0.0f, color[1] + shadedown); + coldown[2] = max_ff(0.0f, color[2] + shadedown); glShadeModel(GL_SMOOTH); glBegin(mode); @@ -270,12 +270,12 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float glGetFloatv(GL_CURRENT_COLOR, color); /* 'shade' defines strength of shading */ - colLeft[0] = minf(1.0f, color[0] + shadeLeft); - colLeft[1] = minf(1.0f, color[1] + shadeLeft); - colLeft[2] = minf(1.0f, color[2] + shadeLeft); - colRight[0] = maxf(0.0f, color[0] + shadeRight); - colRight[1] = maxf(0.0f, color[1] + shadeRight); - colRight[2] = maxf(0.0f, color[2] + shadeRight); + colLeft[0] = min_ff(1.0f, color[0] + shadeLeft); + colLeft[1] = min_ff(1.0f, color[1] + shadeLeft); + colLeft[2] = min_ff(1.0f, color[2] + shadeLeft); + colRight[0] = max_ff(0.0f, color[0] + shadeRight); + colRight[1] = max_ff(0.0f, color[1] + shadeRight); + colRight[2] = max_ff(0.0f, color[2] + shadeRight); glShadeModel(GL_SMOOTH); glBegin(mode); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 445182fb325..dc7ea930e45 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3460,7 +3460,7 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, float data->ungrab_mval[0] = mx_fl; data->ungrab_mval[1] = my_fl; { /* clamp */ - const float radius = minf(BLI_rctf_size_x(&but->rect), BLI_rctf_size_y(&but->rect)) / 2.0f; + const float radius = min_ff(BLI_rctf_size_x(&but->rect), BLI_rctf_size_y(&but->rect)) / 2.0f; const float cent[2] = {BLI_rctf_cent_x(&but->rect), BLI_rctf_cent_y(&but->rect)}; const float len = len_v2v2(cent, data->ungrab_mval); if (len > radius) { @@ -4008,7 +4008,7 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx } else { /* scale histogram values (dy / 10 for better control) */ - const float yfac = minf(powf(hist->ymax, 2.0f), 1.0f) * 0.5f; + const float yfac = min_ff(powf(hist->ymax, 2.0f), 1.0f) * 0.5f; hist->ymax += (dy * 0.1f) * yfac; /* 0.1 allows us to see HDR colors up to 10 */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index d1dee74c1b1..a09504fa4b7 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -831,7 +831,7 @@ static void ui_do_animate(const bContext *C, Panel *panel) float fac; fac = (PIL_check_seconds_timer() - data->starttime) / ANIMATION_TIME; - fac = minf(sqrt(fac), 1.0f); + fac = min_ff(sqrt(fac), 1.0f); /* for max 1 second, interpolate positions */ if (uiAlignPanelStep(sa, ar, fac, 0)) { diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index b9036db74a1..afa8c9051b2 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2396,7 +2396,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi * on the first item */ offset[0] = 0; for (bt = block->buttons.first; bt; bt = bt->next) - offset[0] = mini(offset[0], -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect))); + offset[0] = min_ii(offset[0], -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect))); offset[1] = 1.5 * UI_UNIT_Y; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index f793d71458e..e79c311c3ee 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -345,7 +345,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl const int vnum = ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) || (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) == (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2; - minsize = mini(BLI_rcti_size_x(rect) * hnum, + minsize = min_ii(BLI_rcti_size_x(rect) * hnum, BLI_rcti_size_y(rect) * vnum); if (2.0f * rad > minsize) @@ -491,7 +491,7 @@ static void widget_num_tria(uiWidgetTrias *tria, rcti *rect, float triasize, cha float centx, centy, sizex, sizey, minsize; int a, i1 = 0, i2 = 1; - minsize = mini(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)); + minsize = min_ii(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)); /* center position and size */ centx = (float)rect->xmin + 0.5f * minsize; @@ -526,7 +526,7 @@ static void widget_scroll_circle(uiWidgetTrias *tria, rcti *rect, float triasize float centx, centy, sizex, sizey, minsize; int a, i1 = 0, i2 = 1; - minsize = mini(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)); + minsize = min_ii(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)); /* center position and size */ centx = (float)rect->xmin + 0.5f * minsize; @@ -1895,7 +1895,7 @@ void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rec /* duplication of code... well, simple is better now */ const float centx = BLI_rcti_cent_x_fl(rect); const float centy = BLI_rcti_cent_y_fl(rect); - const float radius = (float)mini(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)) / 2.0f; + const float radius = (float)min_ii(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)) / 2.0f; const float m_delta[2] = {mx - centx, my - centy}; const float dist_squared = len_squared_v2(m_delta); @@ -1910,7 +1910,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * const float centx = BLI_rcti_cent_x_fl(rect); const float centy = BLI_rcti_cent_y_fl(rect); - float radius = (float)mini(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)) / 2.0f; + float radius = (float)min_ii(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)) / 2.0f; /* gouraud triangle fan */ const float *hsv_ptr = ui_block_hsv_get(but->block); @@ -2423,7 +2423,7 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat if (rect1.xmax > rect->xmax) { rect1.xmax = rect->xmax; - rect1.xmin = maxi(rect1.xmax - min, rect->xmin); + rect1.xmin = max_ii(rect1.xmax - min, rect->xmin); } } } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 87da31ceaee..48a1f8bf0f3 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1243,16 +1243,16 @@ static float smooth_view_rect_to_fac(const rctf *rect_a, const rctf *rect_b) for (i = 0; i < 2; i++) { /* axis translation normalized to scale */ - tfac = fabsf(cent_a[i] - cent_b[i]) / minf(size_a[i], size_b[i]); - fac_max = maxf(fac_max, tfac); + tfac = fabsf(cent_a[i] - cent_b[i]) / min_ff(size_a[i], size_b[i]); + fac_max = max_ff(fac_max, tfac); if (fac_max >= 1.0f) break; /* axis scale difference, x2 so doubling or half gives 1.0f */ - tfac = (1.0f - (minf(size_a[i], size_b[i]) / maxf(size_a[i], size_b[i]))) * 2.0f; - fac_max = maxf(fac_max, tfac); + tfac = (1.0f - (min_ff(size_a[i], size_b[i]) / max_ff(size_a[i], size_b[i]))) * 2.0f; + fac_max = max_ff(fac_max, tfac); if (fac_max >= 1.0f) break; } - return minf(fac_max, 1.0f); + return min_ff(fac_max, 1.0f); } /* will start timer if appropriate */ diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 490389c6d0c..1c23df1c11e 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -408,7 +408,7 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline const short is_active, int width, int height) { - const unsigned int resol = maxi(BKE_mask_spline_feather_resolution(spline, width, height), + const unsigned int resol = max_ii(BKE_mask_spline_feather_resolution(spline, width, height), BKE_mask_spline_resolution(spline, width, height)); unsigned char rgb_tmp[4]; @@ -579,7 +579,7 @@ void ED_mask_draw_region(Mask *mask, ARegion *ar, y += v2d->tot.ymin * zoomy; /* frame the image */ - maxdim = maxf(width, height); + maxdim = max_ff(width, height); if (width == height) { xofs = yofs = 0; } diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 1d19d35ca34..7cc725118ee 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1506,7 +1506,7 @@ static float knife_snap_size(KnifeTool_OpData *kcd, float maxsize) if (density < 1.0f) density = 1.0f; - return minf(maxsize / (density * 0.5f), maxsize); + return min_ff(maxsize / (density * 0.5f), maxsize); } /* p is closest point on edge to the mouse cursor */ diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 0bbd9c7fbaf..90a7e2fe0ea 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -2712,21 +2712,21 @@ static float bm_edge_seg_isect(const float sco_a[2], const float sco_b[2], m1 = MAXSLOPE; b1 = x12; } - 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; + x2max = max_ff(x21, x22) + 0.001f; /* prevent missed edges */ + x2min = min_ff(x21, x22) - 0.001f; /* due to round off error */ + y2max = max_ff(y21, y22) + 0.001f; + y2min = min_ff(y21, y22) - 0.001f; /* Found an intersect, calc intersect point */ if (m1 == m2) { /* co-incident lines */ /* cut at 50% of overlap area */ - x1max = maxf(x11, x12); - x1min = minf(x11, x12); - xi = (minf(x2max, x1max) + maxf(x2min, x1min)) / 2.0f; + x1max = max_ff(x11, x12); + x1min = min_ff(x11, x12); + xi = (min_ff(x2max, x1max) + max_ff(x2min, x1min)) / 2.0f; - y1max = maxf(y11, y12); - y1min = minf(y11, y12); - yi = (minf(y2max, y1max) + maxf(y2min, y1min)) / 2.0f; + y1max = max_ff(y11, y12); + y1min = min_ff(y11, y12); + yi = (min_ff(y2max, y1max) + max_ff(y2min, y1min)) / 2.0f; } else if (m2 == MAXSLOPE) { xi = x22; @@ -5150,7 +5150,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] = maxf(amounts[0], 0.0f); + amounts[0] = max_ff(amounts[0], 0.0f); RNA_float_set(op->ptr, "thickness", amounts[0]); RNA_float_set(op->ptr, "depth", amounts[1]); @@ -5191,7 +5191,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 = maxf(amount, 0.0f); + amount = max_ff(amount, 0.0f); RNA_float_set(op->ptr, "thickness", amount); } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 3b505f24d2d..f8ec51c7a7c 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3529,7 +3529,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) view3d_operator_needs_opengl(C); selected= (short)count_selected_keys(scene, edit); - dmax = maxf(fabsf(dx), fabsf(dy)); + dmax = max_ff(fabsf(dx), fabsf(dy)); tot_steps = dmax/(0.2f * brush->size) + 1; dx /= (float)tot_steps; diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 24053d76672..c1811adf2d8 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -625,8 +625,8 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo * covers the entire screen). */ glGetFloatv(GL_SCISSOR_BOX, scissor); - draw_w = mini(img_w - off_x, ceil((scissor[2] - rast_x) / xzoom)); - draw_h = mini(img_h - off_y, ceil((scissor[3] - rast_y) / yzoom)); + draw_w = min_ii(img_w - off_x, ceil((scissor[2] - rast_x) / xzoom)); + draw_h = min_ii(img_h - off_y, ceil((scissor[3] - rast_y) / yzoom)); if (draw_w > 0 && draw_h > 0) { int old_row_length = glaGetOneInteger(GL_UNPACK_ROW_LENGTH); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 058b8bb4827..b24681fdb05 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5302,7 +5302,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 = size * maxf(zoomx, zoomy); + pixel_size = size * max_ff(zoomx, zoomy); } else { pixel_size = size; diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index c6df3a057bd..6396a0c2cbc 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -255,7 +255,7 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const if (pressure > FLT_EPSILON) { /* brushes can have a minimum size of 1.0 but with pressure it can be smaller then a pixel * causing very high step sizes, hanging blender [#32381] */ - const float size_clamp = maxf(1.0f, BKE_brush_size_get(scene, stroke->brush) * pressure); + const float size_clamp = max_ff(1.0f, BKE_brush_size_get(scene, stroke->brush) * pressure); scale = (size_clamp * stroke->brush->spacing / 50.0f) / length; if (scale > FLT_EPSILON) { mul_v2_fl(vec, scale); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index d7936c1e2e8..fc9c040852f 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -716,7 +716,7 @@ static float get_shortest_pattern_side(MovieTrackingMarker *marker) cur_len = len_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]); - len = minf(cur_len, len); + len = min_ff(cur_len, len); } return len; @@ -788,11 +788,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 = minf(dx * 2.0f / 3.0f, side / 6.0f); - patdy = minf(dy * 2.0f / 3.0f, side * width / height / 6.0f); + patdx = min_ff(dx * 2.0f / 3.0f, side / 6.0f); + patdy = min_ff(dy * 2.0f / 3.0f, side * width / height / 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); + searchdx = min_ff(dx, (marker->search_max[0] - marker->search_min[0]) / 6.0f); + searchdy = min_ff(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 b495ca32813..71589517c83 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -395,7 +395,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 / minf(zoomx, zoomy)); + newzoom = 1.0f / power_of_2(1.0f / min_ff(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 37eb0bcb7c1..1a9cae93a38 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -747,7 +747,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, minf(zoomx, zoomy), NULL); + sclip_zoom_set(C, min_ff(zoomx, zoomy), NULL); } else { if ((w >= width || h >= height) && (width > 0 && height > 0)) { @@ -755,7 +755,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 / minf(zoomx, zoomy)), NULL); + sclip_zoom_set(C, 1.0f / power_of_2(1.0f / min_ff(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 c061125b4d5..521b1383db8 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -372,8 +372,8 @@ static int mouse_on_slide_zone(SpaceClip *sc, MovieTrackingMarker *marker, dx = size / width / sc->zoom; dy = size / height / sc->zoom; - dx = minf(dx, (max[0] - min[0]) / 6.0f); - dy = minf(dy, (max[1] - min[1]) / 6.0f); + dx = min_ff(dx, (max[0] - min[0]) / 6.0f); + dy = min_ff(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); @@ -424,14 +424,14 @@ static int get_mouse_pattern_corner(SpaceClip *sc, MovieTrackingMarker *marker, cur_len = len_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]); - len = minf(cur_len, len); + len = min_ff(cur_len, len); } dx = 12.0f / width / sc->zoom; dy = 12.0f / height / sc->zoom; - dx = minf(dx, len * 2.0f / 3.0f); - dy = minf(dy, len * width / height * 2.0f / 3.0f); + dx = min_ff(dx, len * 2.0f / 3.0f); + dy = min_ff(dy, len * width / height * 2.0f / 3.0f); for (i = 0; i < 4; i++) { float crn[2]; @@ -462,8 +462,8 @@ static int mouse_on_offset(SpaceClip *sc, MovieTrackingTrack *track, MovieTracki dx = 12.0f / width / sc->zoom; dy = 12.0f / height / sc->zoom; - dx = minf(dx, (pat_max[0] - pat_min[0]) / 2.0f); - dy = minf(dy, (pat_max[1] - pat_min[1]) / 2.0f); + dx = min_ff(dx, (pat_max[0] - pat_min[0]) / 2.0f); + dy = min_ff(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 feb523237ba..b8e162bfb17 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 < maxf(epsx, epsy); + return dist < max_ff(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 = maxf(epsx, 2.0f / width); - epsy = maxf(epsy, 2.0f / height); + epsx = max_ff(epsx, 2.0f / width); + epsy = max_ff(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 df8ef6cc750..512e8d97540 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -599,7 +599,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.0f / minf(zoomx, zoomy)), NULL); + sima_zoom_set(sima, ar, 1.0f / power_of_2(1.0f / min_ff(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 945ec1d4a1b..92956b7aa5b 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 = minf(*min, strip->start); - *max = maxf(*max, strip->end); + *min = min_ff(*min, strip->start); + *max = max_ff(*max, strip->end); } } } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 074e9c29152..39f0a49e1d2 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -834,7 +834,7 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (int)(rect.xmin + NODE_MARGIN_X), (int)(rect.ymax + (group_header - (2.5f * dpi_fac))), - mini((int)(BLI_rctf_size_x(&rect) - 18.0f), node_group_frame + 20), group_header, UI_GetStyle()); + min_ii((int)(BLI_rctf_size_x(&rect) - 18.0f), node_group_frame + 20), group_header, UI_GetStyle()); RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr); uiTemplateIDBrowse(layout, (bContext *)C, &ptr, "node_tree", NULL, NULL, NULL); uiBlockLayoutResolve(gnode->block, NULL, NULL); @@ -3226,7 +3226,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 = minf(zoomx, zoomy); + zoom = min_ff(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 6b201e94c35..20afbf7ce65 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -391,7 +391,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 = minf(dy, locy - 2 * NODE_DY); + node->totr.ymin = min_ff(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_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index adfc3d07af2..636d2f2fc01 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1189,7 +1189,7 @@ static void draw_seq_backdrop(View2D *v2d) glRectf(v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0); /* Alternating horizontal stripes */ - i = maxi(1, ((int)v2d->cur.ymin) - 1); + i = max_ii(1, ((int)v2d->cur.ymin) - 1); glBegin(GL_QUADS); while (i < v2d->cur.ymax) { @@ -1208,7 +1208,7 @@ static void draw_seq_backdrop(View2D *v2d) glEnd(); /* Darker lines separating the horizontal bands */ - i = maxi(1, ((int)v2d->cur.ymin) - 1); + i = max_ii(1, ((int)v2d->cur.ymin) - 1); UI_ThemeColor(TH_GRID); glBegin(GL_LINES); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 9de91322714..c09e0ffaa33 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2129,7 +2129,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 / minf(zoomX, zoomY)); + sseq->zoom = 1.0f / power_of_2(1 / min_ff(zoomX, zoomY)); } else { sseq->zoom = 1.0f; diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 2296b27916e..9b2722d3bd0 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1232,7 +1232,7 @@ static void draw_textscroll(SpaceText *st, rcti *scroll, rcti *back) uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT) ? UI_SCROLL_PRESSED : 0); uiSetRoundBox(UI_CNR_ALL); - rad = 0.4f * mini(BLI_rcti_size_x(&st->txtscroll), BLI_rcti_size_y(&st->txtscroll)); + rad = 0.4f * min_ii(BLI_rcti_size_x(&st->txtscroll), BLI_rcti_size_y(&st->txtscroll)); UI_GetThemeColor3ubv(TH_HILITE, col); col[3] = 48; glColor4ubv(col); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 8ff9b79af1d..f7ae082787b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1640,7 +1640,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, /* apply offset last - camera offset is different to offset in blender units */ /* so this has some sane way of working - this matches camera's shift _exactly_ */ { - const float max_dim = maxf(x2 - x1, y2 - y1); + const float max_dim = max_ff(x2 - x1, y2 - y1); const float xof_scale = bgpic->xof * max_dim; const float yof_scale = bgpic->yof * max_dim; @@ -1689,7 +1689,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, /* calc window coord */ initgrabz(rv3d, 0.0, 0.0, 0.0); ED_view3d_win_to_delta(ar, mval_f, tvec); - fac = maxf(fabsf(tvec[0]), maxf(fabsf(tvec[1]), fabsf(tvec[2]))); /* largest abs axis */ + fac = max_ff(fabsf(tvec[0]), max_ff(fabsf(tvec[1]), fabsf(tvec[2]))); /* largest abs axis */ fac = 1.0f / fac; asp = (float)ibuf->y / (float)ibuf->x; @@ -1717,7 +1717,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 = minf(zoomx, zoomy); + float tzoom = min_ff(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 4e16e50692a..7440bfefb33 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2591,7 +2591,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(minf(xfac, yfac)); + rv3d->camzoom = BKE_screen_view3d_zoom_from_fac(min_ff(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)); @@ -2879,7 +2879,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) /* work out the ratios, so that everything selected fits when we zoom */ xscale = (BLI_rcti_size_x(&rect) / vb[0]); yscale = (BLI_rcti_size_y(&rect) / vb[1]); - new_dist *= maxf(xscale, yscale); + new_dist *= max_ff(xscale, yscale); /* zoom in as required, or as far as we can go */ dist_range_min = 0.001f * v3d->grid; diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 4babb03f374..da30ae61879 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -553,7 +553,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 * minf(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ + time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ if (fly->speed < 0.0f) { fly->speed = 0.0f; @@ -571,7 +571,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 * minf(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ + time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ if (fly->speed > 0.0f) { fly->speed = 0; @@ -847,7 +847,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 = minf(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */ + time_redraw_clamped = min_ff(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 1a218c1b49d..2e813aa2c83 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1023,7 +1023,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 = minf(t->prop_size, ((View3D *)t->view)->far); + t->prop_size = min_ff(t->prop_size, ((View3D *)t->view)->far); calculatePropRatio(t); } t->redraw |= TREDRAW_HARD; @@ -1193,7 +1193,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 = minf(t->prop_size, ((View3D *)t->view)->far); + t->prop_size = min_ff(t->prop_size, ((View3D *)t->view)->far); calculatePropRatio(t); } t->redraw = 1; @@ -1487,8 +1487,8 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) float dx = t->mval[0] - cent[0], dy = t->mval[1] - cent[1]; float angle = atan2f(dy, dx); float dist = sqrtf(dx * dx + dy * dy); - float delta_angle = minf(15.0f / dist, (float)M_PI / 4.0f); - float spacing_angle = minf(5.0f / dist, (float)M_PI / 12.0f); + float delta_angle = min_ff(15.0f / dist, (float)M_PI / 4.0f); + float spacing_angle = min_ff(5.0f / dist, (float)M_PI / 12.0f); UI_ThemeColor(TH_WIRE); setlinestyle(3); @@ -5612,7 +5612,7 @@ static int doEdgeSlide(TransInfo *t, float perc) for (i = 0; i < sld->totsv; i++, sv++) { const float sv_length = len_v3v3(sv->up->co, sv->down->co); - const float fac = minf(sv_length, curr_length_perc) / sv_length; + const float fac = min_ff(sv_length, curr_length_perc) / sv_length; if (sld->flipped_vtx) { interp_v3_v3v3(sv->v->co, sv->down->co, sv->up->co, fac); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index a9a74d3d0a1..c74faf53ced 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1831,7 +1831,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f d2 = d + len_v3(vec); if (dists[BM_elem_index_get(v3)] != FLT_MAX) - dists[BM_elem_index_get(v3)] = minf(d2, dists[BM_elem_index_get(v3)]); + dists[BM_elem_index_get(v3)] = min_ff(d2, dists[BM_elem_index_get(v3)]); else dists[BM_elem_index_get(v3)] = d2; @@ -2547,8 +2547,8 @@ void clipUVData(TransInfo *t) if ((td->flag & TD_SKIP) || (!td->loc)) continue; - td->loc[0] = minf(maxf(0.0f, td->loc[0]), aspx); - td->loc[1] = minf(maxf(0.0f, td->loc[1]), aspy); + td->loc[0] = min_ff(max_ff(0.0f, td->loc[0]), aspx); + td->loc[1] = min_ff(max_ff(0.0f, td->loc[1]), aspy); } } @@ -4300,7 +4300,7 @@ static void freeSeqData(TransInfo *t) for (a = 0; a < t->total; a++, td++) { seq = ((TransDataSeq *)td->extra)->seq; if ((seq != seq_prev)) { - minframe = mini(minframe, seq->startdisp); + minframe = min_ii(minframe, seq->startdisp); } } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 2b225118472..b1945c37048 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -432,8 +432,8 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta edgesin = uv1[0] * uv2[1] - uv2[0] * uv1[1]; rotation = (edgesin > 0.0f) ? - +acosf(maxf(-1.0f, minf(1.0f, edgecos))) : - -acosf(maxf(-1.0f, minf(1.0f, edgecos))); + +acosf(max_ff(-1.0f, min_ff(1.0f, edgecos))) : + -acosf(max_ff(-1.0f, min_ff(1.0f, edgecos))); island_stitch_data[element1->island].num_rot_elements++; island_stitch_data[element1->island].rotation += rotation; |