[Bf-blender-cvs] [a5cd6a0] master: Cleanup: style & de-duplicate

Campbell Barton noreply at git.blender.org
Tue Dec 2 10:30:46 CET 2014


Commit: a5cd6a029ffc9d3e26f55ecf82da3ba5db2f63b8
Author: Campbell Barton
Date:   Tue Dec 2 10:30:03 2014 +0100
Branches: master
https://developer.blender.org/rBa5cd6a029ffc9d3e26f55ecf82da3ba5db2f63b8

Cleanup: style & de-duplicate

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

M	source/blender/blenkernel/intern/tracking_region_tracker.c
M	source/blender/blenkernel/intern/writeffmpeg.c
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/bmesh/tools/bmesh_beautify.c
M	source/blender/bmesh/tools/bmesh_beautify.h
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/io/io_collada.c

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

diff --git a/source/blender/blenkernel/intern/tracking_region_tracker.c b/source/blender/blenkernel/intern/tracking_region_tracker.c
index 72c9b86..dd7def1 100644
--- a/source/blender/blenkernel/intern/tracking_region_tracker.c
+++ b/source/blender/blenkernel/intern/tracking_region_tracker.c
@@ -113,7 +113,7 @@ static float *track_get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track,
 	return gray_pixels;
 }
 
-/* Get image boffer for a given frame
+/* Get image buffer for a given frame
  *
  * Frame is in clip space.
  */
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index d458923..d4f5da2 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -493,7 +493,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char
 	 *
 	 * For as long we don't allow editing properties in the interface
 	 * it's all good. bug if we allow editing them, we'll need to
-	 * repace it with some smarter code which would port settings
+	 * replace it with some smarter code which would port settings
 	 * from deprecated to new one.
 	 */
 	ffmpeg_set_expert_options(rd);
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index a5a7bc5..4a1ab86 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -945,36 +945,26 @@ void BM_face_triangulate(BMesh *bm, BMFace *f,
 
 				nf_i = 0;
 				for (i = 0; i < edge_array_len; i++) {
-					BMFace *f_a, *f_b;
+					BMFace *f_pair[2];
 					BMEdge *e = edge_array[i];
+					int j;
 #ifndef NDEBUG
-					const bool ok = BM_edge_face_pair(e, &f_a, &f_b);
+					const bool ok = BM_edge_face_pair(e, &f_pair[0], &f_pair[1]);
 					BLI_assert(ok);
 #else
-					BM_edge_face_pair(e, &f_a, &f_b);
+					BM_edge_face_pair(e, &f_pair[0], &f_pair[1]);
 #endif
-
-					if (FACE_USED_TEST(f_a) == false) {
-						FACE_USED_SET(f_a);  /* set_dirty */
-
-						if (nf_i < edge_array_len) {
-							r_faces_new[nf_i++] = f_a;
-						}
-						else {
-							f_new = f_a;
-							break;
-						}
-					}
-
-					if (FACE_USED_TEST(f_b) == false) {
-						FACE_USED_SET(f_b);  /* set_dirty */
-
-						if (nf_i < edge_array_len) {
-							r_faces_new[nf_i++] = f_b;
-						}
-						else {
-							f_new = f_b;
-							break;
+					for (j = 0; j < 2; j++) {
+						if (FACE_USED_TEST(f_pair[j]) == false) {
+							FACE_USED_SET(f_pair[j]);  /* set_dirty */
+
+							if (nf_i < edge_array_len) {
+								r_faces_new[nf_i++] = f_pair[j];
+							}
+							else {
+								f_new = f_pair[j];
+								break;
+							}
 						}
 					}
 				}
diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c
index 6639e76..a5b6026 100644
--- a/source/blender/bmesh/tools/bmesh_beautify.c
+++ b/source/blender/bmesh/tools/bmesh_beautify.c
@@ -400,9 +400,10 @@ static void bm_edge_update_beauty_cost(BMEdge *e, Heap *eheap, HeapNode **eheap_
 /**
  * \note This function sets the edge indices to invalid values.
  */
-void BM_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge_array_len,
-                                  const short flag, const short method,
-                                  const short oflag_edge, const short oflag_face)
+void BM_mesh_beautify_fill(
+        BMesh *bm, BMEdge **edge_array, const int edge_array_len,
+        const short flag, const short method,
+        const short oflag_edge, const short oflag_face)
 {
 	Heap *eheap;             /* edge heap */
 	HeapNode **eheap_table;  /* edge index aligned table pointing to the eheap */
diff --git a/source/blender/bmesh/tools/bmesh_beautify.h b/source/blender/bmesh/tools/bmesh_beautify.h
index 7cc1700..0d6aa23 100644
--- a/source/blender/bmesh/tools/bmesh_beautify.h
+++ b/source/blender/bmesh/tools/bmesh_beautify.h
@@ -31,12 +31,14 @@ enum {
 	VERT_RESTRICT_TAG = (1 << 0),
 };
 
-void BM_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge_array_len,
-                           const short flag, const short method,
-                           const short oflag_edge, const short oflag_face);
+void BM_mesh_beautify_fill(
+        BMesh *bm, BMEdge **edge_array, const int edge_array_len,
+        const short flag, const short method,
+        const short oflag_edge, const short oflag_face);
 
-float BM_verts_calc_rotate_beauty(const BMVert *v1, const BMVert *v2,
-                                  const BMVert *v3, const BMVert *v4,
-                                  const short flag, const short method);
+float BM_verts_calc_rotate_beauty(
+        const BMVert *v1, const BMVert *v2,
+        const BMVert *v3, const BMVert *v4,
+        const short flag, const short method);
 
 #endif /* __BMESH_BEAUTIFY_H__ */
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index 33dec29..6478af8 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -714,7 +714,7 @@ static int gpencil_lasso_select_exec(bContext *C, wmOperator *op)
 			
 			/* test if in lasso boundbox + within the lasso noose */
 			if ((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(&rect, x0, y0) &&
-				BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX)) 
+			    BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
 			{
 				if (select) {
 					pt->flag |= GP_SPOINT_SELECT;
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index b4b8929..3ea2fba 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -381,11 +381,13 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
 	min_chain_length = RNA_int_get(op->ptr, "min_chain_length");
 
 	RNA_string_get(op->ptr, "filepath", filename);
-	if (collada_import(C, filename,
-		import_units,
-		find_chains,
-		fix_orientation,
-		min_chain_length)) {
+	if (collada_import(
+	        C, filename,
+	        import_units,
+	        find_chains,
+	        fix_orientation,
+	        min_chain_length))
+	{
 		return OPERATOR_FINISHED;
 	}
 	else {




More information about the Bf-blender-cvs mailing list