Cleanup code style inconsistency in last commits.

This commit is contained in:
Brecht Van Lommel
2016-05-17 22:08:34 +02:00
parent 2630207ada
commit 9dc5367c89
5 changed files with 15 additions and 15 deletions

View File

@@ -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;

View File

@@ -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]);

View File

@@ -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,

View File

@@ -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);

View File

@@ -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));
}