[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46575] trunk/blender/source/blender: style cleanup: whitespace, bli & makesdna

Campbell Barton ideasman42 at gmail.com
Sat May 12 17:02:10 CEST 2012


Revision: 46575
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46575
Author:   campbellbarton
Date:     2012-05-12 15:02:10 +0000 (Sat, 12 May 2012)
Log Message:
-----------
style cleanup: whitespace, bli & makesdna

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/BLI_args.c
    trunk/blender/source/blender/blenlib/intern/BLI_dynstr.c
    trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
    trunk/blender/source/blender/blenlib/intern/BLI_heap.c
    trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
    trunk/blender/source/blender/blenlib/intern/BLI_kdtree.c
    trunk/blender/source/blender/blenlib/intern/BLI_linklist.c
    trunk/blender/source/blender/blenlib/intern/BLI_memarena.c
    trunk/blender/source/blender/blenlib/intern/DLRB_tree.c
    trunk/blender/source/blender/blenlib/intern/bpath.c
    trunk/blender/source/blender/blenlib/intern/edgehash.c
    trunk/blender/source/blender/blenlib/intern/fileops.c
    trunk/blender/source/blender/blenlib/intern/jitter.c
    trunk/blender/source/blender/blenlib/intern/math_geom.c
    trunk/blender/source/blender/blenlib/intern/math_rotation.c
    trunk/blender/source/blender/blenlib/intern/noise.c
    trunk/blender/source/blender/blenlib/intern/rand.c
    trunk/blender/source/blender/blenlib/intern/smallhash.c
    trunk/blender/source/blender/blenlib/intern/storage.c
    trunk/blender/source/blender/blenlib/intern/threads.c
    trunk/blender/source/blender/blenloader/intern/readblenentry.c
    trunk/blender/source/blender/blenloader/intern/undofile.c
    trunk/blender/source/blender/makesdna/intern/dna_genfile.c
    trunk/blender/source/blender/makesdna/intern/makesdna.c

Modified: trunk/blender/source/blender/blenlib/intern/BLI_args.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_args.c	2012-05-12 14:25:14 UTC (rev 46574)
+++ trunk/blender/source/blender/blenlib/intern/BLI_args.c	2012-05-12 15:02:10 UTC (rev 46575)
@@ -49,7 +49,7 @@
 	const char *short_arg;
 	const char *long_arg;
 	const char *documentation;
-	int  done;
+	int done;
 } bArgDoc;
 
 typedef struct bAKey {
@@ -68,24 +68,24 @@
 struct bArgs {
 	ListBase docs;
 	GHash  *items;
-	int 	argc;
+	int argc;
 	const char  **argv;
-	int	  *passes;
+	int *passes;
 };
 
 static unsigned int case_strhash(const void *ptr)
 {
-	const char *s= ptr;
-	unsigned int i= 0;
+	const char *s = ptr;
+	unsigned int i = 0;
 	unsigned char c;
 
-	while ( (c= tolower(*s++)) )
-		i= i*37 + c;
+	while ( (c = tolower(*s++)) )
+		i = i * 37 + c;
 
 	return i;
 }
 
-static unsigned int	keyhash(const void *ptr)
+static unsigned int keyhash(const void *ptr)
 {
 	const bAKey *k = ptr;
 	return case_strhash(k->arg); // ^ BLI_ghashutil_inthash((void*)k->pass);
@@ -102,7 +102,7 @@
 			return strcmp(ka->arg, kb->arg);
 	}
 	else {
-		return BLI_ghashutil_intcmp((const void*)ka->pass, (const void*)kb->pass);
+		return BLI_ghashutil_intcmp((const void *)ka->pass, (const void *)kb->pass);
 	}
 }
 
