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 <ideasman42@gmail.com>2020-04-05 10:12:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-05 10:12:10 +0300
commit3e8a81841931f2cdbe8349a2c7ce0f6b3a486c79 (patch)
tree43feae71f7c3b027967155d2c48552f0da992c49
parent9fe0505db00f450333518238db6813ede046f45e (diff)
Cleanup: use const for 'clnors' argument where possible
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c17
2 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 0b3650fd40a..17fd7b18bab 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -1012,7 +1012,7 @@ void BKE_mesh_loop_manifold_fan_around_vert_next(const MLoop *mloops,
static void split_loop_nor_single_do(LoopSplitTaskDataCommon *common_data, LoopSplitTaskData *data)
{
MLoopNorSpaceArray *lnors_spacearr = common_data->lnors_spacearr;
- short(*clnors_data)[2] = common_data->clnors_data;
+ const short(*clnors_data)[2] = common_data->clnors_data;
const MVert *mverts = common_data->mverts;
const MEdge *medges = common_data->medges;
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);