From 8600d4491fa4b349cb80241382c503abaf9c5ce9 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 22 Nov 2021 23:40:05 +0100 Subject: Fix: Const warning in editmesh_knife.c Fixes a warning caused by freeing a const pointer. This commit removes the const modifier. Differential Revision: https://developer.blender.org/D13321 --- source/blender/editors/mesh/editmesh_knife.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '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 cd04f40dedf..76d48432834 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; - const float (**cagecos)[3]; + 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] = (const float(*)[3])BKE_editmesh_vert_coords_alloc( + kcd->cagecos[base_index] = BKE_editmesh_vert_coords_alloc( kcd->vc.depsgraph, em_eval, scene_eval, obedit_eval, NULL); } -- cgit v1.2.3 From 76471dbd5e2efbbc3a4d4b3a1a26fe0649f31cff Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Nov 2021 09:10:05 +1100 Subject: Cleanup: capitalize NOTE tag --- source/blender/editors/mesh/editmesh_knife.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '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 76d48432834..86ed594aa66 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -210,7 +210,7 @@ typedef struct KnifeBVH { typedef struct KnifeTool_OpData { ARegion *region; /* Region that knifetool was activated in. */ void *draw_handle; /* For drawing preview loop. */ - ViewContext vc; /* Note: _don't_ use 'mval', instead use the one we define below. */ + ViewContext vc; /* NOTE: _don't_ use 'mval', instead use the one we define below. */ float mval[2]; /* Mouse value with snapping applied. */ Scene *scene; -- cgit v1.2.3 From 500ec993f546e09661137cebf7d597661a8f53f0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Nov 2021 16:28:24 +1100 Subject: 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. --- source/blender/editors/mesh/editmesh_knife.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '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. */ -- cgit v1.2.3 From 61776befc3f88c373e47ccbdf8c75e2ca0f4e987 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Dec 2021 00:55:11 +1100 Subject: Cleanup: move public doc-strings into headers for 'editors' Ref T92709 --- source/blender/editors/mesh/editmesh_knife.c | 3 --- 1 file changed, 3 deletions(-) (limited to '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 0a22d87c0bc..3772a37ac44 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -4866,9 +4866,6 @@ static bool edbm_mesh_knife_point_isect(LinkNode *polys, const float cent_ss[2]) return false; } -/** - * \param use_tag: When set, tag all faces inside the polylines. - */ void EDBM_mesh_knife(bContext *C, ViewContext *vc, LinkNode *polys, bool use_tag, bool cut_through) { KnifeTool_OpData *kcd; -- cgit v1.2.3