Revision: 44348
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44348
Author:   campbellbarton
Date:     2012-02-23 02:17:50 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
style cleanup for blenkernel, no functional changes.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/blenkernel/intern/action.c
    trunk/blender/source/blender/blenkernel/intern/boids.c
    trunk/blender/source/blender/blenkernel/intern/brush.c
    trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/blenkernel/intern/customdata.c
    trunk/blender/source/blender/blenkernel/intern/lattice.c
    trunk/blender/source/blender/blenkernel/intern/material.c
    trunk/blender/source/blender/blenkernel/intern/mball.c
    trunk/blender/source/blender/blenkernel/intern/mesh.c
    trunk/blender/source/blender/blenkernel/intern/mesh_validate.c
    trunk/blender/source/blender/blenkernel/intern/multires.c
    trunk/blender/source/blender/blenkernel/intern/object.c
    trunk/blender/source/blender/blenkernel/intern/ocean.c
    trunk/blender/source/blender/blenkernel/intern/scene.c
    trunk/blender/source/blender/blenkernel/intern/sequencer.c
    trunk/blender/source/blender/blenkernel/intern/softbody.c
    trunk/blender/source/blender/blenkernel/intern/sound.c
    trunk/blender/source/blender/blenkernel/intern/text.c
    trunk/blender/source/blender/blenkernel/intern/unit.c

Modified: trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c 2012-02-23 
01:49:59 UTC (rev 44347)
+++ trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c 2012-02-23 
02:17:50 UTC (rev 44348)
@@ -13,9 +13,9 @@
 #include "BLO_sys_types.h" // for intptr_t support
 
 #ifdef _MSC_VER
-#define CCG_INLINE __inline
+#  define CCG_INLINE __inline
 #else
-#define CCG_INLINE inline
+#  define CCG_INLINE inline
 #endif
 
 /* copied from BKE_utildefines.h ugh */
@@ -59,22 +59,24 @@
 
 #define EHASH_hash(eh, item)   (((uintptr_t) (item))%((unsigned int) 
(eh)->curSize))
 
