[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46576] trunk/blender/source/blender/ blenlib/intern: style cleanup: remaining BLI files.
Campbell Barton
ideasman42 at gmail.com
Sat May 12 17:13:06 CEST 2012
Revision: 46576
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46576
Author: campbellbarton
Date: 2012-05-12 15:13:06 +0000 (Sat, 12 May 2012)
Log Message:
-----------
style cleanup: remaining BLI files.
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/BLI_heap.c
trunk/blender/source/blender/blenlib/intern/BLI_mempool.c
trunk/blender/source/blender/blenlib/intern/boxpack2d.c
trunk/blender/source/blender/blenlib/intern/callbacks.c
trunk/blender/source/blender/blenlib/intern/cpu.c
trunk/blender/source/blender/blenlib/intern/dynlib.c
trunk/blender/source/blender/blenlib/intern/freetypefont.c
trunk/blender/source/blender/blenlib/intern/graph.c
trunk/blender/source/blender/blenlib/intern/gsqueue.c
trunk/blender/source/blender/blenlib/intern/listbase.c
trunk/blender/source/blender/blenlib/intern/path_util.c
trunk/blender/source/blender/blenlib/intern/rct.c
trunk/blender/source/blender/blenlib/intern/scanfill.c
trunk/blender/source/blender/blenlib/intern/string.c
trunk/blender/source/blender/blenlib/intern/time.c
trunk/blender/source/blender/blenlib/intern/uvproject.c
trunk/blender/source/blender/blenlib/intern/voxel.c
trunk/blender/source/blender/blenlib/intern/winstuff.c
Modified: trunk/blender/source/blender/blenlib/intern/BLI_heap.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_heap.c 2012-05-12 15:02:10 UTC (rev 46575)
+++ trunk/blender/source/blender/blenlib/intern/BLI_heap.c 2012-05-12 15:13:06 UTC (rev 46576)
@@ -60,10 +60,10 @@
#define HEAP_COMPARE(a, b) (a->value < b->value)
#define HEAP_EQUALS(a, b) (a->value == b->value)
#define HEAP_SWAP(heap, i, j) \
-{ \
- SWAP(int, heap->tree[i]->index, heap->tree[j]->index); \
- SWAP(HeapNode *, heap->tree[i], heap->tree[j]); \
-}
+ { \
+ SWAP(int, heap->tree[i]->index, heap->tree[j]->index); \
+ SWAP(HeapNode *, heap->tree[i], heap->tree[j]); \
+ }
/***/
Modified: trunk/blender/source/blender/blenlib/intern/BLI_mempool.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_mempool.c 2012-05-12 15:02:10 UTC (rev 46575)
+++ trunk/blender/source/blender/blenlib/intern/BLI_mempool.c 2012-05-12 15:13:06 UTC (rev 46576)
@@ -48,10 +48,10 @@
/* note: copied from BKE_utildefines.h, don't use here because we're in BLI */
#ifdef __BIG_ENDIAN__
/* Big Endian */
-# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
+# define MAKE_ID(a, b, c, d) ( (int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d) )
#else
/* Little Endian */
-# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
+# define MAKE_ID(a, b, c, d) ( (int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a) )
#endif
#define FREEWORD MAKE_ID('f', 'r', 'e', 'e')
Modified: trunk/blender/source/blender/blenlib/intern/boxpack2d.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/boxpack2d.c 2012-05-12 15:02:10 UTC (rev 46575)
+++ trunk/blender/source/blender/blenlib/intern/boxpack2d.c 2012-05-12 15:13:06 UTC (rev 46576)
@@ -56,7 +56,7 @@
#define TRF 2
#define TLF 4
#define BRF 8
-#define CORNERFLAGS (BLF|TRF|TLF|BRF)
+#define CORNERFLAGS (BLF | TRF | TLF | BRF)
#define BL 0
#define TR 1
@@ -93,13 +93,13 @@
BOXRIGHT(b1) - EPSILON <= BOXLEFT(b2) || \
BOXTOP(b1) - EPSILON <= BOXBOTTOM(b2))
-#define MIN2(x,y) ((x) < (y) ? (x) : (y))
-#define MAX2(x,y) ((x) > (y) ? (x) : (y))
+#define MIN2(x, y) ((x) < (y) ? (x) : (y))
+#define MAX2(x, y) ((x) > (y) ? (x) : (y))
#if 0
#define BOXDEBUG(b) \
printf("\tBox Debug i %i, w:%.3f h:%.3f x:%.3f y:%.3f\n", \
- b->index, b->w, b->h, b->x, b->y)
+ b->index, b->w, b->h, b->x, b->y)
#endif
/* qsort function - sort largest to smallest */
@@ -131,11 +131,11 @@
v1 = vertarray + ((int *)p1)[0];
v2 = vertarray + ((int *)p2)[0];
- a1 = MAX2(v1->x+box_width, v1->y+box_height);
- a2 = MAX2(v2->x+box_width, v2->y+box_height);
+ a1 = MAX2(v1->x + box_width, v1->y + box_height);
+ a2 = MAX2(v2->x + box_width, v2->y + box_height);
/* sort largest to smallest */
- if (a1 > a2) return 1;
+ if (a1 > a2) return 1;
else if (a1 < a2) return -1;
return 0;
}
@@ -145,11 +145,11 @@
* tightly into the lower left hand corner (0,0)
*
* boxarray - a pre allocated array of boxes.
- * only the 'box->x' and 'box->y' are set, 'box->w' and 'box->h' are used,
- * 'box->index' is not used at all, the only reason its there
- * is that the box array is sorted by area and programs need to be able
- * to have some way of writing the boxes back to the original data.
- * len - the number of boxes in the array.
+ * only the 'box->x' and 'box->y' are set, 'box->w' and 'box->h' are used,
+ * 'box->index' is not used at all, the only reason its there
+ * is that the box array is sorted by area and programs need to be able
+ * to have some way of writing the boxes back to the original data.
+ * len - the number of boxes in the array.
* tot_width and tot_height are set so you can normalize the data.
* */
void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height)
@@ -178,15 +178,15 @@
vert->blb = vert->brb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = CORNERFLAGS &~ TRF;
+ vert->free = CORNERFLAGS & ~TRF;
vert->trb = box;
vert->index = i; i++;
box->v[BL] = vert; vert++;
- vert->trb= vert->brb = vert->tlb =
+ vert->trb = vert->brb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = CORNERFLAGS &~ BLF;
+ vert->free = CORNERFLAGS & ~BLF;
vert->blb = box;
vert->index = i; i++;
box->v[TR] = vert; vert++;
@@ -194,7 +194,7 @@
vert->trb = vert->blb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = CORNERFLAGS &~ BRF;
+ vert->free = CORNERFLAGS & ~BRF;
vert->brb = box;
vert->index = i; i++;
box->v[TL] = vert; vert++;
@@ -202,7 +202,7 @@
vert->trb = vert->blb = vert->brb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = CORNERFLAGS &~ TLF;
+ vert->free = CORNERFLAGS & ~TLF;
vert->tlb = box;
vert->index = i; i++;
box->v[BR] = vert; vert++;
@@ -248,7 +248,7 @@
for (i = 0; i < verts_pack_len && isect; i++) {
vert = vertarray + vertex_pack_indices[i];
/* printf("\ttesting vert %i %i %i %f %f\n", i,
- * vert->free, verts_pack_len, vert->x, vert->y); */
+ * vert->free, verts_pack_len, vert->x, vert->y); */
/* This vert has a free quadrant
* Test if we can place the box here
@@ -281,11 +281,11 @@
* Assume no intersection... */
isect = 0;
- if (/* Constrain boxes to positive X/Y values */
- BOXLEFT(box) < 0.0f || BOXBOTTOM(box) < 0.0f ||
- /* check for last intersected */
- ( vert->isect_cache[j] &&
- BOXINTERSECT(box, vert->isect_cache[j])))
+ if ( /* Constrain boxes to positive X/Y values */
+ BOXLEFT(box) < 0.0f || BOXBOTTOM(box) < 0.0f ||
+ /* check for last intersected */
+ (vert->isect_cache[j] &&
+ BOXINTERSECT(box, vert->isect_cache[j])))
{
/* Here we check that the last intersected
* box will intersect with this one using
Modified: trunk/blender/source/blender/blenlib/intern/callbacks.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/callbacks.c 2012-05-12 15:02:10 UTC (rev 46575)
+++ trunk/blender/source/blender/blenlib/intern/callbacks.c 2012-05-12 15:13:06 UTC (rev 46576)
@@ -26,21 +26,21 @@
#include "MEM_guardedalloc.h"
-static ListBase callback_slots[BLI_CB_EVT_TOT]= {{NULL}};
+static ListBase callback_slots[BLI_CB_EVT_TOT] = {{NULL}};
void BLI_callback_exec(struct Main *main, struct ID *self, eCbEvent evt)
{
- ListBase *lb= &callback_slots[evt];
+ ListBase *lb = &callback_slots[evt];
bCallbackFuncStore *funcstore;
- for (funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= (bCallbackFuncStore *)funcstore->next) {
+ for (funcstore = (bCallbackFuncStore *)lb->first; funcstore; funcstore = (bCallbackFuncStore *)funcstore->next) {
funcstore->func(main, self, funcstore->arg);
}
}
void BLI_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt)
{
- ListBase *lb= &callback_slots[evt];
+ ListBase *lb = &callback_slots[evt];
BLI_addtail(lb, funcstore);
}
@@ -53,12 +53,12 @@
void BLI_callback_global_finalize(void)
{
eCbEvent evt;
- for (evt= 0; evt < BLI_CB_EVT_TOT; evt++) {
- ListBase *lb= &callback_slots[evt];
+ for (evt = 0; evt < BLI_CB_EVT_TOT; evt++) {
+ ListBase *lb = &callback_slots[evt];
bCallbackFuncStore *funcstore;
bCallbackFuncStore *funcstore_next;
- for (funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= funcstore_next) {
- funcstore_next= (bCallbackFuncStore *)funcstore->next;
+ for (funcstore = (bCallbackFuncStore *)lb->first; funcstore; funcstore = funcstore_next) {
+ funcstore_next = (bCallbackFuncStore *)funcstore->next;
BLI_remlink(lb, funcstore);
if (funcstore->alloc) {
MEM_freeN(funcstore);
Modified: trunk/blender/source/blender/blenlib/intern/cpu.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/cpu.c 2012-05-12 15:02:10 UTC (rev 46575)
+++ trunk/blender/source/blender/blenlib/intern/cpu.c 2012-05-12 15:13:06 UTC (rev 46576)
@@ -34,22 +34,22 @@
/* for GCC x86 we check cpuid */
unsigned int d;
__asm__(
- "pushl %%ebx\n\t"
- "cpuid\n\t"
- "popl %%ebx\n\t"
- : "=d"(d)
- : "a"(1));
+ "pushl %%ebx\n\t"
+ "cpuid\n\t"
+ "popl %%ebx\n\t"
+ : "=d" (d)
+ : "a" (1));
return (d & 0x04000000) != 0;
#elif (defined(_MSC_VER) && defined(_M_IX86))
/* also check cpuid for MSVC x86 */
unsigned int d;
__asm {
xor eax, eax
- inc eax
- push ebx
+ inc eax
+ push ebx
cpuid
- pop ebx
- mov d, edx
+ pop ebx
+ mov d, edx
}
return (d & 0x04000000) != 0;
#endif
Modified: trunk/blender/source/blender/blenlib/intern/dynlib.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/dynlib.c 2012-05-12 15:02:10 UTC (rev 46575)
+++ trunk/blender/source/blender/blenlib/intern/dynlib.c 2012-05-12 15:13:06 UTC (rev 46576)
@@ -53,14 +53,14 @@
void *handle;
UTF16_ENCODE(name);
- handle= LoadLibraryW(name_16);
+ handle = LoadLibraryW(name_16);
UTF16_UN_ENCODE(name);
if (!handle)
return NULL;
- lib= MEM_callocN(sizeof(*lib), "Dynamic Library");
- lib->handle= handle;
+ lib = MEM_callocN(sizeof(*lib), "Dynamic Library");
+ lib->handle = handle;
return lib;
}
@@ -75,16 +75,16 @@
int err;
/* if lib is NULL reset the last error code */
- err= GetLastError();
+ err = GetLastError();
if (!lib)
SetLastError(ERROR_SUCCESS);
if (err) {
static char buf[1024];
- if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list