[Bf-blender-cvs] [500ec993f54] master: Revert "Fix: Const warning in editmesh_knife.c"
Campbell Barton
noreply at git.blender.org
Tue Nov 30 06:31:12 CET 2021
Commit: 500ec993f546e09661137cebf7d597661a8f53f0
Author: Campbell Barton
Date: Tue Nov 30 16:28:24 2021 +1100
Branches: master
https://developer.blender.org/rB500ec993f546e09661137cebf7d597661a8f53f0
Revert "Fix: Const warning in editmesh_knife.c"
It's important the coordinates the knife is operating on are never
manipulated since it will cause problems which are difficult to
troubleshoot.
Instead, use a cast in the MEM_freeN(..) call.
This reverts commit 8600d4491fa4b349cb80241382c503abaf9c5ce9.
===================================================================
M source/blender/editors/mesh/editmesh_knife.c
===================================================================
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 86ed594aa66..0a22d87c0bc 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -236,7 +236,7 @@ typedef struct KnifeTool_OpData {
GHash *facetrimap;
KnifeBVH bvh;
- float (**cagecos)[3];
+ const float (**cagecos)[3];
BLI_mempool *kverts;
BLI_mempool *kedges;
@@ -3975,7 +3975,7 @@ static void knifetool_init_cagecos(KnifeTool_OpData *kcd, Object *ob, uint base_
BM_mesh_elem_index_ensure(em_eval->bm, BM_VERT);
- kcd->cagecos[base_index] = BKE_editmesh_vert_coords_alloc(
+ kcd->cagecos[base_index] = (const float(*)[3])BKE_editmesh_vert_coords_alloc(
kcd->vc.depsgraph, em_eval, scene_eval, obedit_eval, NULL);
}
@@ -4143,7 +4143,7 @@ static void knifetool_exit_ex(KnifeTool_OpData *kcd)
for (int i = 0; i < kcd->objects_len; i++) {
knifetool_free_cagecos(kcd, i);
}
- MEM_freeN(kcd->cagecos);
+ MEM_freeN((void *)kcd->cagecos);
knife_bvh_free(kcd);
/* Line-hits cleanup. */
More information about the Bf-blender-cvs
mailing list