-static EHash *_ehash_new(int estimatedNumEntries, CCGAllocatorIFC 
*allocatorIFC, CCGAllocatorHDL allocator) {
+static EHash *_ehash_new(int estimatedNumEntries, CCGAllocatorIFC 
*allocatorIFC, CCGAllocatorHDL allocator)
+{
        EHash *eh = allocatorIFC->alloc(allocator, sizeof(*eh));
        eh->allocatorIFC = *allocatorIFC;
        eh->allocator = allocator;
        eh->numEntries = 0;
        eh->curSizeIdx = 0;
-       while (kHashSizes[eh->curSizeIdx]<estimatedNumEntries)
+       while (kHashSizes[eh->curSizeIdx] < estimatedNumEntries)
                eh->curSizeIdx++;
        eh->curSize = kHashSizes[eh->curSizeIdx];
-       eh->buckets = EHASH_alloc(eh, eh->curSize*sizeof(*eh->buckets));
-       memset(eh->buckets, 0, eh->curSize*sizeof(*eh->buckets));
+       eh->buckets = EHASH_alloc(eh, eh->curSize * sizeof(*eh->buckets));
+       memset(eh->buckets, 0, eh->curSize * sizeof(*eh->buckets));
 
        return eh;
 }
 typedef void (*EHEntryFreeFP)(EHEntry *, void *);
-static void _ehash_free(EHash *eh, EHEntryFreeFP freeEntry, void *userData) {
+static void _ehash_free(EHash *eh, EHEntryFreeFP freeEntry, void *userData)
+{
        int numBuckets = eh->curSize;
 
        while (numBuckets--) {
@@ -93,19 +95,20 @@
        EHASH_free(eh, eh);
 }
 
-static void _ehash_insert(EHash *eh, EHEntry *entry) {
+static void _ehash_insert(EHash *eh, EHEntry *entry)
+{
        int numBuckets = eh->curSize;
        int hash = EHASH_hash(eh, entry->key);
        entry->next = eh->buckets[hash];
        eh->buckets[hash] = entry;
        eh->numEntries++;
 
-       if (eh->numEntries > (numBuckets*3)) {
+       if (eh->numEntries > (numBuckets * 3)) {
                EHEntry **oldBuckets = eh->buckets;
                eh->curSize = kHashSizes[++eh->curSizeIdx];
                
-               eh->buckets = EHASH_alloc(eh, eh->curSize*sizeof(*eh->buckets));
-               memset(eh->buckets, 0, eh->curSize*sizeof(*eh->buckets));
+               eh->buckets = EHASH_alloc(eh, eh->curSize * 
sizeof(*eh->buckets));
+               memset(eh->buckets, 0, eh->curSize * sizeof(*eh->buckets));
 
                while (numBuckets--) {
                        for (entry = oldBuckets[numBuckets]; entry;) {
@@ -123,13 +126,14 @@
        }
 }
 
-static void *_ehash_lookupWithPrev(EHash *eh, void *key, void ***prevp_r) {
+static void *_ehash_lookupWithPrev(EHash *eh, void *key, void ***prevp_r)
+{
        int hash = EHASH_hash(eh, key);
        void **prevp = (void**) &eh->buckets[hash];
        EHEntry *entry;
        
        for (; (entry = *prevp); prevp = (void**) &entry->next) {
-               if (entry->key==key) {
+               if (entry->key == key) {
                        *prevp_r = (void**) prevp;
                        return entry;
                }
@@ -138,12 +142,13 @@
        return NULL;
 }
 
-static void *_ehash_lookup(EHash *eh, void *key) {
+static void *_ehash_lookup(EHash *eh, void *key)
+{
        int hash = EHASH_hash(eh, key);
        EHEntry *entry;
        
        for (entry = eh->buckets[hash]; entry; entry = entry->next)
-               if (entry->key==key)
+               if (entry->key == key)
                        break;
        
        return entry;
@@ -157,55 +162,64 @@
        EHEntry *curEntry;
 } EHashIterator;
 
-static EHashIterator *_ehashIterator_new(EHash *eh) {
+static EHashIterator *_ehashIterator_new(EHash *eh)
+{
        EHashIterator *ehi = EHASH_alloc(eh, sizeof(*ehi));
        ehi->eh = eh;
        ehi->curEntry = NULL;
        ehi->curBucket = -1;
        while (!ehi->curEntry) {
                ehi->curBucket++;
-               if (ehi->curBucket==ehi->eh->curSize)
+               if (ehi->curBucket == ehi->eh->curSize)
                        break;
                ehi->curEntry = ehi->eh->buckets[ehi->curBucket];
        }
        return ehi;
 }
-static void _ehashIterator_free(EHashIterator *ehi) {
+static void _ehashIterator_free(EHashIterator *ehi)
+{
        EHASH_free(ehi->eh, ehi);
 }
 
-static void *_ehashIterator_getCurrent(EHashIterator *ehi) {
+static void *_ehashIterator_getCurrent(EHashIterator *ehi)
+{
        return ehi->curEntry;
 }
 
-static void _ehashIterator_next(EHashIterator *ehi) {
+static void _ehashIterator_next(EHashIterator *ehi)
+{
        if (ehi->curEntry) {
                ehi->curEntry = ehi->curEntry->next;
                while (!ehi->curEntry) {
                        ehi->curBucket++;
-                       if (ehi->curBucket==ehi->eh->curSize)
+                       if (ehi->curBucket == ehi->eh->curSize)
                                break;
                        ehi->curEntry = ehi->eh->buckets[ehi->curBucket];
                }
        }
 }
-static int _ehashIterator_isStopped(EHashIterator *ehi) {
+static int _ehashIterator_isStopped(EHashIterator *ehi)
+{
        return !ehi->curEntry;
 }
 
 /***/
 
-static void *_stdAllocator_alloc(CCGAllocatorHDL UNUSED(a), int numBytes) {
+static void *_stdAllocator_alloc(CCGAllocatorHDL UNUSED(a), int numBytes)
+{
        return malloc(numBytes);
 }
-static void *_stdAllocator_realloc(CCGAllocatorHDL UNUSED(a), void *ptr, int 
newSize, int UNUSED(oldSize)) {
+static void *_stdAllocator_realloc(CCGAllocatorHDL UNUSED(a), void *ptr, int 
newSize, int UNUSED(oldSize))
+{
        return realloc(ptr, newSize);
 }
-static void _stdAllocator_free(CCGAllocatorHDL UNUSED(a), void *ptr) {
+static void _stdAllocator_free(CCGAllocatorHDL UNUSED(a), void *ptr)
+{
        free(ptr);
 }
 
-static CCGAllocatorIFC *_getStandardAllocatorIFC(void) {
+static CCGAllocatorIFC *_getStandardAllocatorIFC(void)
+{
        static CCGAllocatorIFC ifc;
 
        ifc.alloc = _stdAllocator_alloc;
@@ -218,24 +232,25 @@
 
 /***/
 
-static int VertDataEqual(const float *a, const float *b) {
-       return a[0]==b[0] && a[1]==b[1] && a[2]==b[2];
+static int VertDataEqual(const float *a, const float *b)
+{
+       return a[0] == b[0] && a[1] == b[1] && a[2] == b[2];
 }
-#define VertDataZero(av)                               { float *_a = (float*) 
av; _a[0] = _a[1] = _a[2] = 0.0f; }
-#define VertDataCopy(av, bv)                   { float *_a = (float*) av, *_b 
= (float*) bv; _a[0] =_b[0]; _a[1] =_b[1]; _a[2] =_b[2]; }
-#define VertDataAdd(av, bv)                            { float *_a = (float*) 
av, *_b = (float*) bv; _a[0]+=_b[0]; _a[1]+=_b[1]; _a[2]+=_b[2]; }
-#define VertDataSub(av, bv)                            { float *_a = (float*) 
av, *_b = (float*) bv; _a[0]-=_b[0]; _a[1]-=_b[1]; _a[2]-=_b[2]; }
-#define VertDataMulN(av, n)                            { float *_a = (float*) 
av; _a[0]*=n; _a[1]*=n; _a[2]*=n; }
+#define VertDataZero(av)     { float *_a = (float *)av; _a[0] = _a[1] = _a[2] 
= 0.0f; }
+#define VertDataCopy(av, bv) { float *_a = (float *)av, *_b = (float *) bv; 
_a[0]  = _b[0]; _a[1]  = _b[1]; _a[2]  = _b[2]; }
+#define VertDataAdd(av, bv)  { float *_a = (float *)av, *_b = (float *) bv; 
_a[0] += _b[0]; _a[1] += _b[1]; _a[2] += _b[2]; }
+#define VertDataSub(av, bv)  { float *_a = (float *)av, *_b = (float *) bv; 
_a[0] -= _b[0]; _a[1] -= _b[1]; _a[2] -= _b[2]; }
+#define VertDataMulN(av, n)  { float *_a = (float *)av; _a[0]*=n; _a[1]*=n; 
_a[2] *=n; }
 #define VertDataAvg4(tv, av, bv, cv, dv) \
        { \
-               float *_t = (float*) tv, *_a = (float*) av, *_b = (float*) bv, 
*_c = (float*) cv, *_d = (float*) dv; \
-               _t[0] = (_a[0]+_b[0]+_c[0]+_d[0])*.25f; \
-               _t[1] = (_a[1]+_b[1]+_c[1]+_d[1])*.25f; \
-               _t[2] = (_a[2]+_b[2]+_c[2]+_d[2])*.25f; \
+               float *_t = (float *) tv, *_a = (float *) av, *_b = (float *) 
bv, *_c = (float *) cv, *_d = (float *) dv; \
+               _t[0] = (_a[0] + _b[0] + _c[0] + _d[0]) * 0.25f; \
+               _t[1] = (_a[1] + _b[1] + _c[1] + _d[1]) * 0.25f; \
+               _t[2] = (_a[2] + _b[2] + _c[2] + _d[2]) * 0.25f; \
        }
-#define NormZero(av)                                   { float *_a = (float*) 
av; _a[0] = _a[1] = _a[2] = 0.0f; }
-#define NormCopy(av, bv)                               { float *_a = (float*) 
av, *_b = (float*) bv; _a[0] =_b[0]; _a[1] =_b[1]; _a[2] =_b[2]; }
-#define NormAdd(av, bv)                                        { float *_a = 
(float*) av, *_b = (float*) bv; _a[0]+=_b[0]; _a[1]+=_b[1]; _a[2]+=_b[2]; }
+#define NormZero(av)     { float *_a = (float *) av; _a[0] = _a[1] = _a[2] = 
0.0f; }
+#define NormCopy(av, bv) { float *_a = (float *) av, *_b = (float *) bv; _a[0] 
 = _b[0]; _a[1]  = _b[1]; _a[2]  = _b[2]; }
+#define NormAdd(av, bv)  { float *_a = (float *) av, *_b = (float *) bv; _a[0] 
+= _b[0]; _a[1] += _b[1]; _a[2] += _b[2]; }
 
 
 static int _edge_isBoundary(const CCGEdge *e);
@@ -243,15 +258,15 @@
 /***/
 
 enum {
-       Vert_eEffected=         (1<<0),
-       Vert_eChanged=          (1<<1),
-       Vert_eSeam=                     (1<<2),
+       Vert_eEffected =    (1 << 0),
+       Vert_eChanged =     (1 << 1),
+       Vert_eSeam =        (1 << 2)
 } /*VertFlags*/;
 enum {
-       Edge_eEffected=         (1<<0),
+       Edge_eEffected =    (1 << 0)
 } /*CCGEdgeFlags*/;
 enum {
-       Face_eEffected=         (1<<0),
+       Face_eEffected =    (1 << 0)
 } /*FaceFlags*/;
 
 struct _CCGVert {
@@ -265,7 +280,7 @@
 //     byte *levelData;
 //     byte *userData;
 };
-#define VERT_getLevelData(v)           ((byte*) &(v)[1])
+#define VERT_getLevelData(v)           ((byte *) &(v)[1])
 
 struct _CCGEdge {
        CCGEdge         *next;  /* EHData.next */
@@ -280,7 +295,7 @@
 //     byte *levelData;
 //     byte *userData;
 };
-#define EDGE_getLevelData(e)           ((byte*) &(e)[1])
+#define EDGE_getLevelData(e)           ((byte *) &(e)[1])
 
 struct _CCGFace {
        CCGFace         *next;  /* EHData.next */
@@ -296,14 +311,14 @@
 };
 #define FACE_getVerts(f)               ((CCGVert**) &(f)[1])
 #define FACE_getEdges(f)               ((CCGEdge**) 
&(FACE_getVerts(f)[(f)->numVerts]))
-#define FACE_getCenterData(f)  ((byte*) &(FACE_getEdges(f)[(f)->numVerts]))
+#define FACE_getCenterData(f)  ((byte *) &(FACE_getEdges(f)[(f)->numVerts]))
 
 typedef enum {
        eSyncState_None = 0,
        eSyncState_Vert,
        eSyncState_Edge,
        eSyncState_Face,
-       eSyncState_Partial,
+       eSyncState_Partial
 } SyncState;
 
 struct _CCGSubSurf {
@@ -350,8 +365,9 @@
 
 /***/
 
-static CCGVert *_vert_new(CCGVertHDL vHDL, CCGSubSurf *ss) {
-       CCGVert *v = CCGSUBSURF_alloc(ss, sizeof(CCGVert) + 
ss->meshIFC.vertDataSize * (ss->subdivLevels+1) + ss->meshIFC.vertUserSize);
+static CCGVert *_vert_new(CCGVertHDL vHDL, CCGSubSurf *ss)
+{
+       CCGVert *v = CCGSUBSURF_alloc(ss, sizeof(CCGVert) + 
ss->meshIFC.vertDataSize * (ss->subdivLevels + 1) + ss->meshIFC.vertUserSize);
        byte *userData;
 
        v->vHDL = vHDL;
@@ -366,71 +382,87 @@
 
        return v;
 }
-static void _vert_remEdge(CCGVert *v, CCGEdge *e) {
+static void _vert_remEdge(CCGVert *v, CCGEdge *e)
+{
        int i;
-       for (i=0; i<v->numEdges; i++) {
-               if (v->edges[i]==e) {
+       for (i = 0; i < v->numEdges; i++) {
+               if (v->edges[i] == e) {
                        v->edges[i] = v->edges[--v->numEdges];
                        break;
                }
        }
 }
-static void _vert_remFace(CCGVert *v, CCGFace *f) {
+static void _vert_remFace(CCGVert *v, CCGFace *f)
+{
        int i;
-       for (i=0; i<v->numFaces; i++) {

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to