diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 03:25:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:32:54 +0300 |
commit | 7cb20d841da16d0bffb63154403267500e9941f5 (patch) | |
tree | ef6a5e0b4e1de2f055ad3c0b3d5bb073a237f182 /source/blender/editors | |
parent | 4a78a2774bee655a54391cc8fafae2d20ead2bb0 (diff) |
Cleanup: follow our code style for float literals
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editcurve_add.c | 8 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 14 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 8 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_uv.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_walk.c | 9 |
13 files changed, 30 insertions, 29 deletions
diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c index 684666aba13..5e2af960550 100644 --- a/source/blender/editors/curve/editcurve_add.c +++ b/source/blender/editors/curve/editcurve_add.c @@ -397,8 +397,8 @@ Nurb *ED_curve_add_nurbs_primitive( break; case CU_PRIM_SPHERE: /* sphere */ if (cutype == CU_NURBS) { - const float tmp_cent[3] = {0.f, 0.f, 0.f}; - const float tmp_vec[3] = {0.f, 0.f, 1.f}; + const float tmp_cent[3] = {0.0f, 0.0f, 0.0f}; + const float tmp_vec[3] = {0.0f, 0.0f, 1.0f}; nu->pntsu = 5; nu->pntsv = 1; @@ -451,8 +451,8 @@ Nurb *ED_curve_add_nurbs_primitive( break; case CU_PRIM_DONUT: /* torus */ if (cutype == CU_NURBS) { - const float tmp_cent[3] = {0.f, 0.f, 0.f}; - const float tmp_vec[3] = {0.f, 0.f, 1.f}; + const float tmp_cent[3] = {0.0f, 0.0f, 0.0f}; + const float tmp_vec[3] = {0.0f, 0.0f, 1.0f}; xzproj = 1; nu = ED_curve_add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 1eb35b2c647..0a5e35364b2 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -651,7 +651,7 @@ static void txt_add_object(bContext *C, int nchars = 0, nbytes = 0; char *s; int a; - const float rot[3] = {0.f, 0.f, 0.f}; + const float rot[3] = {0.0f, 0.0f, 0.0f}; obedit = BKE_object_add(bmain, view_layer, OB_FONT, NULL); base = view_layer->basact; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ac31148340a..bbb66a7e0e4 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6396,7 +6396,7 @@ static bool ui_numedit_but_HSVCIRCLE(uiBut *but, * allow choosing a hue for black values, by giving a tiny increment */ if (cpicker->use_color_lock) { if (U.color_picker_type == USER_CP_CIRCLE_HSV) { /* lock */ - if (hsv[2] == 0.f) { + if (hsv[2] == 0.0f) { hsv[2] = 0.0001f; } } @@ -6499,15 +6499,15 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, * allow choosing a hue for black values, by giving a tiny increment */ if (cpicker->use_color_lock) { if (U.color_picker_type == USER_CP_CIRCLE_HSV) { /* lock */ - if (hsv[2] == 0.f) { + if (hsv[2] == 0.0f) { hsv[2] = 0.0001f; } } else { - if (hsv[2] == 0.f) { + if (hsv[2] == 0.0f) { hsv[2] = 0.0001f; } - if (hsv[2] == 1.f) { + if (hsv[2] == 1.0f) { hsv[2] = 0.9999f; } } @@ -7315,7 +7315,7 @@ static bool ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int m hist->ymax += (dy * 0.1f) * yfac; /* 0.1 allows us to see HDR colors up to 10 */ - CLAMP(hist->ymax, 0.1f, 100.f); + CLAMP(hist->ymax, 0.1f, 100.0f); data->draglastx = mx; data->draglasty = my; @@ -7348,7 +7348,7 @@ static int ui_do_but_HISTOGRAM( /* XXX hardcoded keymap check.... */ if (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS) { Histogram *hist = (Histogram *)but->poin; - hist->ymax = 1.f; + hist->ymax = 1.0f; button_activate_state(C, but, BUTTON_STATE_EXIT); return WM_UI_HANDLER_BREAK; @@ -7421,7 +7421,7 @@ static int ui_do_but_WAVEFORM( /* XXX hardcoded keymap check.... */ if (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS) { Scopes *scopes = (Scopes *)but->poin; - scopes->wavefrm_yfac = 1.f; + scopes->wavefrm_yfac = 1.0f; button_activate_state(C, but, BUTTON_STATE_EXIT); return WM_UI_HANDLER_BREAK; diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 1a8b1ae0a1a..c4b54af1396 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -943,7 +943,7 @@ typedef struct uiWidgetBaseParameters { /* We pack alpha check and discard factor in alpha_discard. * If the value is negative then we do alpha check. * The absolute value itself is the discard factor. - * Initialize value to 1.0.f if you don't want discard */ + * Initialize value to 1.0f if you don't want discard. */ float alpha_discard; float tria_type; float _pad[3]; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index b48b854c238..3d6a6abfe0d 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -3205,9 +3205,9 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot) vgroup_operator_subset_select_props(ot, true); RNA_def_float( - ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights", -1.0f, 1.f); + ot->srna, "offset", 0.0f, -1.0, 1.0, "Offset", "Value to add to weights", -1.0f, 1.0f); RNA_def_float( - ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by", 0.0f, 10.f); + ot->srna, "gain", 1.0f, 0.0f, FLT_MAX, "Gain", "Value to multiply weights by", 0.0f, 10.0f); } /** \} */ @@ -3369,7 +3369,7 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot) 10.0f); RNA_def_float(ot->srna, "strength", - 1.f, + 1.0f, -2.0f, FLT_MAX, "Strength", @@ -3385,7 +3385,7 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot) "Change Sensitivity", "Change the amount weights are altered with each iteration: lower values are slower", 0.05f, - 1.f); + 1.0f); } /** \} */ diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index e6d11398279..63f12e339b9 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4438,7 +4438,7 @@ static int brush_add(const bContext *C, PEData *data, short number) for (k = 0, hkey = pa->hair; k < pset->totaddkey; k++, hkey++) { madd_v3_v3v3fl(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep); hkey->time += k * framestep; - hkey->weight = 1.f - (float)k / (float)(pset->totaddkey - 1); + hkey->weight = 1.0f - (float)k / (float)(pset->totaddkey - 1); } } for (k = 0, hkey = pa->hair; k < pset->totaddkey; k++, hkey++) { diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 6f80165ed3c..1efcc152f37 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2827,7 +2827,7 @@ static int frame_offset_exec(bContext *C, wmOperator *op) CFRA += delta; FRAMENUMBER_MIN_CLAMP(CFRA); - SUBFRA = 0.f; + SUBFRA = 0.0f; areas_do_frame_follow(C, false); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 75357214936..57b1102219e 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -717,7 +717,7 @@ static float paint_space_stroke_spacing(bContext *C, spacing *= stroke->zoom_2d; if (paint_stroke_use_scene_spacing(brush, mode)) { - return max_ff(0.001f, size_clamp * spacing / 50.f); + return max_ff(0.001f, size_clamp * spacing / 50.0f); } return max_ff(stroke->zoom_2d, size_clamp * spacing / 50.0f); } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 25b1764e562..e88af7caf42 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -372,7 +372,7 @@ static float wpaint_blend(const VPaint *wp, if (do_flip) { switch (blend) { case IMB_BLEND_MIX: - paintval = 1.f - paintval; + paintval = 1.0f - paintval; break; case IMB_BLEND_ADD: blend = IMB_BLEND_SUB; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 5be72ec87e7..f77d473ae57 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -172,7 +172,7 @@ static void HC_relaxation_iteration_uv(BMEditMesh *em, for (i = 0; i < sculptdata->totalUniqueUvs; i++) { copy_v2_v2(diff, tmp_uvdata[i].sum_co); - mul_v2_fl(diff, 1.f / tmp_uvdata[i].ncounter); + mul_v2_fl(diff, 1.0f / tmp_uvdata[i].ncounter); copy_v2_v2(tmp_uvdata[i].p, diff); tmp_uvdata[i].b[0] = diff[0] - sculptdata->uv[i].uv[0]; @@ -260,7 +260,7 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, * here it is not needed since we translate along the UV plane always. */ for (i = 0; i < sculptdata->totalUniqueUvs; i++) { copy_v2_v2(tmp_uvdata[i].p, tmp_uvdata[i].sum_co); - mul_v2_fl(tmp_uvdata[i].p, 1.f / tmp_uvdata[i].ncounter); + mul_v2_fl(tmp_uvdata[i].p, 1.0f / tmp_uvdata[i].ncounter); } for (i = 0; i < sculptdata->totalUniqueUvs; i++) { diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index f058ec5546a..167215b3813 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1665,7 +1665,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op)) if (ked.i1) { Scene *scene = ac.scene; CFRA = round_fl_to_int(ked.f1 / ked.i1); - SUBFRA = 0.f; + SUBFRA = 0.0f; } /* set notifier that things have changed */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 9523810aa07..ae15b651059 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -2884,7 +2884,7 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op)) else { /* Animation Mode - Affects current frame (int) */ CFRA = round_fl_to_int(sum_time / num_keyframes); - SUBFRA = 0.f; + SUBFRA = 0.0f; } sipo->cursorVal = sum_value / (float)num_keyframes; diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 7de28096607..665d704e6b2 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -473,8 +473,8 @@ enum { }; /* keep the previous speed until user changes userpreferences */ -static float base_speed = -1.f; -static float userdef_speed = -1.f; +static float base_speed = -1.0f; +static float userdef_speed = -1.0f; static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op) { @@ -521,8 +521,9 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op) walk->speed = 0.0f; walk->is_fast = false; walk->is_slow = false; - walk->grid = (walk->scene->unit.system == USER_UNIT_NONE) ? 1.f : - 1.f / walk->scene->unit.scale_length; + walk->grid = (walk->scene->unit.system == USER_UNIT_NONE) ? + 1.0f : + 1.0f / walk->scene->unit.scale_length; /* user preference settings */ walk->teleport.duration = U.walk_navigation.teleport_time; |