[Bf-blender-cvs] [7d4c89e] master: Correct recent refactor (use generic callback)

Campbell Barton noreply at git.blender.org
Thu Nov 6 11:50:37 CET 2014


Commit: 7d4c89e6dacd49aaee7ee25e7ea013f3689f9c17
Author: Campbell Barton
Date:   Thu Nov 6 11:47:08 2014 +0100
Branches: master
https://developer.blender.org/rB7d4c89e6dacd49aaee7ee25e7ea013f3689f9c17

Correct recent refactor (use generic callback)

===================================================================

M	source/blender/bmesh/tools/bmesh_path.h
M	source/blender/editors/mesh/editmesh_path.c

===================================================================

diff --git a/source/blender/bmesh/tools/bmesh_path.h b/source/blender/bmesh/tools/bmesh_path.h
index 7f4f7c4..c39e08e 100644
--- a/source/blender/bmesh/tools/bmesh_path.h
+++ b/source/blender/bmesh/tools/bmesh_path.h
@@ -29,14 +29,17 @@
 
 struct LinkNode *BM_mesh_calc_path_vert(
         BMesh *bm, BMVert *v_src, BMVert *v_dst, const bool  use_length,
-        bool (*filter_fn)(BMVert *, void *), void *user_data);
+        bool (*filter_fn)(BMVert *, void *), void *user_data)
+ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3, 5);
 
 struct LinkNode *BM_mesh_calc_path_edge(
         BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const bool  use_length,
-        bool (*filter_fn)(BMEdge *, void *), void *user_data);
+        bool (*filter_fn)(BMEdge *, void *), void *user_data)
+ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3, 5);
 
 struct LinkNode *BM_mesh_calc_path_face(
         BMesh *bm, BMFace *f_src, BMFace *f_dst, const bool  use_length,
-        bool (*test_fn)(BMFace *, void *), void *user_data);
+        bool (*test_fn)(BMFace *, void *), void *user_data)
+ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3, 5);
 
 #endif /* __BMESH_PATH_H__ */
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c
index 1dd28c5..e1ef74c 100644
--- a/source/blender/editors/mesh/editmesh_path.c
+++ b/source/blender/editors/mesh/editmesh_path.c
@@ -513,11 +513,6 @@ void MESH_OT_shortest_path_pick(wmOperatorType *ot)
 /* -------------------------------------------------------------------- */
 /* Select path between existing selection */
 
-static bool ele_filter_visible_cb(BMElem *ele, void *UNUSED(user_data))
-{
-	return !BM_elem_flag_test(ele, BM_ELEM_HIDDEN);
-}
-
 static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
 {
 	Object *ob = CTX_data_edit_object(C);
@@ -577,17 +572,17 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
 			case BM_VERT:
 				path = BM_mesh_calc_path_vert(
 				           bm, (BMVert *)ele_src, (BMVert *)ele_dst, use_length,
-				           NULL, (bool (*)(BMVert *, void *))ele_filter_visible_cb);
+				           BM_elem_cb_check_hflag_disabled_simple(BMVert *, BM_ELEM_HIDDEN));
 				break;
 			case BM_EDGE:
 				path = BM_mesh_calc_path_edge(
 				           bm, (BMEdge *)ele_src, (BMEdge *)ele_dst, use_length,
-				           NULL, (bool (*)(BMEdge *, void *))ele_filter_visible_cb);
+				           BM_elem_cb_check_hflag_disabled_simple(BMEdge *, BM_ELEM_HIDDEN));
 				break;
 			case BM_FACE:
 				path = BM_mesh_calc_path_face(
 				           bm, (BMFace *)ele_src, (BMFace *)ele_dst, use_length,
-				           NULL, (bool (*)(BMFace *, void *))ele_filter_visible_cb);
+				           BM_elem_cb_check_hflag_disabled_simple(BMFace *, BM_ELEM_HIDDEN));
 				break;
 		}




More information about the Bf-blender-cvs mailing list