[Bf-blender-cvs] [108045faa01] master: ClangFormat: format '#if 0' code in intern/

Campbell Barton noreply at git.blender.org
Wed Apr 17 08:19:04 CEST 2019


Commit: 108045faa01849115c54190ebed788faf36dcb56
Author: Campbell Barton
Date:   Wed Apr 17 08:16:53 2019 +0200
Branches: master
https://developer.blender.org/rB108045faa01849115c54190ebed788faf36dcb56

ClangFormat: format '#if 0' code in intern/

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

M	intern/cycles/app/cycles_xml.cpp
M	intern/cycles/blender/blender_object.cpp
M	intern/cycles/blender/blender_shader.cpp
M	intern/cycles/blender/blender_util.h
M	intern/cycles/device/device_cuda.cpp
M	intern/cycles/kernel/osl/osl_services.cpp
M	intern/cycles/kernel/shaders/stdosl.h
M	intern/cycles/render/camera.cpp
M	intern/cycles/render/nodes.cpp
M	intern/cycles/util/util_math.h
M	intern/cycles/util/util_transform.h
M	intern/ghost/intern/GHOST_SystemSDL.cpp
M	intern/ghost/intern/GHOST_SystemWin32.cpp
M	intern/ghost/test/gears/GHOST_Test.cpp
M	intern/guardedalloc/MEM_guardedalloc.h
M	intern/guardedalloc/intern/mallocn_guarded_impl.c
M	intern/iksolver/intern/IK_Solver.cpp
M	intern/mikktspace/mikktspace.c
M	intern/string/intern/STR_String.cpp
M	intern/utfconv/utfconv.c

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

diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index 9caf7068d3d..1dbe8a30ff2 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -495,7 +495,7 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node)
       float3 *fdata = attr->data_float3();
 
 #if 0
