Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Jan 2015 16:10:23 +0000 (03:10 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 24 Jan 2015 06:09:24 +0000 (17:09 +1100)
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/particle_distribute.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/versioning_260.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_text/text_ops.c
source/blender/imbuf/intern/bmp.c
source/blender/imbuf/intern/cineon/dpxlib.c

index 34877c7559cc83b2791a505b2d0b72ed60d56492..f8c79832dfcbe0a8fdc64333fa52feed851f61af 100644 (file)
@@ -161,21 +161,24 @@ static AdrBit2Path ma_mode_bits[] = {
        { \
                *tot = sizeof(items) / sizeof(AdrBit2Path); \
                return items; \
-       }
+       } (void)0
 
 /* This function checks if a Blocktype+Adrcode combo, returning a mapping table */
 static AdrBit2Path *adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *tot)
 {
        /* Object layers */
-       if ((blocktype == ID_OB) && (adrcode == OB_LAY))
-               RET_ABP(ob_layer_bits)
-       else if ((blocktype == ID_MA) && (adrcode == MA_MODE))
-               RET_ABP(ma_mode_bits)
+       if ((blocktype == ID_OB) && (adrcode == OB_LAY)) {
+               RET_ABP(ob_layer_bits);
+       }
+       else if ((blocktype == ID_MA) && (adrcode == MA_MODE)) {
+               RET_ABP(ma_mode_bits);
+       }
        // XXX TODO: add other types...
        
        /* Normal curve */
        return NULL;
 }
+#undef RET_ABP
 
 /* *************************************************** */
 /* ADRCODE to RNA-Path Conversion Code  - Standard */
index 34ab2a85593417ce13c2f3af875855f8bfdec5a5..5649164a27336b43d0a8c492b1046b5f20c6dde1 100644 (file)
@@ -913,7 +913,11 @@ static void docube(PROCESS *process, CUBE *cube, MetaBall *mb)
        CORNER *c1, *c2;
        int i, index = 0, count, indexar[8];
        
-       for (i = 0; i < 8; i++) if (cube->corners[i]->value > 0.0f) index += (1 << i);
+       for (i = 0; i < 8; i++) {
+               if (cube->corners[i]->value > 0.0f) {
+                       index += (1 << i);
+               }
+       }
        
        for (polys = cubetable[index]; polys; polys = polys->next) {
                INTLIST *edges;
index 7a422abae474de4ab4ec7a632fbde242cb77574d..6cc42e85a123725500e12a3e2d073cefa55f0f35 100644 (file)
@@ -651,8 +651,11 @@ static void distribute_children_exec(ParticleTask *thread, ChildParticle *cpa, i
                        cpa->w[i]=0.0f;
                }
                
-               if (totw>0.0f) for (w=0; w<4; w++)
-                       cpa->w[w]/=totw;
+               if (totw > 0.0f) {
+                       for (w = 0; w < 4; w++) {
+                               cpa->w[w] /= totw;
+                       }
+               }
                
                cpa->parent=cpa->pa[0];
        }
