[Bf-blender-cvs] [350cf8e] master: Cycles: Cleanup, whitespace around keywords

Sergey Sharybin noreply at git.blender.org
Thu Oct 8 16:09:12 CEST 2015


Commit: 350cf8ea7fe1572e361e773ee4912707054035ff
Author: Sergey Sharybin
Date:   Thu Oct 8 19:08:28 2015 +0500
Branches: master
https://developer.blender.org/rB350cf8ea7fe1572e361e773ee4912707054035ff

Cycles: Cleanup, whitespace around keywords

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

M	intern/cycles/blender/blender_mesh.cpp
M	intern/cycles/blender/blender_shader.cpp
M	intern/cycles/blender/blender_texture.cpp
M	intern/cycles/device/device_opencl.cpp
M	intern/cycles/kernel/kernel_bake.h
M	intern/cycles/kernel/kernel_compat_cpu.h
M	intern/cycles/render/mesh_displace.cpp
M	intern/cycles/render/nodes.cpp
M	intern/cycles/render/svm.cpp
M	intern/cycles/render/tile.cpp

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

diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index 7135e93..c2ccef5 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -85,7 +85,7 @@ static void mikk_get_texture_coordinate(const SMikkTSpaceContext *context, float
 		BL::MeshTextureFace tf = userdata->layer->data[face_num];
 		float3 tfuv;
 
-		switch (vert_num) {
+		switch(vert_num) {
 			case 0:
 				tfuv = get_float3(tf.uv1());
 				break;
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index a50c9ce..11bb18a 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -88,7 +88,7 @@ static float3 get_node_output_vector(BL::Node b_node, const string& name)
 
 static ShaderSocketType convert_socket_type(BL::NodeSocket b_socket)
 {
-	switch (b_socket.type()) {
+	switch(b_socket.type()) {
 		case BL::NodeSocket::type_VALUE:
 			return SHADER_SOCKET_FLOAT;
 		case BL::NodeSocket::type_INT:
@@ -339,17 +339,16 @@ static ShaderNode *add_node(Scene *scene,
 		BL::ShaderNodeBsdfAnisotropic b_aniso_node(b_node);
 		AnisotropicBsdfNode *aniso = new AnisotropicBsdfNode();
 
-		switch (b_aniso_node.distribution())
-		{
-		case BL::ShaderNodeBsdfAnisotropic::distribution_BECKMANN:
-			aniso->distribution = ustring("Beckmann");
-			break;
-		case BL::ShaderNodeBsdfAnisotropic::distribution_GGX:
-			aniso->distribution = ustring("GGX");
-			break;
-		case BL::ShaderNodeBsdfAnisotropic::distribution_ASHIKHMIN_SHIRLEY:
-			aniso->distribution = ustring("Ashikhmin-Shirley");
-			break;
+		switch(b_aniso_node.distribution()) {
+			case BL::ShaderNodeBsdfAnisotropic::distribution_BECKMANN:
+				aniso->distribution = ustring("Beckmann");
+				break;
+			case BL::ShaderNodeBsdfAnisotropic::distribution_GGX:
+				aniso->distribution = ustring("GGX");
+				break;
+			case BL::ShaderNodeBsdfAnisotropic::distribution_ASHIKHMIN_SHIRLEY:
+				aniso->distribution = ustring("Ashikhmin-Shirley");
+				break;
 		}
 
 		node = aniso;
diff --git a/intern/cycles/blender/blender_texture.cpp b/intern/cycles/blender/blender_texture.cpp
index a1e1c82..18f6656 100644
--- a/intern/cycles/blender/blender_texture.cpp
+++ b/intern/cycles/blender/blender_texture.cpp
@@ -68,7 +68,7 @@ static void density_particle_system_texture_space(
 	float3 particle_size = make_float3(radius, radius, radius);
 	for(int i = 0; i < b_particle_system.particles.length(); ++i) {
 		BL::Particle particle = b_particle_system.particles[i];
-		if (particle.alive_state() == BL::Particle::alive_state_ALIVE) {
+		if(particle.alive_state() == BL::Particle::alive_state_ALIVE) {
 			float3 location = get_float3(particle.location());
 			location = transform_point(&itfm, location);
 			min = ccl::min(min, location - particle_size);
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index a7157e2..7f16a73 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -581,7 +581,7 @@ public:
 	                          ProgramName program_name,
 	                          thread_scoped_lock& slot_locker)
 	{
-		switch (program_name) {
+		switch(program_name) {
 			case OCL_DEV_BASE_PROGRAM:
 				store_something<cl_program>(platform,
 				                            device,
@@ -3690,7 +3690,7 @@ string device_opencl_capabilities(void)
 	APPEND_STRING_INFO(clGetDeviceInfo, id, "\t\t\tDevice " name, what)
 
 	vector<cl_device_id> device_ids;
-	for (cl_uint platform = 0; platform < num_platforms; ++platform) {
+	for(cl_uint platform = 0; platform < num_platforms; ++platform) {
 		cl_platform_id platform_id = platform_ids[platform];
 
 		result += string_printf("Platform #%u\n", platform);
@@ -3715,7 +3715,7 @@ string device_opencl_capabilities(void)
 		                             num_devices,
 		                             &device_ids[0],
 		                             NULL));
-		for (cl_uint device = 0; device < num_devices; ++device) {
+		for(cl_uint device = 0; device < num_devices; ++device) {
 			cl_device_id device_id = device_ids[device];
 
 			result += string_printf("\t\tDevice: #%u\n", device);
diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h
index 2b305e5..0cb5646 100644
--- a/intern/cycles/kernel/kernel_bake.h
+++ b/intern/cycles/kernel/kernel_bake.h
@@ -150,7 +150,7 @@ ccl_device bool is_aa_pass(ShaderEvalType type)
 
 ccl_device bool is_light_pass(ShaderEvalType type)
 {
-	switch (type) {
+	switch(type) {
 		case SHADER_EVAL_AO:
 		case SHADER_EVAL_COMBINED:
 		case SHADER_EVAL_SHADOW:
@@ -262,7 +262,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
 		                   sample);
 	}
 
-	switch (type) {
+	switch(type) {
 		/* data passes */
 		case SHADER_EVAL_NORMAL:
 		{
diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h
index 7908293..04c4cf3 100644
--- a/intern/cycles/kernel/kernel_compat_cpu.h
+++ b/intern/cycles/kernel/kernel_compat_cpu.h
@@ -144,7 +144,7 @@ template<typename T> struct texture_image  {
 					iy = wrap_periodic(iy, height);
 					break;
 				case EXTENSION_CLIP:
-					if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
+					if(x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
 						return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 					}
 					/* Fall through. */
@@ -168,7 +168,7 @@ template<typename T> struct texture_image  {
 					niy = wrap_periodic(iy+1, height);
 					break;
 				case EXTENSION_CLIP:
-					if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
+					if(x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
 						return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 					}
 					/* Fall through. */
@@ -208,7 +208,7 @@ template<typename T> struct texture_image  {
 					nniy = wrap_periodic(iy+2, height);
 					break;
 				case EXTENSION_CLIP:
-					if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
+					if(x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
 						return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 					}
 					/* Fall through. */
@@ -279,8 +279,8 @@ template<typename T> struct texture_image  {
 					iz = wrap_periodic(iz, depth);
 					break;
 				case EXTENSION_CLIP:
-					if (x < 0.0f || y < 0.0f || z < 0.0f ||
-					    x > 1.0f || y > 1.0f || z > 1.0f)
+					if(x < 0.0f || y < 0.0f || z < 0.0f ||
+					   x > 1.0f || y > 1.0f || z > 1.0f)
 					{
 						return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 					}
@@ -310,8 +310,8 @@ template<typename T> struct texture_image  {
 					niz = wrap_periodic(iz+1, depth);
 					break;
 				case EXTENSION_CLIP:
-					if (x < 0.0f || y < 0.0f || z < 0.0f ||
-					    x > 1.0f || y > 1.0f || z > 1.0f)
+					if(x < 0.0f || y < 0.0f || z < 0.0f ||
+					   x > 1.0f || y > 1.0f || z > 1.0f)
 					{
 						return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 					}
@@ -367,8 +367,8 @@ template<typename T> struct texture_image  {
 					nniz = wrap_periodic(iz+2, depth);
 					break;
 				case EXTENSION_CLIP:
-					if (x < 0.0f || y < 0.0f || z < 0.0f ||
-					    x > 1.0f || y > 1.0f || z > 1.0f)
+					if(x < 0.0f || y < 0.0f || z < 0.0f ||
+					   x > 1.0f || y > 1.0f || z > 1.0f)
 					{
 						return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 					}
diff --git a/intern/cycles/render/mesh_displace.cpp b/intern/cycles/render/mesh_displace.cpp
index 1ba0c7f..801fffc 100644
--- a/intern/cycles/render/mesh_displace.cpp
+++ b/intern/cycles/render/mesh_displace.cpp
@@ -78,7 +78,7 @@ bool MeshManager::displace(Device *device, DeviceScene *dscene, Scene *scene, Me
 			int prim = mesh->tri_offset + i;
 			float u, v;
 			
-			switch (j) {
+			switch(j) {
 				case 0:
 					u = 1.0f;
 					v = 0.0f;
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index fccb815..bb76383 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -184,7 +184,7 @@ static ShaderEnum image_projection_init()
 
 static const char* get_osl_interpolation_parameter(InterpolationType interpolation)
 {
-	switch (interpolation) {
+	switch(interpolation) {
 		case INTERPOLATION_CLOSEST:
 			return "closest";
 		case INTERPOLATION_CUBIC:
@@ -1417,10 +1417,10 @@ void PointDensityTextureNode::compile(SVMCompiler& compiler)
 
 	image_manager = compiler.image_manager;
 
-	if (use_density || use_color) {
-		if (use_density)
+	if(use_density || use_color) {
+		if(use_density)
 			compiler.stack_assign(density_out);
-		if (use_color)
+		if(use_color)
 			compiler.stack_assign(color_out);
 
 		if(slot == -1) {
@@ -1470,7 +1470,7 @@ void PointDensityTextureNode::compile(OSLCompiler& compiler)
 
 	image_manager = compiler.image_manager;
 
-	if (use_density || use_color) {
+	if(use_density || use_color) {
 		if(slot == -1) {
 			bool is_float, is_linear;
 			slot = image_manager->add_image(filename, builtin_data,
@@ -1488,7 +1488,7 @@ void PointDensityTextureNode::compile(OSLCompiler& compiler)
 			compiler.parameter("mapping", transform_transpose(tfm));
 			compiler.parameter("use_mapping", 1);
 		}
-		switch (interpolation) {
+		switch(interpolation) {
 			case INTERPOLATION_CLOSEST:
 				compiler.parameter("interpolation", "closest");
 				break;
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index d0bd349..e81b2f3 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -121,7 +121,7 @@ int SVMCompiler::stack_size(ShaderSocketType type)
 {
 	int size = 0;
 	
-	switch (type) {
+	switch(type) {
 		case SHADER_SOCKET_FLOAT:
 		case SHADER_SOCKET_INT:
 			size = 1;
@@ -624,7 +624,7 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty
 	ShaderNode *node = graph->output();
 	ShaderInput *clin = NULL;
 	
-	switch (type) {
+	switch(type) {
 		case SHADER_TYPE_SURFACE:
 			clin = node->input("Surface");
 			break;
@@ -654,7 +654,7 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty
 		if(clin->link) {
 			bool generate = false;
 			
-			switch (type) {
+			switch(type) {
 				case SHADER_TYPE_SURFACE: /* generate surface shader */		
 					generate = true;
 					shader->has_surface = true;
diff --git a/intern/cycles/render

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list