style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 Jan 2013 21:17:38 +0000 (21:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 Jan 2013 21:17:38 +0000 (21:17 +0000)
source/blender/blenlib/BLI_mempool.h
source/blender/bmesh/tools/bmesh_triangulate.h
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/makesrna/intern/rna_particle.c

index 20ea89f3abfb360cce11ee2e7072801f251047e2..a1cbad73239190c70f3a12b43b7c3770fc9aa71e 100644 (file)
@@ -92,6 +92,13 @@ __attribute__((nonnull(1)))
 #endif
 ;
 
+void *BLI_mempool_as_arrayN(BLI_mempool *pool, const char *allocstr)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull(1, 2)))
+#endif
+;
+
 /** iteration stuff.  note: this may easy to produce bugs with **/
 /* private structure */
 typedef struct BLI_mempool_iter {
index 9632ab5957f144966ca7efd4d9fd179a9e99ab07..ea271c98acbd3938d4ff1d8c97f81425b0a3d762 100644 (file)
@@ -20,7 +20,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/bmesh/tools/bmesh_triangulate.c
+/** \file blender/bmesh/tools/bmesh_triangulate.h
  *  \ingroup bmesh
  *
  * Triangulate.
index ecb4ef93e9b9127dc8a647d95f9ce17e4ccaa26f..b54e47c136d7bcbc31a8edea6d00c472683cebd6 100644 (file)
@@ -383,7 +383,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                        buf[x] = -MAXFLOAT;
                }
                for (x = xmin; x < xmax; ++x) {
-                       buf[x - rect->xmin + window - 1] = buffer[4*(y * width + x)];
+                       buf[x - rect->xmin + window - 1] = buffer[4 * (y * width + x)];
                }
 
                for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
@@ -397,7 +397,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
 
                        start = half_window + (i - 1) * window + 1;
                        for (x = -min(0, start); x < window - max(0, start + window - bwidth); x++) {
-                               rectf[bwidth * (y-ymin) + (start + x)] = max(temp[x], temp[x + window - 1]);
+                               rectf[bwidth * (y - ymin) + (start + x)] = max(temp[x], temp[x + window - 1]);
                        }
                }
        }
@@ -408,7 +408,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                        buf[y] = -MAXFLOAT;
                }
                for (y = ymin; y < ymax; y++) {
-                       buf[y - rect->ymin + window - 1] = rectf[(y-ymin) * bwidth + x];
+                       buf[y - rect->ymin + window - 1] = rectf[(y - ymin) * bwidth + x];
                }
 
                for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
@@ -422,7 +422,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
 
                        start = half_window + (i - 1) * window + 1;
                        for (y = -min(0, start); y < window - max(0, start + window - bheight); y++) {
-                               rectf[bwidth * (y + start + (rect->ymin-ymin)) + x] = max(temp[y], temp[y + window - 1]);
+                               rectf[bwidth * (y + start + (rect->ymin - ymin)) + x] = max(temp[y], temp[y + window - 1]);
                        }
                }
        }
@@ -510,7 +510,7 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
                        buf[x] = MAXFLOAT;
                }
                for (x = xmin; x < xmax; ++x) {
-                       buf[x - rect->xmin + window - 1] = buffer[4*(y * width + x)];
+                       buf[x - rect->xmin + window - 1] = buffer[4 * (y * width + x)];
                }
 
                for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
@@ -524,7 +524,7 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
 
                        start = half_window + (i - 1) * window + 1;
                        for (x = -min(0, start); x < window - max(0, start + window - bwidth); x++) {
-                               rectf[bwidth * (y-ymin) + (start + x)] = min(temp[x], temp[x + window - 1]);
+                               rectf[bwidth * (y - ymin) + (start + x)] = min(temp[x], temp[x + window - 1]);
                        }
                }
        }
@@ -535,7 +535,7 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
                        buf[y] = MAXFLOAT;
                }
                for (y = ymin; y < ymax; y++) {
-                       buf[y - rect->ymin + window - 1] = rectf[(y-ymin) * bwidth + x];
+                       buf[y - rect->ymin + window - 1] = rectf[(y - ymin) * bwidth + x];
                }
 
                for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
@@ -549,7 +549,7 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
 
                        start = half_window + (i - 1) * window + 1;
                        for (y = -min(0, start); y < window - max(0, start + window - bheight); y++) {
-                               rectf[bwidth * (y + start + (rect->ymin-ymin)) + x] = min(temp[y], temp[y + window - 1]);
+                               rectf[bwidth * (y + start + (rect->ymin - ymin)) + x] = min(temp[y], temp[y + window - 1]);
                        }
                }
        }
index a872ace6ae371c5fe00bafde5999f19d19f4f03e..0107cd8b51ef31b14d0421fe8280384344cd2265 100644 (file)
@@ -289,8 +289,8 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle, ParticleSystemMod
        }
 }
 
-static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *object, ParticleSystemModifierData *modifier, int particle_no, int step,
-                                       float n_co[3])
+static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *object, ParticleSystemModifierData *modifier,
+                                       int particle_no, int step, float n_co[3])
 {
        ParticleSettings *part = 0;
        ParticleData *pars = 0;
@@ -307,7 +307,7 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o
        part = particlesystem->part;
        pars = particlesystem->particles;
 
-       if(particlesystem->renderdata) {
+       if (particlesystem->renderdata) {
                step_nbr = part->ren_step;
                totchild = particlesystem->totchild;
        }
@@ -381,10 +381,12 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
 
        part = particlesystem->part;
 
-       if(particlesystem->renderdata)
+       if (particlesystem->renderdata) {
                totchild = particlesystem->totchild;
-       else
+       }
+       else {
                totchild = (int)((float)particlesystem->totchild * (float)(part->disp) / 100.0f);
+       }
 
        /* can happen for disconnected/global hair */
        if (part->type == PART_HAIR && !particlesystem->childcache)
@@ -466,10 +468,11 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
        }
 }
 
-static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, ParticleSystemModifierData *modifier, ParticleData *particle, int particle_no, int vcol_no,
-                                             float n_mcol[3])
+static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, ParticleSystemModifierData *modifier,
+                                               ParticleData *particle, int particle_no, int vcol_no,
+                                               float n_mcol[3])
 {
-       ParticleSettings *part = 0;
+       ParticleSettings *part;
        int totpart;
        int totchild = 0;
        int num;
@@ -481,10 +484,12 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
 
        part = particlesystem->part;
 
-       if(particlesystem->renderdata)
+       if (particlesystem->renderdata) {
                totchild = particlesystem->totchild;
-       else
+       }
+       else {
                totchild = (int)((float)particlesystem->totchild * (float)(part->disp) / 100.0f);
+       }
 
        /* can happen for disconnected/global hair */
        if (part->type == PART_HAIR && !particlesystem->childcache)
@@ -495,7 +500,7 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
        if (particle_no >= totpart + totchild)
                return;
 
-/* 3. start creating renderable things */
+       /* 3. start creating renderable things */
        /* setup per particle individual stuff */
        if (particle_no < totpart) {