diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 11:33:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 13:17:08 +0300 |
commit | f68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch) | |
tree | 2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/editors/interface/interface_template_list.cc | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/editors/interface/interface_template_list.cc')
-rw-r--r-- | source/blender/editors/interface/interface_template_list.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_template_list.cc b/source/blender/editors/interface/interface_template_list.cc index d8a9591a021..f09eb5f3eb0 100644 --- a/source/blender/editors/interface/interface_template_list.cc +++ b/source/blender/editors/interface/interface_template_list.cc @@ -519,8 +519,8 @@ static void uilist_prepare(uiList *ui_list, int activei_row; if (columns > 1) { - dyn_data->height = (int)ceil((double)items->tot_items / (double)columns); - activei_row = (int)floor((double)items->active_item_idx / (double)columns); + dyn_data->height = int(ceil(double(items->tot_items) / double(columns))); + activei_row = int(floor(double(items->active_item_idx) / double(columns))); } else { dyn_data->height = items->tot_items; @@ -567,8 +567,8 @@ static void uilist_resize_update_cb(bContext *C, void *arg1, void *UNUSED(arg2)) uiListDyn *dyn_data = ui_list->dyn_data; /* This way we get diff in number of additional items to show (positive) or hide (negative). */ - const int diff = round_fl_to_int((float)(dyn_data->resize - dyn_data->resize_prev) / - (float)UI_UNIT_Y); + const int diff = round_fl_to_int(float(dyn_data->resize - dyn_data->resize_prev) / + float(UI_UNIT_Y)); if (diff != 0) { ui_list->list_grip += diff; |