diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-13 19:31:29 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-13 19:35:22 +0300 |
commit | cf69652618fefcd22b2cde9a2e0338b63f9a003e (patch) | |
tree | 013435f2e181f1332681bd513903c0cacf1baeda /source/blender/modifiers/intern/MOD_normal_edit.c | |
parent | fa7224d8ed88fbfbf55e5d1a83cef49c309785cb (diff) |
Cleanup: Use const when retrieving custom data layers
Knowing when layers are retrieved for write access will be essential
when adding proper copy-on-write support. This commit makes that
clearer by adding `const` where the retrieved data is not modified.
Ref T95842
Diffstat (limited to 'source/blender/modifiers/intern/MOD_normal_edit.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_normal_edit.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c index fe05f48a868..c215ac601a1 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.c +++ b/source/blender/modifiers/intern/MOD_normal_edit.c @@ -136,7 +136,7 @@ static void mix_normals(const float mix_factor, if (dvert) { facs = MEM_malloc_arrayN((size_t)loops_num, sizeof(*facs), __func__); BKE_defvert_extract_vgroup_to_loopweights( - dvert, defgrp_index, verts_num, mloop, loops_num, facs, use_invert_vgroup); + dvert, defgrp_index, verts_num, mloop, loops_num, use_invert_vgroup, facs); } for (i = loops_num, no_new = nos_new, no_old = nos_old, wfac = facs; i--; @@ -532,14 +532,13 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd, MDeformVert *dvert; float(*loopnors)[3] = NULL; - short(*clnors)[2] = NULL; CustomData *ldata = &result->ldata; const float(*vert_normals)[3] = BKE_mesh_vertex_normals_ensure(result); const float(*poly_normals)[3] = BKE_mesh_poly_normals_ensure(result); - clnors = CustomData_get_layer(ldata, CD_CUSTOMLOOPNORMAL); + short(*clnors)[2] = CustomData_get_layer(ldata, CD_CUSTOMLOOPNORMAL); if (use_current_clnors) { clnors = CustomData_duplicate_referenced_layer(ldata, CD_CUSTOMLOOPNORMAL, loops_num); loopnors = MEM_malloc_arrayN((size_t)loops_num, sizeof(*loopnors), __func__); |