-      if(subdivide_uvs) {
+      if (subdivide_uvs) {
         attr->flags |= ATTR_SUBDIVIDED;
       }
 #endif
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 095ecd59985..00f53804e38 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -307,8 +307,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
     /* TODO: don't use lights for excluded layers used as mask layer,
      * when dynamic overrides are back. */
 #if 0
-    if(!((layer_flag & view_layer.holdout_layer) &&
-         (layer_flag & view_layer.exclude_layer)))
+    if (!((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer)))
 #endif
     {
       sync_light(b_parent,
@@ -345,7 +344,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
 
   /* TODO: make holdout objects on excluded layer invisible for non-camera rays. */
 #if 0
-  if(use_holdout && (layer_flag & view_layer.exclude_layer)) {
+  if (use_holdout && (layer_flag & view_layer.exclude_layer)) {
     visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
   }
 #endif
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 169c4d414a6..5fd60ff7970 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -656,13 +656,12 @@ static ShaderNode *add_node(Scene *scene,
       /* TODO: restore */
       /* TODO(sergey): Does not work properly when we change builtin type. */
 #if 0
-      if(b_image.is_updated()) {
-        scene->image_manager->tag_reload_image(
-                image->filename.string(),
-                image->builtin_data,
-                get_image_interpolation(b_image_node),
-                get_image_extension(b_image_node),
-                image->use_alpha);
+      if (b_image.is_updated()) {
+        scene->image_manager->tag_reload_image(image->filename.string(),
+                                               image->builtin_data,
+                                               get_image_interpolation(b_image_node),
+                                               get_image_extension(b_image_node),
+                                               image->use_alpha);
       }
 #endif
     }
@@ -702,13 +701,12 @@ static ShaderNode *add_node(Scene *scene,
       /* TODO: restore */
       /* TODO(sergey): Does not work properly when we change builtin type. */
 #if 0
-      if(b_image.is_updated()) {
-        scene->image_manager->tag_reload_image(
-                env->filename.string(),
-                env->builtin_data,
-                get_image_interpolation(b_env_node),
-                EXTENSION_REPEAT,
-                env->use_alpha);
+      if (b_image.is_updated()) {
+        scene->image_manager->tag_reload_image(env->filename.string(),
+                                               env->builtin_data,
+                                               get_image_interpolation(b_env_node),
+                                               EXTENSION_REPEAT,
+                                               env->use_alpha);
       }
 #endif
     }
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index e68f92474bf..500634e7526 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -54,8 +54,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData &data,
   bool subsurf_mod_show_render = false;
   bool subsurf_mod_show_viewport = false;
 
-  if(subdivision_type != Mesh::SUBDIVISION_NONE) {
-    BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];
+  if (subdivision_type != Mesh::SUBDIVISION_NONE) {
+    BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1];
 
     subsurf_mod_show_render = subsurf_mod.show_render();
     subsurf_mod_show_viewport = subsurf_mod.show_viewport();
@@ -83,8 +83,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData &data,
   }
 
 #if 0
-  if(subdivision_type != Mesh::SUBDIVISION_NONE) {
-    BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];
+  if (subdivision_type != Mesh::SUBDIVISION_NONE) {
+    BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1];
 
     subsurf_mod.show_render(subsurf_mod_show_render);
     subsurf_mod.show_viewport(subsurf_mod_show_viewport);
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 68bc3bd4045..936e1dccfa6 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -653,7 +653,7 @@ class CUDADevice : public Device {
     /* For testing mapped host memory, fill up device memory. */
     const size_t keep_mb = 1024;
 
-    while(free_after > keep_mb * 1024 * 1024LL) {
+    while (free_after > keep_mb * 1024 * 1024LL) {
       CUdeviceptr tmp;
       cuda_assert(cuMemAlloc(&tmp, 10 * 1024 * 1024LL));
       cuMemGetInfo(&free_after, &total);
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
index eb9f672fd8a..0257e18c3e8 100644
--- a/intern/cycles/kernel/osl/osl_services.cpp
+++ b/intern/cycles/kernel/osl/osl_services.cpp
@@ -733,7 +733,7 @@ bool OSLRenderServices::get_object_standard_attribute(
     return set_attribute_float3(f, type, derivatives, val);
   }
 #if 0 /* unsupported */
-  else if(name == u_particle_rotation) {
+  else if (name == u_particle_rotation) {
     int particle_id = object_particle_id(kg, sd->object);
     float4 f = particle_rotation(kg, particle_id);
     return set_attribute_float4(f, type, derivatives, val);
diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h
index 9b9720ffff9..2762b414ce4 100644
--- a/intern/cycles/kernel/shaders/stdosl.h
+++ b/intern/cycles/kernel/shaders/stdosl.h
@@ -235,15 +235,42 @@ int clamp(int x, int minval, int maxval)
   return max(min(x, maxval), minval);
 }
 #if 0
-normal mix (normal x, normal y, normal a) { return x*(1-a) + y*a; }
-normal mix (normal x, normal y, float  a) { return x*(1-a) + y*a; }
-vector mix (vector x, vector y, vector a) { return x*(1-a) + y*a; }
-vector mix (vector x, vector y, float  a) { return x*(1-a) + y*a; }
-point  mix (point  x, point  y, point  a) { return x*(1-a) + y*a; }
-point  mix (point  x, point  y, float  a) { return x*(1-a) + y*a; }
-color  mix (color  x, color  y, color  a) { return x*(1-a) + y*a; }
-color  mix (color  x, color  y, float  a) { return x*(1-a) + y*a; }
-float  mix (float  x, float  y, float  a) { return x*(1-a) + y*a; }
+normal mix(normal x, normal y, normal a)
+{
+  return x * (1 - a) + y * a;
+}
+normal mix(normal x, normal y, float a)
+{
+  return x * (1 - a) + y * a;
+}
+vector mix(vector x, vector y, vector a)
+{
+  return x * (1 - a) + y * a;
+}
+vector mix(vector x, vector y, float a)
+{
+  return x * (1 - a) + y * a;
+}
+point mix(point x, point y, point a)
+{
+  return x * (1 - a) + y * a;
+}
+point mix(point x, point y, float a)
+{
+  return x * (1 - a) + y * a;
+}
+color mix(color x, color y, color a)
+{
+  return x * (1 - a) + y * a;
+}
+color mix(color x, color y, float a)
+{
+  return x * (1 - a) + y * a;
+}
+float mix(float x, float y, float a)
+{
+  return x * (1 - a) + y * a;
+}
 #else
 normal mix(normal x, normal y, normal a) BUILTIN;
 normal mix(normal x, normal y, float a) BUILTIN;
@@ -369,7 +396,7 @@ point rotate(point p, float angle, point a, point b)
      * anisotropic shader where angle is usually constant.
      */
 #if 0
-    sincos (angle, sinang, cosang);
+  sincos(angle, sinang, cosang);
 #else
   sinang = sin(angle);
   cosang = cos(angle);
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp
index 9c9070c8a90..a950324d4d4 100644
--- a/intern/cycles/render/camera.cpp
+++ b/intern/cycles/render/camera.cpp
@@ -716,10 +716,17 @@ float Camera::world_to_raster_size(float3 P)
     float3 raster = transform_perspective(&full_cameratoraster, make_float3(dir.x, dir.y, 0.0f));
 
     ray.t = 1.0f;
-    camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray);
-    if(ray.t == 0.0f) {
+    camera_sample_panorama(
+        &kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray);
+    if (ray.t == 0.0f) {
       /* No differentials, just use from directly ahead. */
-      camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), 0.5f*full_width, 0.5f*full_height, 0.0f, 0.0f, &ray);
+      camera_sample_panorama(&kernel_camera,
+                             kernel_camera_motion.data(),
+                             0.5f * full_width,
+                             0.5f * full_height,
+                             0.0f,
+                             0.0f,
+                             &ray);
     }
 #else
     camera_sample_panorama(&kernel_camera,
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index f3572ee1585..30968ab0c5e 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -3888,7 +3888,7 @@ void ParticleInfoNode::attributes(Shader *shader, AttributeRequestSet *attribute
   if (!output("Location")->links.empty())
     attributes->add(ATTR_STD_PARTICLE);
 #if 0 /* not yet supported */
-  if(!output("Rotation")->links.empty())
+  if (!output("Rotation")->links.empty())
     attributes->add(ATTR_STD_PARTICLE);
 #endif
   if (!output("Size")->links.empty())
@@ -3933,7 +3933,7 @@ void ParticleInfoNode::compile(SVMCompiler &compiler)
   /* quaternion data is not yet supported by Cycles */
 #if 0
   out = output("Rotation");
-  if(!out->links.empty()) {
+  if (!out->links.empty()) {
     compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ROTATION, compiler.stack_assign(out));
   }
 #endif
diff --git a/intern/cycles/util/util_math.h b/intern

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list