[Bf-blender-cvs] [9dc5367] master: Cleanup code style inconsistency in last commits.

Brecht Van Lommel noreply at git.blender.org
Tue May 17 23:44:46 CEST 2016


Commit: 9dc5367c89f467e516620b6ff15e2eb35b26fdee
Author: Brecht Van Lommel
Date:   Tue May 17 22:08:34 2016 +0200
Branches: master
https://developer.blender.org/rB9dc5367c89f467e516620b6ff15e2eb35b26fdee

Cleanup code style inconsistency in last commits.

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

M	intern/cycles/bvh/bvh_build.cpp
M	intern/cycles/bvh/bvh_sort.cpp
M	intern/cycles/render/graph.cpp
M	intern/cycles/render/nodes.cpp
M	intern/cycles/util/util_vector.h

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

diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index 6af4d25..76a1bfa 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -631,7 +631,7 @@ BVHNode* BVHBuild::create_leaf_node(const BVHRange& range,
 
 			bounds[type_index].grow(ref.bounds());
 			visibility[type_index] |= objects[ref.prim_object()]->visibility;
-			if (ref.prim_type() & PRIMITIVE_ALL_CURVE) {
+			if(ref.prim_type() & PRIMITIVE_ALL_CURVE) {
 				visibility[type_index] |= PATH_RAY_CURVE;
 			}
 			++num_new_prims;
diff --git a/intern/cycles/bvh/bvh_sort.cpp b/intern/cycles/bvh/bvh_sort.cpp
index f6bbdb2..e9032c6 100644
--- a/intern/cycles/bvh/bvh_sort.cpp
+++ b/intern/cycles/bvh/bvh_sort.cpp
@@ -125,7 +125,7 @@ static void bvh_reference_sort_threaded(TaskPool *task_pool,
 		if(compare.compare(data[left], data[right]) > 0) {
 			swap(data[left], data[right]);
 		}
-		if (compare.compare(data[center], data[right]) > 0) {
+		if(compare.compare(data[center], data[right]) > 0) {
 			swap(data[center], data[right]);
 		}
 		swap(data[center], data[right - 1]);
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 920f5c7..15c89cc 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -507,7 +507,7 @@ void ShaderGraph::constant_fold()
 		traverse_queue.pop();
 		done.insert(node);
 		foreach(ShaderOutput *output, node->outputs) {
-			if (output->links.size() == 0) {
+			if(output->links.size() == 0) {
 				continue;
 			}
 			/* Schedule node which was depending on the value,
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 1eb0365..194723e 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1379,7 +1379,7 @@ void PointDensityTextureNode::compile(SVMCompiler& compiler)
 								  __float_as_int(0.0f),
 								  compiler.stack_assign(density_out));
 			}
-			if (use_color) {
+			if(use_color) {
 				compiler.add_node(NODE_VALUE_V, compiler.stack_assign(color_out));
 				compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R,
 															TEX_IMAGE_MISSING_G,
@@ -3351,7 +3351,7 @@ bool MixNode::constant_fold(ShaderGraph *graph, ShaderOutput * /*socket*/, float
 	if(!fac_in->link) {
 		/* factor 0.0 */
 		if(fac_in->value.x == 0.0f) {
-			if (color1_in->link)
+			if(color1_in->link)
 				graph->relink(this, color_out, color1_in->link);
 			else
 				*optimized_value = color1_in->value;
@@ -3359,7 +3359,7 @@ bool MixNode::constant_fold(ShaderGraph *graph, ShaderOutput * /*socket*/, float
 		}
 		/* factor 1.0 */
 		else if(fac_in->value.x == 1.0f) {
-			if (color2_in->link)
+			if(color2_in->link)
 				graph->relink(this, color_out, color2_in->link);
 			else
 				*optimized_value = color2_in->value;
@@ -4322,7 +4322,7 @@ RGBCurvesNode::RGBCurvesNode()
 
 void RGBCurvesNode::compile(SVMCompiler& compiler)
 {
-	if (curves.size() == 0)
+	if(curves.size() == 0)
 		return;
 
 	ShaderInput *fac_in = input("Fac");
@@ -4343,7 +4343,7 @@ void RGBCurvesNode::compile(SVMCompiler& compiler)
 
 void RGBCurvesNode::compile(OSLCompiler& compiler)
 {
-	if (curves.size() == 0)
+	if(curves.size() == 0)
 		return;
 
 	compiler.parameter_color_array("ramp", curves);
@@ -4367,7 +4367,7 @@ VectorCurvesNode::VectorCurvesNode()
 
 void VectorCurvesNode::compile(SVMCompiler& compiler)
 {
-	if (curves.size() == 0)
+	if(curves.size() == 0)
 		return;
 
 	ShaderInput *fac_in = input("Fac");
@@ -4388,7 +4388,7 @@ void VectorCurvesNode::compile(SVMCompiler& compiler)
 
 void VectorCurvesNode::compile(OSLCompiler& compiler)
 {
-	if (curves.size() == 0)
+	if(curves.size() == 0)
 		return;
 
 	compiler.parameter_color_array("ramp", curves);
@@ -4411,7 +4411,7 @@ RGBRampNode::RGBRampNode()
 
 void RGBRampNode::compile(SVMCompiler& compiler)
 {
-	if (ramp.size() == 0 || ramp.size() != ramp_alpha.size())
+	if(ramp.size() == 0 || ramp.size() != ramp_alpha.size())
 		return;
 
 	ShaderInput *fac_in = input("Fac");
@@ -4432,7 +4432,7 @@ void RGBRampNode::compile(SVMCompiler& compiler)
 
 void RGBRampNode::compile(OSLCompiler& compiler)
 {
-	if (ramp.size() == 0 || ramp.size() != ramp_alpha.size())
+	if(ramp.size() == 0 || ramp.size() != ramp_alpha.size())
 		return;
 
 	compiler.parameter_color_array("ramp_color", ramp);
diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h
index 292a3ac..a8a1c4c 100644
--- a/intern/cycles/util/util_vector.h
+++ b/intern/cycles/util/util_vector.h
@@ -164,7 +164,7 @@ public:
 
 	bool operator==(const vector<T>& other)
 	{
-		if (datasize_ != other.datasize_)
+		if(datasize_ != other.datasize_)
 			return false;
 
 		return memcmp(data_, other.data_, datasize_*sizeof(T)) == 0;
@@ -172,7 +172,7 @@ public:
 
 	void steal_data(array& from)
 	{
-		if (this != &from)
+		if(this != &from)
 		{
 			clear();
 
@@ -256,7 +256,7 @@ public:
 	// do not use this method unless you are sure the code is not performance critical
 	void push_back_slow(const T& t)
 	{
-		if (capacity_ == datasize_)
+		if(capacity_ == datasize_)
 		{
 			reserve(datasize_ == 0 ? 1 : (size_t)((datasize_ + 1) * 1.2));
 		}




More information about the Bf-blender-cvs mailing list