code cleanup: redundant includes and add minor comments.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 8 Oct 2013 20:18:38 +0000 (20:18 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 8 Oct 2013 20:18:38 +0000 (20:18 +0000)
15 files changed:
source/blender/blenlib/BLI_linklist_stack.h
source/blender/bmesh/intern/bmesh_core.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/operators/bmo_bridge.c
source/blender/bmesh/operators/bmo_connect.c
source/blender/bmesh/operators/bmo_connect_nonplanar.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_edgenet.c
source/blender/bmesh/operators/bmo_fill_attribute.c
source/blender/bmesh/operators/bmo_fill_holes.c
source/blender/bmesh/operators/bmo_inset.c
source/blender/bmesh/operators/bmo_symmetrize.c
source/blender/bmesh/operators/bmo_triangulate.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/object/object_vgroup.c

index ca0508830184c112df6f6b4e9cbc2d7fce68fd97..c9fb00ecdf5db9515b502f14fdb0d4b67b38b86e 100644 (file)
        (void)&(_##var##_type); \
 } (void)0
 
-#include "BLI_alloca.h"
-
 /** \} */
 
 #endif  /* __BLI_LINKLIST_STACK_H__ */
index 0b14cf22276e20479b8488a54a5cc7fdbb27bf08..8441a6ec75f1ae1ea61b9896e542b1e6e7f510e0 100644 (file)
@@ -2282,7 +2282,8 @@ BMVert *bmesh_urmv(BMesh *bm, BMFace *f_sep, BMVert *v_sep)
 
 /**
  * Avoid calling this where possible,
- * low level function for swapping faces.
+ * low level function so both face pointers remain intact but point to swapped data.
+ * \note must be from the same bmesh.
  */
 void bmesh_face_swap_data(BMesh *bm, BMFace *f_a, BMFace *f_b)
 {
index d11ae82b3d2e85d71467c4d331229515762861c1..1dfd25359133c0ec16e5ed2eceb37c5780affcf8 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "DNA_listBase.h"
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_alloca.h"
 #include "BLI_math.h"
 #include "BLI_memarena.h"
@@ -833,10 +831,6 @@ void BM_face_triangulate(BMesh *bm, BMFace *f,
                f_new = BM_face_split(bm, f, l_first->v, l_first->next->next->v, &l_new, NULL, false);
                copy_v3_v3(f_new->no, f->no);
 
-               if (UNLIKELY(!l_new || !f_new)) {
-                       fprintf(stderr, "%s: triangulator failed to split face! (bmesh internal error)\n", __func__);
-               }
-
                if (use_tag) {
                        BM_elem_flag_enable(l_new->e, BM_ELEM_TAG);
                        BM_elem_flag_enable(f, BM_ELEM_TAG);
@@ -905,13 +899,15 @@ void BM_face_triangulate(BMesh *bm, BMFace *f,
                                BM_elem_flag_enable(l_new->e, BM_ELEM_TAG);
                        }
 
+                       /* add all but the last face which is swapped and removed (below) */
                        if (r_faces_new && sf_tri->prev) {
                                r_faces_new[nf_i++] = f_new;
                        }
                }
 
                if (sf_ctx.fillfacebase.first) {
-                       /* we can't delete the real face, so swap data and delete */
+                       /* we can't delete the real face, because some of the callers expect it to remain valid.
+                        * so swap data and delete the last created tri */
                        bmesh_face_swap_data(bm, f, f_new);
                        BM_face_kill(bm, f_new);
 
index 9dfbf951fc0db5c98ba273520816a0501223326d..10d15d93995cd191cf276ecbbd6db589e50eaa30 100644 (file)
@@ -26,8 +26,6 @@
  * Connect verts across faces (splits faces) and bridge tool.
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 #include "BLI_listbase.h"
index b3a42ba533efafe68f036f799c692f853f9b0f71..d0f64eb28924ebb3e5e00e9b7deb52bb3a54d7a4 100644 (file)
@@ -26,8 +26,6 @@
  * Connect verts across faces (splits faces).
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 #include "BLI_alloca.h"
index 61085596acc0b549ddc43515db856281ade723cb..bd7a625406cfab5eb953f4f1df237450350a1ee7 100644 (file)
@@ -26,8 +26,6 @@
  * Connect verts non-planer faces iteratively (splits faces).
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 #include "BLI_alloca.h"
index bd2485b92fba037b4c987b63ef84c780c624c0fe..a5c34f7623b03530efbffa0fcd683631dc79f793 100644 (file)
@@ -26,8 +26,6 @@
  * Duplicate, Split, Split operators.
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_math.h"
 #include "BLI_alloca.h"
 
index fdee80b95057e58647c49a773d4323a207de55fa..de41bc7937d9e6e37d8db6e940cd67ebb10d8b45 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_listbase.h"
 #include "BLI_math.h"
 #include "BLI_array.h"
-#include "BLI_alloca.h"
-#include "BLI_smallhash.h"
-#include "BLI_rand.h"
-#include "BLI_heap.h"
 
 #include "bmesh.h"
 #include "bmesh_tools.h"
index f53b4536e44c669d3c483bf81f61bf9842386563..fa77e6b509c882af8cadb0a725c6ff333ec424c6 100644 (file)
@@ -27,8 +27,6 @@
  * Fill in geometry with the attributes of their adjacent data.
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_utildefines.h"
 #include "BLI_linklist_stack.h"
 
index 8160d28d7a7ba2d1c9d038f88fe6118c8d24823e..eadfbdb1aa857d8b1c57e3c156ed5aa5226a893b 100644 (file)
@@ -26,8 +26,6 @@
  * Fill boundary edge loop(s) with faces.
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_utildefines.h"
 
 #include "bmesh.h"
index 20cd828af1ea7eed350caac58dcd6eb02d8521f7..e20556a830d02a0865a3ab0daada0f8952d07fb8 100644 (file)
@@ -31,7 +31,6 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_math.h"
-#include "BLI_array.h"
 #include "BLI_alloca.h"
 #include "BLI_memarena.h"
 #include "BKE_customdata.h"
index 4b538dccb4e82f0c41f5b56b231c996b5881a755..74f880906c0b6d34306b83513888fbec268db645 100644 (file)
@@ -26,9 +26,6 @@
  * Makes the mesh symmetrical by splitting along an axis and duplicating the geometry.
  */
 
-
-#include "MEM_guardedalloc.h"
-
 #include "BLI_utildefines.h"
 #include "BLI_math.h"
 
index 590b5ea97c4053c0f4daaac607cff25a2f0159a2..ca45289520b49ba73be9055791b9ff32dfd1562d 100644 (file)
@@ -26,7 +26,6 @@
  * Triangulate faces, also defines triangle fill.
  */
 
-#include "MEM_guardedalloc.h"
 #include "DNA_listBase.h"
 
 #include "BLI_math.h"
index e23358bf4ffab6b42ca18271aff663a6a66483f7..c89fee71cbcc8c16f7d47e5339d4a485a715719c 100644 (file)
@@ -32,7 +32,6 @@
 #include "DNA_meshdata_types.h"
 
 #include "BLI_math.h"
-#include "BLI_heap.h"
 #include "BLI_alloca.h"
 
 #include "BKE_customdata.h"
index 82454baae7898fc99890ce06a1e685d442317607..b0d884568cae017aa282fedca16cb2a67a84a056 100644 (file)
@@ -47,6 +47,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_particle_types.h"
 
+#include "BLI_alloca.h"
 #include "BLI_array.h"
 #include "BLI_math.h"
 #include "BLI_blenlib.h"