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/blenkernel/intern/curveprofile.cc | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/blenkernel/intern/curveprofile.cc')
-rw-r--r-- | source/blender/blenkernel/intern/curveprofile.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/curveprofile.cc b/source/blender/blenkernel/intern/curveprofile.cc index 0e34e4a55dd..5cff804cb18 100644 --- a/source/blender/blenkernel/intern/curveprofile.cc +++ b/source/blender/blenkernel/intern/curveprofile.cc @@ -207,7 +207,7 @@ bool BKE_curveprofile_remove_point(CurveProfile *profile, CurveProfilePoint *poi CurveProfilePoint *new_path = (CurveProfilePoint *)MEM_mallocN( sizeof(CurveProfilePoint) * profile->path_len, __func__); - int i_delete = (int)(point - profile->path); + int i_delete = int(point - profile->path); BLI_assert(i_delete > 0); /* Copy the before and after the deleted point. */ @@ -379,8 +379,8 @@ static void curveprofile_build_supports(CurveProfile *profile) point_init(&profile->path[0], 1.0f, 0.0f, 0, HD_VECT, HD_VECT); point_init(&profile->path[1], 1.0f, 0.5f, 0, HD_VECT, HD_VECT); for (int i = 1; i < n - 2; i++) { - const float x = 1.0f - (0.5f * (1.0f - cosf((float)(i / (float)(n - 3)) * M_PI_2))); - const float y = 0.5f + 0.5f * sinf((float)((i / (float)(n - 3)) * M_PI_2)); + const float x = 1.0f - (0.5f * (1.0f - cosf(float(i / float(n - 3)) * M_PI_2))); + const float y = 0.5f + 0.5f * sinf(float((i / float(n - 3)) * M_PI_2)); point_init(&profile->path[i], x, y, 0, HD_AUTO, HD_AUTO); } point_init(&profile->path[n - 2], 0.5f, 1.0f, 0, HD_VECT, HD_VECT); @@ -408,8 +408,8 @@ static void curveprofile_build_steps(CurveProfile *profile) for (int i = 0; i < n; i++) { int step_x = (i + 1) / 2; int step_y = i / 2; - const float x = 1.0f - ((float)(2 * step_x) / n_steps_x); - const float y = (float)(2 * step_y) / n_steps_y; + const float x = 1.0f - (float(2 * step_x) / n_steps_x); + const float y = float(2 * step_y) / n_steps_y; point_init(&profile->path[i], x, y, 0, HD_VECT, HD_VECT); } } |