From 3e8a81841931f2cdbe8349a2c7ce0f6b3a486c79 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Apr 2020 17:12:10 +1000 Subject: Cleanup: use const for 'clnors' argument where possible --- source/blender/bmesh/intern/bmesh_mesh.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source/blender/bmesh/intern/bmesh_mesh.c') diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 933223c3337..b65d563d441 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -676,7 +676,7 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, const float (*fnos)[3], float (*r_lnos)[3], MLoopNorSpaceArray *r_lnors_spacearr, - short (*clnors_data)[2], + const short (*clnors_data)[2], const int cd_loop_clnors_offset, const bool do_rebuild) { @@ -786,8 +786,9 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, l_curr_index, l_curr, true); if (has_clnors) { - short(*clnor)[2] = clnors_data ? &clnors_data[l_curr_index] : - BM_ELEM_CD_GET_VOID_P(l_curr, cd_loop_clnors_offset); + const short(*clnor)[2] = clnors_data ? &clnors_data[l_curr_index] : + (const void *)BM_ELEM_CD_GET_VOID_P( + l_curr, cd_loop_clnors_offset); BKE_lnor_space_custom_data_to_normal(lnor_space, *clnor, r_lnos[l_curr_index]); } } @@ -820,7 +821,7 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, /* We validate clnors data on the fly - cheapest way to do! */ int clnors_avg[2] = {0, 0}; - short(*clnor_ref)[2] = NULL; + const short(*clnor_ref)[2] = NULL; int clnors_nbr = 0; bool clnors_invalid = false; @@ -886,9 +887,9 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, if (has_clnors) { /* Accumulate all clnors, if they are not all equal we have to fix that! */ - short(*clnor)[2] = clnors_data ? - &clnors_data[lfan_pivot_index] : - BM_ELEM_CD_GET_VOID_P(lfan_pivot, cd_loop_clnors_offset); + const short(*clnor)[2] = clnors_data ? &clnors_data[lfan_pivot_index] : + (const void *)BM_ELEM_CD_GET_VOID_P( + lfan_pivot, cd_loop_clnors_offset); if (clnors_nbr) { clnors_invalid |= ((*clnor_ref)[0] != (*clnor)[0] || (*clnor_ref)[1] != (*clnor)[1]); @@ -1049,7 +1050,7 @@ void BM_mesh_loop_normals_update(BMesh *bm, const float split_angle, float (*r_lnos)[3], MLoopNorSpaceArray *r_lnors_spacearr, - short (*clnors_data)[2], + const short (*clnors_data)[2], const int cd_loop_clnors_offset) { const bool has_clnors = clnors_data || (cd_loop_clnors_offset != -1); -- cgit v1.2.3