[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59340] trunk/blender/source/blender: style cleanup: also use ARRAY_HAS_ITEM macro for mempool check

Campbell Barton ideasman42 at gmail.com
Wed Aug 21 04:29:14 CEST 2013


Revision: 59340
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59340
Author:   campbellbarton
Date:     2013-08-21 02:29:13 +0000 (Wed, 21 Aug 2013)
Log Message:
-----------
style cleanup: also use ARRAY_HAS_ITEM macro for mempool check

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c
    trunk/blender/source/blender/blenkernel/intern/sequencer.c
    trunk/blender/source/blender/blenlib/intern/BLI_mempool.c
    trunk/blender/source/blender/blenlib/intern/sort.c
    trunk/blender/source/blender/editors/interface/interface_templates.c

Modified: trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c	2013-08-20 23:40:46 UTC (rev 59339)
+++ trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c	2013-08-21 02:29:13 UTC (rev 59340)
@@ -429,7 +429,8 @@
 
 				if (new_node) {
 					pbvh_bmesh_vert_ownership_transfer(bvh, new_node, v);
-				} else {
+				}
+				else {
 					BLI_ghash_remove(f_node->bm_unique_verts, v, NULL, NULL);
 					BLI_ghash_remove(bvh->bm_vert_to_node, v, NULL, NULL);
 				}

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2013-08-20 23:40:46 UTC (rev 59339)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2013-08-21 02:29:13 UTC (rev 59340)
@@ -3679,7 +3679,8 @@
 
 /* Unlike _update_sound_ funcs, these ones take info from audaspace to update sequence length! */
 #ifdef WITH_AUDASPACE
-static bool sequencer_refresh_sound_length_recursive(Scene *scene, ListBase *seqbase) {
+static bool sequencer_refresh_sound_length_recursive(Scene *scene, ListBase *seqbase)
+{
 	Sequence *seq;
 	bool changed = false;
 

Modified: trunk/blender/source/blender/blenlib/intern/BLI_mempool.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_mempool.c	2013-08-20 23:40:46 UTC (rev 59339)
+++ trunk/blender/source/blender/blenlib/intern/BLI_mempool.c	2013-08-21 02:29:13 UTC (rev 59340)
@@ -263,7 +263,7 @@
 		BLI_mempool_chunk *chunk;
 		bool found = false;
 		for (chunk = pool->chunks.first; chunk; chunk = chunk->next) {
-			if ((char*)addr >= (char*)chunk->data && (char*)addr < (char*)chunk->data + pool->csize) {
+			if (ARRAY_HAS_ITEM((char *)addr, (char *)chunk->data, pool->csize)) {
 				found = true;
 				break;
 			}

Modified: trunk/blender/source/blender/blenlib/intern/sort.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/sort.c	2013-08-20 23:40:46 UTC (rev 59339)
+++ trunk/blender/source/blender/blenlib/intern/sort.c	2013-08-21 02:29:13 UTC (rev 59340)
@@ -55,12 +55,12 @@
 #define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
 	es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
 
-BLI_INLINE void swapfunc(char* a, char* b, int n, int swaptype)
+BLI_INLINE void swapfunc(char *a, char *b, int n, int swaptype)
 {
-	if(swaptype <= 1)
+	if (swaptype <= 1)
 		swapcode(long, a, b, n)
 	else
-	swapcode(char, a, b, n)
+		swapcode(char, a, b, n)
 }
 
 #define swap(a, b)					\
@@ -90,11 +90,14 @@
 	SWAPINIT(a, es);
 	swap_cnt = 0;
 	if (n < 7) {
-		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
+		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) {
 			for (pl = pm;
-				pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
-				pl -= es)
+			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
+			     pl -= es)
+			{
 				swap(pl, pl - es);
+			}
+		}
 		return;
 	}
 	pm = (char *)a + (n / 2) * es;
@@ -138,11 +141,14 @@
 		pc -= es;
 	}
 	if (swap_cnt == 0) {  /* Switch to insertion sort */
-		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
+		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) {
 			for (pl = pm;
-				pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
-				pl -= es)
+			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
+			     pl -= es)
+			{
 				swap(pl, pl - es);
+			}
+		}
 		return;
 	}
 

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2013-08-20 23:40:46 UTC (rev 59339)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2013-08-21 02:29:13 UTC (rev 59340)
@@ -1147,9 +1147,10 @@
 	uiBlockSetEmboss(block, UI_EMBOSSN);
 	uiItemR(row, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
 	uiBlockSetEmboss(block, UI_EMBOSS);
-	
+
 	/* name */
-	uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco + 0.5f*UI_UNIT_X, yco, 5 * UI_UNIT_X, 0.9f*UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "");
+	uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr,
+	         xco + 0.5f * UI_UNIT_X, yco, 5 * UI_UNIT_X, 0.9f * UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "");
 
 	if (con->flag & CONSTRAINT_DISABLE)
 		uiLayoutSetRedAlert(row, TRUE);




More information about the Bf-blender-cvs mailing list