index 88720d5fcb7d22ccf4a9cc6d80fc3a89fab34fdb..43daaf2120c37b15011da2f402a69fd79ccce198 100644 (file)
@@ -687,8 +687,7 @@ void sound_free_waveform(bSound *sound)
 void sound_read_waveform(bSound *sound, short *stop)
 {
        AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
-       SoundWaveform *waveform = MEM_mallocN(sizeof(SoundWaveform),
-                                                                                 "SoundWaveform");
+       SoundWaveform *waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");
 
        if (info.length > 0) {
                int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND;
index 91ca21a9fbf54548181b03fb0aa5569751d7ba2a..9ec9f105015f2fb5b383124eaee009d969a82f01 100644 (file)
@@ -349,7 +349,11 @@ bool do_colorband(const ColorBand *coba, float in, float out[4])
                CBData left, right;
 
                /* we're looking for first pos > in */
-               for (a = 0; a < coba->tot; a++, cbd1++) if (cbd1->pos > in) break;
+               for (a = 0; a < coba->tot; a++, cbd1++) {
+                       if (cbd1->pos > in) {
+                               break;
+                       }
+               }
 
                if (a == coba->tot) {
                        cbd2 = cbd1 - 1;
index 7e5127aa40703f70b10250c36a7370224811f1ca..10526a191d21a7aa58b4cdffb7c52551b08e39f1 100644 (file)
@@ -1883,7 +1883,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                        SEQ_END
 
                        if (scene->r.bake_samples == 0)
-                       scene->r.bake_samples = 256;
+                               scene->r.bake_samples = 256;
 
                        if (scene->world) {
                                World *world = blo_do_versions_newlibadr(fd, scene->id.lib, scene->world);
index 430ea1cc11d81737f65f945c16111351c98c5bc8..2d425b7e5a0ffb3bb0a39326a2f585557fbd3d7c 100644 (file)
@@ -652,16 +652,12 @@ static void paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush,
                }
 
                /* set quad color. Colored overlay does not get blending */
-               if (col)
-                       glColor4f(1.0,
-                                     1.0,
-                                     1.0,
-                                     overlay_alpha / 100.0f);
-               else
-                       glColor4f(U.sculpt_paint_overlay_col[0],
-                                     U.sculpt_paint_overlay_col[1],
-                                     U.sculpt_paint_overlay_col[2],
-                                     overlay_alpha / 100.0f);
+               if (col) {
+                       glColor4f(1.0, 1.0, 1.0, overlay_alpha / 100.0f);
+               }
+               else {
+                       glColor4f(UNPACK3(U.sculpt_paint_overlay_col), overlay_alpha / 100.0f);
+               }
 
                /* draw textured quad */
                glBegin(GL_QUADS);
index d52b17372f7972fa0894fa4216f72f6ca846b082..df38117f376d6578c0f5912d903d3627db76dbd4 100644 (file)
@@ -158,9 +158,10 @@ static void undo_copy_tile(UndoImageTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, Cop
                }
        }
        else {
-               if (mode == RESTORE_COPY)
+               if (mode == RESTORE_COPY) {
                        IMB_rectcpy(tmpibuf, ibuf, 0, 0, tile->x * IMAPAINT_TILE_SIZE,
-                               tile->y * IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+                                   tile->y * IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+               }
                /* swap to the tmpbuf for easy copying */
                if (ibuf->rect_float) {
                        SWAP(float *, tmpibuf->rect_float, tile->rect.fp);
index 1cf0316aa06c8be6bf790e099b8b0b92f1ee31ee..1185d37f813ef6b67d772c4d7719dc07317df690 100644 (file)
@@ -2537,10 +2537,14 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, con
                y -= txt_get_span(text->lines.first, *linep) - st->top;
                
                if (y > 0) {
-                       while (y-- != 0) if ((*linep)->next) *linep = (*linep)->next;
+                       while (y-- != 0) {
+                               if ((*linep)->next) *linep = (*linep)->next;
+                       }
                }
                else if (y < 0) {
-                       while (y++ != 0) if ((*linep)->prev) *linep = (*linep)->prev;
+                       while (y++ != 0) {
+                               if ((*linep)->prev) *linep = (*linep)->prev;
+                       }
                }
 
                
index 8853fe449baecf83fb05c6beb241edcf0520f878..6d24f9b73d8843fe173d039ece9ef12ebc834b9b 100644 (file)
@@ -298,7 +298,9 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
                        if (putc(data[ptr], ofile) == EOF) return 0;
                }
                /* add padding here */
-               for (t = 0; t < extrabytes; t++) if (putc(0, ofile) == EOF) return 0;
+               for (t = 0; t < extrabytes; t++) {
+                       if (putc(0, ofile) == EOF) return 0;
+               }
        }
        if (ofile) {
                fflush(ofile);
index f7362d76913ebbcca7a920c5758651153170480a..23e5517bb09bf4ad8eee21b8aef6ec023095bd40 100644 (file)
@@ -183,8 +183,10 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf
                if (verbose) printf("DPX: File is LSB.\n");
        }
        else {
-               if (verbose) printf("DPX: Bad magic number %lu in \"%s\".\n",
-                                   (uintptr_t)header.fileHeader.magic_num, byteStuff);
+               if (verbose)  {
+                       printf("DPX: Bad magic number %lu in \"%s\".\n",
+                              (uintptr_t)header.fileHeader.magic_num, byteStuff);
+               }
                logImageClose(dpx);
                return NULL;
        }