[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60620] trunk/blender/source/blender: code cleanup: redundant includes and add minor comments.

Campbell Barton ideasman42 at gmail.com
Tue Oct 8 22:18:39 CEST 2013


Revision: 60620
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60620
Author:   campbellbarton
Date:     2013-10-08 20:18:38 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
code cleanup: redundant includes and add minor comments.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_linklist_stack.h
    trunk/blender/source/blender/bmesh/intern/bmesh_core.c
    trunk/blender/source/blender/bmesh/intern/bmesh_polygon.c
    trunk/blender/source/blender/bmesh/operators/bmo_bridge.c
    trunk/blender/source/blender/bmesh/operators/bmo_connect.c
    trunk/blender/source/blender/bmesh/operators/bmo_connect_nonplanar.c
    trunk/blender/source/blender/bmesh/operators/bmo_dupe.c
    trunk/blender/source/blender/bmesh/operators/bmo_edgenet.c
    trunk/blender/source/blender/bmesh/operators/bmo_fill_attribute.c
    trunk/blender/source/blender/bmesh/operators/bmo_fill_holes.c
    trunk/blender/source/blender/bmesh/operators/bmo_inset.c
    trunk/blender/source/blender/bmesh/operators/bmo_symmetrize.c
    trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c
    trunk/blender/source/blender/bmesh/operators/bmo_utils.c
    trunk/blender/source/blender/editors/object/object_vgroup.c

Modified: trunk/blender/source/blender/blenlib/BLI_linklist_stack.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_linklist_stack.h	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/blenlib/BLI_linklist_stack.h	2013-10-08 20:18:38 UTC (rev 60620)
@@ -151,8 +151,6 @@
 	(void)&(_##var##_type); \
 } (void)0
 
-#include "BLI_alloca.h"
-
 /** \} */
 
 #endif  /* __BLI_LINKLIST_STACK_H__ */

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_core.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_core.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_core.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -2282,7 +2282,8 @@
 
 /**
  * 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)
 {

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_polygon.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_polygon.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_polygon.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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 @@
 		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 @@
 				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);
 

Modified: trunk/blender/source/blender/bmesh/operators/bmo_bridge.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_bridge.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_bridge.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_connect.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_connect.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_connect.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_connect_nonplanar.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_connect_nonplanar.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_connect_nonplanar.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_dupe.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_dupe.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_dupe.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -26,8 +26,6 @@
  * Duplicate, Split, Split operators.
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_math.h"
 #include "BLI_alloca.h"
 

Modified: trunk/blender/source/blender/bmesh/operators/bmo_edgenet.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_edgenet.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_edgenet.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -28,13 +28,8 @@
 
 #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"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_fill_attribute.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_fill_attribute.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_fill_attribute.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"
 

Modified: trunk/blender/source/blender/bmesh/operators/bmo_fill_holes.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_fill_holes.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_fill_holes.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -26,8 +26,6 @@
  * Fill boundary edge loop(s) with faces.
  */
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_utildefines.h"
 
 #include "bmesh.h"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_inset.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_inset.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_inset.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_symmetrize.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_symmetrize.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_symmetrize.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"
 

Modified: trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -26,7 +26,6 @@
  * Triangulate faces, also defines triangle fill.
  */
 
-#include "MEM_guardedalloc.h"
 #include "DNA_listBase.h"
 
 #include "BLI_math.h"

Modified: trunk/blender/source/blender/bmesh/operators/bmo_utils.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_utils.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/bmesh/operators/bmo_utils.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"

Modified: trunk/blender/source/blender/editors/object/object_vgroup.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_vgroup.c	2013-10-08 19:47:53 UTC (rev 60619)
+++ trunk/blender/source/blender/editors/object/object_vgroup.c	2013-10-08 20:18:38 UTC (rev 60620)
@@ -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"




More information about the Bf-blender-cvs mailing list