@@ -182,8 +182,8 @@
 
 	if (a) {
 		printf("WARNING: conflicting argument\n");
-		printf("\ttrying to add '%s' on pass %i, %scase sensitive\n", arg, pass, case_str == 1? "not ": "");
-		printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n", a->key->arg, (int)a->key->pass, a->key->case_str == 1? "not ": "");
+		printf("\ttrying to add '%s' on pass %i, %scase sensitive\n", arg, pass, case_str == 1 ? "not " : "");
+		printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n", a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : "");
 	}
 
 	a = MEM_callocN(sizeof(bArgument), "bArgument");
@@ -259,9 +259,9 @@
 {
 	int i = 0;
 
-	for ( i = 1; i < ba->argc; i++) { /* skip argv[0] */
+	for (i = 1; i < ba->argc; i++) {  /* skip argv[0] */
 		if (ba->passes[i] == 0) {
-			 /* -1 signal what side of the comparison it is */
+			/* -1 signal what side of the comparison it is */
 			bArgument *a = lookUp(ba, ba->argv[i], pass, -1);
 			BA_ArgCallback func = NULL;
 			void *data = NULL;

Modified: trunk/blender/source/blender/blenlib/intern/BLI_dynstr.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_dynstr.c	2012-05-12 14:25:14 UTC (rev 46574)
+++ trunk/blender/source/blender/blenlib/intern/BLI_dynstr.c	2012-05-12 15:02:10 UTC (rev 46575)
@@ -46,9 +46,9 @@
 
 #ifndef va_copy
 # ifdef __va_copy
-#  define va_copy(a,b) __va_copy(a,b)
+#  define va_copy(a, b) __va_copy(a, b)
 # else /* !__va_copy */
-#  define va_copy(a,b) ((a)=(b))
+#  define va_copy(a, b) ((a) = (b))
 # endif /* __va_copy */
 #endif /* va_copy */
 
@@ -70,65 +70,65 @@
 
 DynStr *BLI_dynstr_new(void)
 {
-	DynStr *ds= MEM_mallocN(sizeof(*ds), "DynStr");
-	ds->elems= ds->last= NULL;
-	ds->curlen= 0;
+	DynStr *ds = MEM_mallocN(sizeof(*ds), "DynStr");
+	ds->elems = ds->last = NULL;
+	ds->curlen = 0;
 	
 	return ds;
 }
 
 void BLI_dynstr_append(DynStr *ds, const char *cstr)
 {
-	DynStrElem *dse= malloc(sizeof(*dse));
-	int cstrlen= strlen(cstr);
+	DynStrElem *dse = malloc(sizeof(*dse));
+	int cstrlen = strlen(cstr);
 	
-	dse->str= malloc(cstrlen+1);
-	memcpy(dse->str, cstr, cstrlen+1);
-	dse->next= NULL;
+	dse->str = malloc(cstrlen + 1);
+	memcpy(dse->str, cstr, cstrlen + 1);
+	dse->next = NULL;
 	
 	if (!ds->last)
-		ds->last= ds->elems= dse;
+		ds->last = ds->elems = dse;
 	else
-		ds->last= ds->last->next= dse;
+		ds->last = ds->last->next = dse;
 
-	ds->curlen+= cstrlen;
+	ds->curlen += cstrlen;
 }
 
 void BLI_dynstr_nappend(DynStr *ds, const char *cstr, int len)
 {
-	DynStrElem *dse= malloc(sizeof(*dse));
-	int cstrlen= BLI_strnlen(cstr, len);
+	DynStrElem *dse = malloc(sizeof(*dse));
+	int cstrlen = BLI_strnlen(cstr, len);
 
-	dse->str= malloc(cstrlen+1);
+	dse->str = malloc(cstrlen + 1);
 	memcpy(dse->str, cstr, cstrlen);
 	dse->str[cstrlen] = '\0';
-	dse->next= NULL;
+	dse->next = NULL;
 
 	if (!ds->last)
-		ds->last= ds->elems= dse;
+		ds->last = ds->elems = dse;
 	else
-		ds->last= ds->last->next= dse;
+		ds->last = ds->last->next = dse;
 
-	ds->curlen+= cstrlen;
+	ds->curlen += cstrlen;
 }
 
 void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args)
 {
 	char *message, fixedmessage[256];
-	int len= sizeof(fixedmessage);
-	const int maxlen= 65536;
+	int len = sizeof(fixedmessage);
+	const int maxlen = 65536;
 	int retval;
 
 	while (1) {
 		va_list args_cpy;
 		if (len == sizeof(fixedmessage))
-			message= fixedmessage;
+			message = fixedmessage;
 		else
-			message= MEM_callocN(sizeof(char) * len, "BLI_dynstr_appendf");
+			message = MEM_callocN(sizeof(char) * len, "BLI_dynstr_appendf");
 
 		/* cant reuse the same args, so work on a copy */
 		va_copy(args_cpy, args);
-		retval= vsnprintf(message, len, format, args_cpy);
+		retval = vsnprintf(message, len, format, args_cpy);
 		va_end(args_cpy);
 
 		if (retval == -1) {
@@ -136,7 +136,7 @@
 			 * there is a formatting error, so we impose a maximum length */
 			if (message != fixedmessage)
 				MEM_freeN(message);
-			message= NULL;
+			message = NULL;
 
 			len *= 2;
 			if (len > maxlen) {
@@ -148,10 +148,10 @@
 			/* in C99 the actual length required is returned */
 			if (message != fixedmessage)
 				MEM_freeN(message);
-			message= NULL;
+			message = NULL;
 
 			/* retval doesn't include \0 terminator */
-			len= retval + 1;
+			len = retval + 1;
 		}
 		else
 			break;
@@ -169,8 +169,8 @@
 {
 	va_list args;
 	char *message, fixedmessage[256];
-	int len= sizeof(fixedmessage);
-	const int maxlen= 65536;
+	int len = sizeof(fixedmessage);
+	const int maxlen = 65536;
 	int retval;
 
 	/* note that it's tempting to just call BLI_dynstr_vappendf here
@@ -179,12 +179,12 @@
 
 	while (1) {
 		if (len == sizeof(fixedmessage))
-			message= fixedmessage;
+			message = fixedmessage;
 		else
-			message= MEM_callocN(sizeof(char)*(len), "BLI_dynstr_appendf");
+			message = MEM_callocN(sizeof(char) * (len), "BLI_dynstr_appendf");
 
 		va_start(args, format);
-		retval= vsnprintf(message, len, format, args);
+		retval = vsnprintf(message, len, format, args);
 		va_end(args);
 
 		if (retval == -1) {
@@ -192,7 +192,7 @@
 			 * there is a formatting error, so we impose a maximum length */
 			if (message != fixedmessage)
 				MEM_freeN(message);
-			message= NULL;
+			message = NULL;
 
 			len *= 2;
 			if (len > maxlen) {
@@ -204,10 +204,10 @@
 			/* in C99 the actual length required is returned */
 			if (message != fixedmessage)
 				MEM_freeN(message);
-			message= NULL;
+			message = NULL;
 
 			/* retval doesn't include \0 terminator */
-			len= retval + 1;
+			len = retval + 1;
 		}
 		else
 			break;
@@ -231,19 +231,19 @@
 	char *s;
 	DynStrElem *dse;
 
-	for (s= rets, dse= ds->elems; dse; dse= dse->next) {
-		int slen= strlen(dse->str);
+	for (s = rets, dse = ds->elems; dse; dse = dse->next) {
+		int slen = strlen(dse->str);
 
 		memcpy(s, dse->str, slen);
 
-		s+= slen;
+		s += slen;
 	}
-	rets[ds->curlen]= '\0';
+	rets[ds->curlen] = '\0';
 }
 
 char *BLI_dynstr_get_cstring(DynStr *ds)
 {
-	char *rets= MEM_mallocN(ds->curlen+1, "dynstr_cstring");
+	char *rets = MEM_mallocN(ds->curlen + 1, "dynstr_cstring");
 	BLI_dynstr_get_cstring_ex(ds, rets);
 	return rets;
 }
@@ -252,13 +252,13 @@
 {
 	DynStrElem *dse;
 	
-	for (dse= ds->elems; dse; ) {
-		DynStrElem *n= dse->next;
+	for (dse = ds->elems; dse; ) {
+		DynStrElem *n = dse->next;
 		
 		free(dse->str);
 		free(dse);
 		
-		dse= n;
+		dse = n;
 	}
 	
 	MEM_freeN(ds);

Modified: trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2012-05-12 14:25:14 UTC (rev 46574)
+++ trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2012-05-12 15:02:10 UTC (rev 46575)
@@ -78,7 +78,7 @@
 void BLI_ghash_insert(GHash *gh, void *key, void *val)
 {
 	unsigned int hash = gh->hashfp(key) % gh->nbuckets;
-	Entry *e = (Entry*)BLI_mempool_alloc(gh->entrypool);
+	Entry *e = (Entry *)BLI_mempool_alloc(gh->entrypool);
 
 	e->key = key;
 	e->val = val;
@@ -90,11 +90,11 @@
 		int i, nold = gh->nbuckets;
 
 		gh->nbuckets = hashsizes[++gh->cursize];
-		gh->buckets = (Entry**)MEM_mallocN(gh->nbuckets * sizeof(*gh->buckets), "buckets");
+		gh->buckets = (Entry **)MEM_mallocN(gh->nbuckets * sizeof(*gh->buckets), "buckets");
 		memset(gh->buckets, 0, gh->nbuckets * sizeof(*gh->buckets));
 
 		for (i = 0; i < nold; i++) {
-			for (e = old[i]; e;) {
+			for (e = old[i]; e; ) {
 				Entry *n = e->next;
 
 				hash = gh->hashfp(e->key) % gh->nbuckets;
@@ -174,7 +174,7 @@
 		for (i = 0; i < gh->nbuckets; i++) {
 			Entry *e;
 
-			for (e = gh->buckets[i]; e;) {
+			for (e = gh->buckets[i]; e; ) {
 				Entry *n = e->next;
 
 				if (keyfreefp) keyfreefp(e->key);
@@ -333,6 +333,6 @@
 
 void BLI_ghashutil_pairfree(void *ptr)
 {
-	MEM_freeN((void*)ptr);
+	MEM_freeN((void *)ptr);
 }
 

Modified: trunk/blender/source/blender/blenlib/intern/BLI_heap.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_heap.c	2012-05-12 14:25:14 UTC (rev 46574)
+++ trunk/blender/source/blender/blenlib/intern/BLI_heap.c	2012-05-12 15:02:10 UTC (rev 46575)
@@ -184,7 +184,7 @@
 	if (heap->size == 1)
 		heap->size--;
 	else {
-		HEAP_SWAP(heap, 0, heap->size-1);
+		HEAP_SWAP(heap, 0, heap->size - 1);
 		heap->size--;
 
 		BLI_heap_down(heap, 0);

Modified: trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c	2012-05-12 14:25:14 UTC (rev 46574)
+++ trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c	2012-05-12 15:02:10 UTC (rev 46575)
@@ -50,59 +50,54 @@
 #define MAX_TREETYPE 32
 #define DEFAULT_FIND_NEAREST_HEAP_SIZE 1024
 
-typedef struct BVHNode
-{
+typedef struct BVHNode {
 	struct BVHNode **children;
 	struct BVHNode *parent; // some user defined traversed need that
 	struct BVHNode *skip[2];
-	float *bv;		// Bounding volume of all nodes, max 13 axis
-	int index;		// face, edge, vertex index
-	char totnode;	// how many nodes are used, used for speedup
-	char main_axis;	// Axis used to split this node

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list