[Bf-blender-cvs] [fcda27c] master: Cleanup: style

Campbell Barton noreply at git.blender.org
Sat Jan 24 07:10:07 CET 2015


Commit: fcda27cdaedfcf79607b13dbf5c6fe670e95d2ac
Author: Campbell Barton
Date:   Sat Jan 24 03:10:23 2015 +1100
Branches: master
https://developer.blender.org/rBfcda27cdaedfcf79607b13dbf5c6fe670e95d2ac

Cleanup: style

===================================================================

M	source/blender/blenkernel/intern/ipo.c
M	source/blender/blenkernel/intern/mball.c
M	source/blender/blenkernel/intern/particle_distribute.c
M	source/blender/blenkernel/intern/sound.c
M	source/blender/blenkernel/intern/texture.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/space_text/text_ops.c
M	source/blender/imbuf/intern/bmp.c
M	source/blender/imbuf/intern/cineon/dpxlib.c

===================================================================

diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 34877c7..f8c7983 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -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 */
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 34ab2a8..5649164 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -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;
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 7a422ab..6cc42e8 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -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];
 	}
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 88720d5..43daaf2 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -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;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 91ca21a..9ec9f10 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -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;
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 7e5127a..10526a1 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -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);
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 430ea1c..2d425b7 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -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);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d52b173..df38117 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -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);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 1cf0316..1185d37 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -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;
+			}
 		}
 
 		
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 8853fe4..6d24f9b 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -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);
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c
index f7362d7..23e5517 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.c
+++ b/source/blender/imbuf/intern/cineon/dpxlib.c
@@ -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;
 	}




More information about the Bf-blender-cvs mailing list