Cycles: Cleanup, whitespace around keywords
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 8 Oct 2015 14:08:28 +0000 (19:08 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 8 Oct 2015 14:08:28 +0000 (19:08 +0500)
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_shader.cpp
intern/cycles/blender/blender_texture.cpp
intern/cycles/device/device_opencl.cpp
intern/cycles/kernel/kernel_bake.h
intern/cycles/kernel/kernel_compat_cpu.h
intern/cycles/render/mesh_displace.cpp
intern/cycles/render/nodes.cpp
intern/cycles/render/svm.cpp
intern/cycles/render/tile.cpp

index 7135e938afb099ea139ed1c620eb1aa9029b0934..c2ccef548c77fe8c044cdaa41980e6fe3f6759a7 100644 (file)
@@ -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;
index a50c9ce9087e2936dd8e5358b55035fa0535ff1c..11bb18a888b658ec84e1f42bab912d2fca73302a 100644 (file)
@@ -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;
index a1e1c82be7b1e211f50d78cabb4609c0e76fb40e..18f66560b10fbd384f65333aa9dc98158a2db038 100644 (file)
@@ -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);
index a7157e2b041e31da5ef1f4eb6bfbe9afaaf0e8b1..7f16a73d966d2ea12c456db17afbc350f4587f73 100644 (file)
@@ -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);
index 2b305e5488d487469546ba2dc8b697d28367bc3a..0cb56461f299def7abfa8cbab506191230d58caf 100644 (file)
@@ -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:
                {
index 7908293589ac6a7dff8bcef95d881572c05730ed..04c4cf35587e2696d980bc75346d353a2e6e4192 100644 (file)
@@ -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);
                                        }
index 1ba0c7f729127936ce9923f276933a750e8919fd..801fffc774c81cb3015b5b82231044a561baf7d4 100644 (file)
@@ -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;
index fccb815f2fbec235b5f3bd1aac0ecece9820ef3c..bb76383c5cf85d0ff5e58b421ccddf5f9196efc0 100644 (file)
@@ -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;
index d0bd34915df7f1b332d1b7e94a8c37823d5995b6..e81b2f3a827b951bd870179c694d646f23716352 100644 (file)
@@ -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;
index 7e68ce84d944949d7b3440bdcd9f24984ee93736..1bec39431d87b249f2116b953e486b8566b946e8 100644 (file)
@@ -199,7 +199,7 @@ list<Tile>::iterator TileManager::next_background_tile(int device, TileOrder til
                        int64_t distx = cordx;
                        int64_t disty = cordy;
                        
-                       switch (tile_order) {
+                       switch(tile_order) {
                                case TILE_CENTER:
                                        distx = centx - (cur_tile.x + (cur_tile.w / 2));
                                        disty = centy - (cur_tile.y + (cur_tile.h / 2));