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:
authorCampbell Barton <campbell@blender.org>2022-09-25 13:27:46 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 15:31:31 +0300
commit21d77a417e17ac92bfc10dbd742c867d4019ce69 (patch)
treeec664b5c6ca7882bcc5a1e1ce09cad67b842af9d /source/blender/editors
parentd35a10134cfdbd3e24a56218ef3f05aac2a2fc7e (diff)
Cleanup: replace C-style casts with functional casts for numeric types
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface.cc4
-rw-r--r--source/blender/editors/interface/view2d_ops.cc4
-rw-r--r--source/blender/editors/object/object_transform.cc2
-rw-r--r--source/blender/editors/space_file/filelist.cc4
-rw-r--r--source/blender/editors/uvedit/uvedit_islands.cc4
5 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc
index b2d2fa64fde..7e5556adcc9 100644
--- a/source/blender/editors/interface/interface.cc
+++ b/source/blender/editors/interface/interface.cc
@@ -3740,10 +3740,10 @@ static void ui_but_update_ex(uiBut *but, const bool validate)
case UI_BTYPE_NUM_SLIDER:
if (validate) {
UI_GET_BUT_VALUE_INIT(but, value);
- if (value < (double)but->hardmin) {
+ if (value < double(but->hardmin)) {
ui_but_value_set(but, but->hardmin);
}
- else if (value > (double)but->hardmax) {
+ else if (value > double(but->hardmax)) {
ui_but_value_set(but, but->hardmax);
}
diff --git a/source/blender/editors/interface/view2d_ops.cc b/source/blender/editors/interface/view2d_ops.cc
index 1df2acd5ef7..0282c1b1813 100644
--- a/source/blender/editors/interface/view2d_ops.cc
+++ b/source/blender/editors/interface/view2d_ops.cc
@@ -1583,10 +1583,10 @@ void UI_view2d_smooth_view(const bContext *C,
if (changed) {
sms.orig_cur = v2d->cur;
- sms.time_allowed = (double)smooth_viewtx / 1000.0;
+ sms.time_allowed = double(smooth_viewtx) / 1000.0;
/* scale the time allowed the change in view */
- sms.time_allowed *= (double)fac;
+ sms.time_allowed *= double(fac);
/* keep track of running timer! */
if (v2d->sms == nullptr) {
diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc
index 0735e93437d..680cf1c94cd 100644
--- a/source/blender/editors/object/object_transform.cc
+++ b/source/blender/editors/object/object_transform.cc
@@ -2101,7 +2101,7 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
}
#endif
- double depth = (double)depth_fl;
+ double depth = double(depth_fl);
if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) {
xfd->prev.depth = depth_fl;
xfd->prev.is_depth_valid = true;
diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc
index 06224b3a28c..e2d4f094137 100644
--- a/source/blender/editors/space_file/filelist.cc
+++ b/source/blender/editors/space_file/filelist.cc
@@ -2008,8 +2008,8 @@ static FileDirEntry *filelist_file_create_entry(FileList *filelist, const int in
ret = MEM_cnew<FileDirEntry>(__func__);
- ret->size = (uint64_t)entry->st.st_size;
- ret->time = (int64_t)entry->st.st_mtime;
+ ret->size = uint64_t(entry->st.st_size);
+ ret->time = int64_t(entry->st.st_mtime);
ret->relpath = BLI_strdup(entry->relpath);
if (entry->free_name) {
diff --git a/source/blender/editors/uvedit/uvedit_islands.cc b/source/blender/editors/uvedit/uvedit_islands.cc
index 793b72b67de..d28aba9816f 100644
--- a/source/blender/editors/uvedit/uvedit_islands.cc
+++ b/source/blender/editors/uvedit/uvedit_islands.cc
@@ -349,7 +349,7 @@ int bm_mesh_calc_uv_islands(const Scene *scene,
BM_mesh_elem_table_ensure(bm, BM_FACE);
int *groups_array = static_cast<int *>(
- MEM_mallocN(sizeof(*groups_array) * (size_t)bm->totface, __func__));
+ MEM_mallocN(sizeof(*groups_array) * size_t(bm->totface), __func__));
int(*group_index)[2];
@@ -524,7 +524,7 @@ void ED_uvedit_pack_islands_multi(const Scene *scene,
island_array[index] = island;
if (margin > 0.0f) {
- area += (double)sqrtf(box->w * box->h);
+ area += double(sqrtf(box->w * box->h));
}
}