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

Campbell Barton noreply at git.blender.org
Tue Jun 16 23:11:29 CEST 2015


Commit: ecdbe3cc6351bd5f59b0052289419a0337047574
Author: Campbell Barton
Date:   Wed Jun 17 07:06:59 2015 +1000
Branches: master
https://developer.blender.org/rBecdbe3cc6351bd5f59b0052289419a0337047574

Cleanup: style

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

M	source/blender/blenkernel/intern/displist.c
M	source/blender/blenlib/intern/math_geom.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/gpu/intern/gpu_codegen.c

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

diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 336d2c1..3213b59 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -517,7 +517,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj
 			dl = dl->next;
 		}
 
-		/* XXX (obedit && obedit->actcol) ? (obedit->actcol-1) : 0)) { */
+		/* XXX (obedit && obedit->actcol) ? (obedit->actcol - 1) : 0)) { */
 		if (totvert && (tot = BLI_scanfill_calc_ex(&sf_ctx,
 		                                           scanfill_flag,
 		                                           normal_proj)))
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index ad48711..f74e311 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -771,7 +771,9 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
 
 bool isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
 {
-#define CCW(A, B, C) ((C[1] - A[1]) * (B[0] - A[0]) > (B[1]-A[1]) * (C[0]-A[0]))
+#define CCW(A, B, C) \
+	((C[1] - A[1]) * (B[0] - A[0]) > \
+	 (B[1] - A[1]) * (C[0] - A[0]))
 
 	return CCW(v1, v3, v4) != CCW(v2, v3, v4) && CCW(v1, v2, v3) != CCW(v1, v2, v4);
 
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index dab22d4..1819dcd 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1292,7 +1292,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
 		Object *ob;
 
 		for (vf = main->vfont.first; vf; vf = vf->id.next) {
-			if (STREQ(vf->name + strlen(vf->name)-6, ".Bfont")) {
+			if (STREQ(vf->name + strlen(vf->name) - 6, ".Bfont")) {
 				strcpy(vf->name, FO_BUILTIN_NAME);
 			}
 		}
@@ -2480,7 +2480,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
 
 		for (group = main->group.first; group; group = group->id.next)
 			if (group->layer == 0)
-				group->layer = (1<<20)-1;
+				group->layer = (1 << 20) - 1;
 
 		/* now, subversion control! */
 		if (main->subversionfile < 3) {
diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
index 0e48d59..50ac3b5 100644
--- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
+++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
@@ -52,7 +52,7 @@ void LuminanceMatteOperation::executePixelSampled(float output[4], float x, floa
 	this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
 	
 	/* one line thread-friend algorithm:
-	 * output[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low))))
+	 * output[0] = max(inputValue[3], min(high, max(low, ((inColor[0] - low) / (high - low))));
 	 */
 		
 	/* test range */
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 960b29a..46b6a054 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -1177,7 +1177,7 @@ static void getVerticalAndHorizontalChange(const float norm[3], float d, const f
 	dists[index] = dot_v3v3(norm, end) + d;
 	/* vertical change */
 	changes[index][0] = dists[index] - distToStart;
-	//printf("vc %f %f\n", distance(end, projB, 3)-distance(start, projA, 3), changes[index][0]);
+	//printf("vc %f %f\n", distance(end, projB, 3) - distance(start, projA, 3), changes[index][0]);
 	/* horizontal change */
 	changes[index][1] = len_v3v3(projA, projB);
 }
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 6d2f3d5..1549c31 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -830,11 +830,11 @@ static int line_isect_y(const float p1[2], const float p2[2], const float y_leve
 	}
 
 	if (p1[1] > y_level && p2[1] < y_level) {
-		*x_isect = (p2[0] * (p1[1] - y_level) + p1[0] * (y_level - p2[1])) / y_diff;  /*(p1[1]-p2[1]);*/
+		*x_isect = (p2[0] * (p1[1] - y_level) + p1[0] * (y_level - p2[1])) / y_diff;  /* (p1[1] - p2[1]); */
 		return ISECT_TRUE;
 	}
 	else if (p1[1] < y_level && p2[1] > y_level) {
-		*x_isect = (p2[0] * (y_level - p1[1]) + p1[0] * (p2[1] - y_level)) / y_diff;  /*(p2[1]-p1[1]);*/
+		*x_isect = (p2[0] * (y_level - p1[1]) + p1[0] * (p2[1] - y_level)) / y_diff;  /* (p2[1] - p1[1]); */
 		return ISECT_TRUE;
 	}
 	else {
@@ -863,11 +863,11 @@ static int line_isect_x(const float p1[2], const float p2[2], const float x_leve
 	}
 
 	if (p1[0] > x_level && p2[0] < x_level) {
-		*y_isect = (p2[1] * (p1[0] - x_level) + p1[1] * (x_level - p2[0])) / x_diff; /*(p1[0]-p2[0]);*/
+		*y_isect = (p2[1] * (p1[0] - x_level) + p1[1] * (x_level - p2[0])) / x_diff;  /* (p1[0] - p2[0]); */
 		return ISECT_TRUE;
 	}
 	else if (p1[0] < x_level && p2[0] > x_level) {
-		*y_isect = (p2[1] * (x_level - p1[0]) + p1[1] * (p2[0] - x_level)) / x_diff; /*(p2[0]-p1[0]);*/
+		*y_isect = (p2[1] * (x_level - p1[0]) + p1[1] * (p2[0] - x_level)) / x_diff;  /* (p2[0] - p1[0]); */
 		return ISECT_TRUE;
 	}
 	else {
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 523584e..0821304 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -789,7 +789,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
 	else {
 		/* pop up panel - no previous, or user didn't want search after previous */
 		name[0] = '\0';
-// XXX		if (sbutton(name, 0, sizeof(name)-1, "Find: ") && name[0]) {
+// XXX		if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
 //			te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
 //		}
 //		else return; /* XXX RETURN! XXX */
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index dc212e5..7c43720 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -984,11 +984,11 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene)
 		return;
 	
 	BLI_strncpy(from, last_seq->strip->dir, sizeof(from));
-// XXX	if (0 == sbutton(from, 0, sizeof(from)-1, "From: "))
+// XXX	if (0 == sbutton(from, 0, sizeof(from) - 1, "From: "))
 //		return;
 	
 	BLI_strncpy(to, from, sizeof(to));
-// XXX	if (0 == sbutton(to, 0, sizeof(to)-1, "To: "))
+// XXX	if (0 == sbutton(to, 0, sizeof(to) - 1, "To: "))
 //		return;
 	
 	if (STREQ(to, from))
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 220cea2..5f35e53 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5593,22 +5593,22 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
 						UI_ThemeColorShadeAlpha(TH_WIRE, 0, -100);
 					glEnable(GL_BLEND);
 					glBegin(GL_LINES);
-					for (i = 1; i < res[0]-1; ++i) {
-						float f = interpf(b[0], a[0], (float)i / (float)(res[0]-1));
+					for (i = 1; i < res[0] - 1; ++i) {
+						float f = interpf(b[0], a[0], (float)i / (float)(res[0] - 1));
 						glVertex3f(f, a[1], a[2]); glVertex3f(f, b[1], a[2]);
 						glVertex3f(f, b[1], a[2]); glVertex3f(f, b[1], b[2]);
 						glVertex3f(f, b[1], b[2]); glVertex3f(f, a[1], b[2]);
 						glVertex3f(f, a[1], b[2]); glVertex3f(f, a[1], a[2]);
 					}
-					for (i = 1; i < res[1]-1; ++i) {
-						float f = interpf(b[1], a[1], (float)i / (float)(res[1]-1));
+					for (i = 1; i < res[1] - 1; ++i) {
+						float f = interpf(b[1], a[1], (float)i / (float)(res[1] - 1));
 						glVertex3f(a[0], f, a[2]); glVertex3f(b[0], f, a[2]);
 						glVertex3f(b[0], f, a[2]); glVertex3f(b[0], f, b[2]);
 						glVertex3f(b[0], f, b[2]); glVertex3f(a[0], f, b[2]);
 						glVertex3f(a[0], f, b[2]); glVertex3f(a[0], f, a[2]);
 					}
-					for (i = 1; i < res[2]-1; ++i) {
-						float f = interpf(b[2], a[2], (float)i / (float)(res[2]-1));
+					for (i = 1; i < res[2] - 1; ++i) {
+						float f = interpf(b[2], a[2], (float)i / (float)(res[2] - 1));
 						glVertex3f(a[0], a[1], f); glVertex3f(b[0], a[1], f);
 						glVertex3f(b[0], a[1], f); glVertex3f(b[0], b[1], f);
 						glVertex3f(b[0], b[1], f); glVertex3f(a[0], b[1], f);
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 8f07df5..68e268c 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -118,7 +118,7 @@ static char *gpu_str_skip_token(char *str, char *token, int max)
 		if (ELEM(*str, ' ', '(', ')', ',', '\t', '\n', '\r'))
 			break;
 		else {
-			if (token && len < max-1) {
+			if (token && len < max - 1) {
 				*token = *str;
 				token++;
 				len++;
@@ -238,7 +238,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
 			BLI_dynstr_appendf(ds, " param%d", a);
 #  endif
 
-			if (a != function->totparam-1)
+			if (a != function->totparam - 1)
 				BLI_dynstr_append(ds, ", ");
 		}
 		BLI_dynstr_append(ds, ");\n");




More information about the Bf-blender-cvs mailing list