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/geometry/intern/uv_parametrizer.cc | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/geometry/intern/uv_parametrizer.cc')
-rw-r--r-- | source/blender/geometry/intern/uv_parametrizer.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/geometry/intern/uv_parametrizer.cc b/source/blender/geometry/intern/uv_parametrizer.cc index b15c8b6e319..1829f943a5d 100644 --- a/source/blender/geometry/intern/uv_parametrizer.cc +++ b/source/blender/geometry/intern/uv_parametrizer.cc @@ -195,7 +195,7 @@ static int PHashSizes[] = { 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, }; -#define PHASH_hash(ph, item) (((uintptr_t)(item)) % ((uint)(ph)->cursize)) +#define PHASH_hash(ph, item) (uintptr_t(item) % ((uint)(ph)->cursize)) #define PHASH_edge(v1, v2) (((v1) < (v2)) ? ((v1)*39) ^ ((v2)*31) : ((v1)*31) ^ ((v2)*39)) static PHash *phash_new(PHashLink **list, int sizehint) @@ -319,7 +319,7 @@ static void fix_large_angle(const float v_fix[3], float *r_a1, float *r_a2) { - const float max_angle = (float)M_PI * (179.0f / 180.0f); + const float max_angle = float(M_PI) * (179.0f / 180.0f); const float fix_amount = *r_fix - max_angle; if (fix_amount < 0.0f) { return; /* angle is reasonable, i.e. less than 179 degrees. */ @@ -4218,7 +4218,7 @@ void GEO_uv_parametrizer_pack(ParamHandle *handle, * ...Without using the area running pack multiple times also gives a bad feedback loop. * multiply by 0.1 so the margin value from the UI can be from * 0.0 to 1.0 but not give a massive margin */ - margin = (margin * (float)area) * 0.1f; + margin = (margin * float(area)) * 0.1f; unpacked = 0; for (i = 0; i < handle->ncharts; i++) { chart = handle->charts[i]; |