From 72d2355af525664671ed6089b31d5bbe126cd865 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 Jun 2021 00:11:05 +1000 Subject: Cleanup: remove redundant cast, use const casts --- source/blender/bmesh/intern/bmesh_mesh.c | 4 ++-- source/blender/bmesh/intern/bmesh_operators.c | 4 ++-- source/blender/bmesh/operators/bmo_connect_pair.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender/bmesh') diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index d4357fa561b..72ceb49ef19 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -534,7 +534,7 @@ void BM_mesh_normals_update(BMesh *bm) bm_mesh_edges_calc_vectors(bm, edgevec, NULL); /* Add weighted face normals to vertices, and normalize vert normals. */ - bm_mesh_verts_calc_normals(bm, (const float(*)[3])edgevec, NULL, NULL, NULL); + bm_mesh_verts_calc_normals(bm, edgevec, NULL, NULL, NULL); MEM_freeN(edgevec); } @@ -681,7 +681,7 @@ void BM_verts_calc_normal_vcos(BMesh *bm, bm_mesh_edges_calc_vectors(bm, edgevec, vcos); /* Add weighted face normals to vertices, and normalize vert normals. */ - bm_mesh_verts_calc_normals(bm, (const float(*)[3])edgevec, fnos, vcos, vnos); + bm_mesh_verts_calc_normals(bm, edgevec, fnos, vcos, vnos); MEM_freeN(edgevec); } diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index c2421939aa8..e47fd1c035d 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -421,10 +421,10 @@ void BMO_slot_mat_set(BMOperator *op, slot->data.p = BLI_memarena_alloc(op->arena, sizeof(float[4][4])); if (size == 4) { - copy_m4_m4(slot->data.p, (float(*)[4])mat); + copy_m4_m4(slot->data.p, (const float(*)[4])mat); } else if (size == 3) { - copy_m4_m3(slot->data.p, (float(*)[3])mat); + copy_m4_m3(slot->data.p, (const float(*)[3])mat); } else { fprintf(stderr, "%s: invalid size argument %d (bmesh internal error)\n", __func__, size); diff --git a/source/blender/bmesh/operators/bmo_connect_pair.c b/source/blender/bmesh/operators/bmo_connect_pair.c index 1c861df0150..8a0673c9b33 100644 --- a/source/blender/bmesh/operators/bmo_connect_pair.c +++ b/source/blender/bmesh/operators/bmo_connect_pair.c @@ -180,8 +180,8 @@ static void min_dist_dir_update(MinDistDir *dist, const float dist_dir[3]) static int state_isect_co_pair(const PathContext *pc, const float co_a[3], const float co_b[3]) { - const float diff_a = dot_m3_v3_row_x((float(*)[3])pc->matrix, co_a) - pc->axis_sep; - const float diff_b = dot_m3_v3_row_x((float(*)[3])pc->matrix, co_b) - pc->axis_sep; + const float diff_a = dot_m3_v3_row_x(pc->matrix, co_a) - pc->axis_sep; + const float diff_b = dot_m3_v3_row_x(pc->matrix, co_b) - pc->axis_sep; const int test_a = (fabsf(diff_a) < CONNECT_EPS) ? 0 : (diff_a < 0.0f) ? -1 : 1; const int test_b = (fabsf(diff_b) < CONNECT_EPS) ? 0 : (diff_b < 0.0f) ? -1 : 1; @@ -194,7 +194,7 @@ static int state_isect_co_pair(const PathContext *pc, const float co_a[3], const static int state_isect_co_exact(const PathContext *pc, const float co[3]) { - const float diff = dot_m3_v3_row_x((float(*)[3])pc->matrix, co) - pc->axis_sep; + const float diff = dot_m3_v3_row_x(pc->matrix, co) - pc->axis_sep; return (fabsf(diff) <= CONNECT_EPS); } @@ -204,8 +204,8 @@ static float state_calc_co_pair_fac(const PathContext *pc, { float diff_a, diff_b, diff_tot; - diff_a = fabsf(dot_m3_v3_row_x((float(*)[3])pc->matrix, co_a) - pc->axis_sep); - diff_b = fabsf(dot_m3_v3_row_x((float(*)[3])pc->matrix, co_b) - pc->axis_sep); + diff_a = fabsf(dot_m3_v3_row_x(pc->matrix, co_a) - pc->axis_sep); + diff_b = fabsf(dot_m3_v3_row_x(pc->matrix, co_b) - pc->axis_sep); diff_tot = (diff_a + diff_b); return (diff_tot > FLT_EPSILON) ? (diff_a / diff_tot) : 0.5f; } -- cgit v1.2.3