Cycles: Cleanup, space after (void)
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 9 Nov 2018 11:08:51 +0000 (12:08 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 9 Nov 2018 11:08:51 +0000 (12:08 +0100)
It was used in like 95% of places.

24 files changed:
intern/cycles/blender/blender_shader.cpp
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_cuda.cpp
intern/cycles/device/opencl/opencl.h
intern/cycles/device/opencl/opencl_util.cpp
intern/cycles/kernel/bvh/bvh.h
intern/cycles/kernel/bvh/obvh_shadow_all.h
intern/cycles/kernel/bvh/obvh_traversal.h
intern/cycles/kernel/bvh/qbvh_shadow_all.h
intern/cycles/kernel/bvh/qbvh_traversal.h
intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h
intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/osl/osl_shader.cpp
intern/cycles/kernel/split/kernel_split_data.h
intern/cycles/render/mesh.cpp
intern/cycles/render/shader.cpp
intern/cycles/subd/subd_patch_table.cpp
intern/cycles/util/util_atomic.h
intern/cycles/util/util_defines.h
intern/cycles/util/util_guarded_allocator.h
intern/cycles/util/util_logging.h
intern/cycles/util/util_stack_allocator.h
intern/cycles/util/util_system.cpp

index 3eefb92..e33a6c2 100644 (file)
@@ -635,8 +635,8 @@ static ShaderNode *add_node(Scene *scene,
                        }
                }
 #else
-               (void)b_data;
-               (void)b_ntree;
+               (void) b_data;
+               (void) b_ntree;
 #endif
        }
        else if(b_node.is_a(&RNA_ShaderNodeTexImage)) {
index 9b37f47..76f6466 100644 (file)
@@ -81,11 +81,11 @@ public:
 
                /* Silence potential warnings about unused variables
                 * when compiling without some architectures. */
-               (void)kernel_sse2;
-               (void)kernel_sse3;
-               (void)kernel_sse41;
-               (void)kernel_avx;
-               (void)kernel_avx2;
+               (void) kernel_sse2;
+               (void) kernel_sse3;
+               (void) kernel_sse41;
+               (void) kernel_avx;
+               (void) kernel_avx2;
 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
                if(DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) {
                        architecture_name = "AVX2";
index d338a56..46e7b04 100644 (file)
@@ -211,7 +211,7 @@ public:
                        /*cuda_abort();*/ \
                        cuda_error_documentation(); \
                } \
-       } (void)0
+       } (void) 0
 
        bool cuda_error_(CUresult result, const string& stmt)
        {
@@ -2146,7 +2146,7 @@ public:
                        /*cuda_abort();*/ \
                        device->cuda_error_documentation(); \
                } \
-       } (void)0
+       } (void) 0
 
 
 /* CUDA context scope. */
@@ -2530,7 +2530,7 @@ string device_cuda_capabilities()
                                capabilities += string_printf("\t\tCU_DEVICE_ATTRIBUTE_" #attr "\t\t\t%d\n", \
                                                              value); \
                        } \
-               } (void)0
+               } (void) 0
                /* TODO(sergey): Strip all attributes which are not useful for us
                 * or does not depend on the driver.
                 */
index 6c73d10..8cb7f6d 100644 (file)
@@ -245,7 +245,7 @@ public:
                                (device)->set_error(message); \
                        fprintf(stderr, "%s\n", message.c_str()); \
                } \
-       } (void)0
+       } (void) 0
 
 #define opencl_assert(stmt) \
        { \
@@ -257,7 +257,7 @@ public:
                                error_msg = message; \
                        fprintf(stderr, "%s\n", message.c_str()); \
                } \
-       } (void)0
+       } (void) 0
 
 class OpenCLDeviceBase : public Device
 {
index 895e414..4c9f3cd 100644 (file)
@@ -106,7 +106,7 @@ cl_context OpenCLCache::get_context(cl_platform_id platform,
 
        cl_int ciErr = clRetainContext(slot.context);
        assert(ciErr == CL_SUCCESS);
-       (void)ciErr;
+       (void) ciErr;
 
        return slot.context;
 }
@@ -153,7 +153,7 @@ cl_program OpenCLCache::get_program(cl_platform_id platform,
 
        cl_int ciErr = clRetainProgram(entry.program);
        assert(ciErr == CL_SUCCESS);
-       (void)ciErr;
+       (void) ciErr;
 
        return entry.program;
 }
@@ -188,7 +188,7 @@ void OpenCLCache::store_context(cl_platform_id platform,
         * The caller is going to release the object when done with it. */
        cl_int ciErr = clRetainContext(context);
        assert(ciErr == CL_SUCCESS);
-       (void)ciErr;
+       (void) ciErr;
 }
 
 void OpenCLCache::store_program(cl_platform_id platform,
@@ -227,7 +227,7 @@ void OpenCLCache::store_program(cl_platform_id platform,
         */
        cl_int ciErr = clRetainProgram(program);
        assert(ciErr == CL_SUCCESS);
-       (void)ciErr;
+       (void) ciErr;
 }
 
 string OpenCLCache::get_kernel_md5()
index 57c850b..3646d6c 100644 (file)
@@ -281,7 +281,7 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
                                                                                                   ray.t,
                                                                                                   &ob_itfm);
                                /* bvh_instance_motion_push() returns the inverse transform but it's not needed here. */
-                               (void)ob_itfm;
+                               (void) ob_itfm;
 
                                rtc_ray.org_x = P.x;
                                rtc_ray.org_y = P.y;
index 6ea93c5..8b739b3 100644 (file)
@@ -97,7 +97,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
                        /* Traverse internal nodes. */
                        while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
                                float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
-                               (void)inodes;
+                               (void) inodes;
 
                                if(false
 #ifdef __VISIBILITY_FLAG__
index 5010983..6bb19eb 100644 (file)
@@ -97,7 +97,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
                        /* Traverse internal nodes. */
                        while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
                                float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
-                               (void)inodes;
+                               (void) inodes;
 
                                if(UNLIKELY(node_dist > isect->t)
 #if BVH_FEATURE(BVH_MOTION)
index 3610bdd..37606e1 100644 (file)
@@ -98,7 +98,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                        /* Traverse internal nodes. */
                        while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
                                float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
-                               (void)inodes;
+                               (void) inodes;
 
                                if(false
 #ifdef __VISIBILITY_FLAG__
index ff675ca..35c6e3a 100644 (file)
@@ -106,7 +106,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                        /* Traverse internal nodes. */
                        while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
                                float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
-                               (void)inodes;
+                               (void) inodes;
 
                                if(UNLIKELY(node_dist > isect->t)
 #if BVH_FEATURE(BVH_MOTION)
index 0a7b765..ae4fd85 100644 (file)
@@ -26,7 +26,7 @@ template<typename T> struct TextureInterpolator  {
                u[1] =  ((      0.5f * t - 1.0f) * t       ) * t + (2.0f/3.0f); \
                u[2] =  ((     -0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f/6.0f); \
                u[3] = (1.0f / 6.0f) * t * t * t; \
-       } (void)0
+       } (void) 0
 
        static ccl_always_inline float4 read(float4 r)
        {
index dd9d683..79af831 100644 (file)
@@ -142,7 +142,7 @@ ccl_device_inline float svm_image_texture_frac(float x, int *ix)
                u[1] =  ((      0.5f * t - 1.0f) * t       ) * t + (2.0f/3.0f); \
                u[2] =  ((     -0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f/6.0f); \
                u[3] = (1.0f / 6.0f) * t * t * t; \
-       } (void)0
+       } (void) 0
 
 ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y)
 {
index 81348f5..5a82748 100644 (file)
@@ -1053,7 +1053,7 @@ bool OSLRenderServices::texture(ustring filename,
                 * other nasty stuff happening.
                 */
                string err = ts->geterror();
-               (void)err;
+               (void) err;
        }
 
        return status;
@@ -1132,7 +1132,7 @@ bool OSLRenderServices::texture3d(ustring filename,
                 * other nasty stuff happening.
                 */
                string err = ts->geterror();
-               (void)err;
+               (void) err;
        }
 
        return status;
index 6a690e8..a89bb3f 100644 (file)
@@ -193,7 +193,7 @@ void OSLShader::eval_surface(KernelGlobals *kg, ShaderData *sd, PathState *state
                        float data[9];
                        bool found = kg->osl->services->get_attribute(sd, true, OSLRenderServices::u_empty, TypeDesc::TypeVector,
                                                                      OSLRenderServices::u_geom_undisplaced, data);
-                       (void)found;
+                       (void) found;
                        assert(found);
 
                        memcpy(&sd->P, data, sizeof(float)*3);
index 9297e1e..3f6b397 100644 (file)
@@ -24,7 +24,7 @@ CCL_NAMESPACE_BEGIN
 
 ccl_device_inline uint64_t split_data_buffer_size(KernelGlobals *kg, size_t num_elements)
 {
-       (void)kg;  /* Unused on CPU. */
+       (void) kg;  /* Unused on CPU. */
 
        uint64_t size = 0;
 #define SPLIT_DATA_ENTRY(type, name, num) + align_up(num_elements * num * sizeof(type), 16)
@@ -48,7 +48,7 @@ ccl_device_inline void split_data_init(KernelGlobals *kg,
                                        ccl_global void *data,
                                        ccl_global char *ray_state)
 {
-       (void)kg;  /* Unused on CPU. */
+       (void) kg;  /* Unused on CPU. */
 
        ccl_global char *p = (ccl_global char*)data;
 
index adc9a07..5f884a3 100644 (file)
@@ -1291,9 +1291,9 @@ void MeshManager::update_osl_attributes(Device *device, Scene *scene, vector<Att
                }
        }
 #else
-       (void)device;
-       (void)scene;
-       (void)mesh_attributes;
+       (void) device;
+       (void) scene;
+       (void) mesh_attributes;
 #endif
 }
 
@@ -2301,7 +2301,7 @@ void MeshManager::device_free(Device *device, DeviceScene *dscene)
                og->object_names.clear();
        }
 #else
-       (void)device;
+       (void) device;
 #endif
 }
 
index a827f61..d6c2d75 100644 (file)
@@ -388,7 +388,7 @@ ShaderManager *ShaderManager::create(Scene *scene, int shadingsystem)
 {
        ShaderManager *manager;
 
-       (void)shadingsystem;  /* Ignored when built without OSL. */
+       (void) shadingsystem;  /* Ignored when built without OSL. */
 
 #ifdef WITH_OSL
        if(shadingsystem == SHADINGSYSTEM_OSL) {
index 13a6f28..0e9d3f3 100644 (file)
@@ -252,8 +252,8 @@ void PackedPatchTable::pack(Far::PatchTable* patch_table, int offset)
 
        build_patch_map(*this, patch_table, offset);
 #else
-       (void)patch_table;
-       (void)offset;
+       (void) patch_table;
+       (void) offset;
 #endif
 }
 
index b139630..477b667 100644 (file)
@@ -29,7 +29,7 @@
 #define atomic_fetch_and_dec_uint32(p) atomic_fetch_and_add_uint32((p), -1)
 
 #define CCL_LOCAL_MEM_FENCE 0
-#define ccl_barrier(flags) (void)0
+#define ccl_barrier(flags) ((void) 0)
 
 #else  /* __KERNEL_GPU__ */
 
index 29eab4b..429cfe6 100644 (file)
@@ -72,7 +72,7 @@
 #  if defined(__GNUC__) && (__GNUC__ >= 7)  /* gcc7.0+ only */
 #    define ATTR_FALLTHROUGH __attribute__((fallthrough))
 #  else
-#    define ATTR_FALLTHROUGH ((void)0)
+#    define ATTR_FALLTHROUGH ((void) 0)
 #  endif
 #endif  /* __KERNEL_GPU__ */
 
@@ -104,14 +104,14 @@ template<typename T> static inline T decltype_helper(T x) { return x; }
 #define CHECK_TYPE(var, type)  {  \
        TYPEOF(var) *__tmp;           \
        __tmp = (type *)NULL;         \
-       (void)__tmp;                  \
-} (void)0
+       (void) __tmp;                 \
+} (void) 0
 
 #define CHECK_TYPE_PAIR(var_a, var_b)  {  \
        TYPEOF(var_a) *__tmp;                 \
        __tmp = (typeof(var_b) *)NULL;        \
-       (void)__tmp;                          \
-} (void)0
+       (void) __tmp;                          \
+} (void) 0
 #else
 #  define CHECK_TYPE(var, type)
 #  define CHECK_TYPE_PAIR(var_a, var_b)
index c02aed9..2c6f179 100644 (file)
@@ -47,7 +47,7 @@ public:
 
        T *allocate(size_t n, const void *hint = 0)
        {
-               (void)hint;
+               (void) hint;
                size_t size = n * sizeof(T);
                util_guarded_mem_alloc(size);
                if(n == 0) {
index 01a9b62..f66d7c9 100644 (file)
@@ -41,7 +41,7 @@ public:
        void operator&(StubStream&) { }
 };
 
-#  define LOG_SUPPRESS() (true) ? (void) 0 : LogMessageVoidify() & StubStream()
+#  define LOG_SUPPRESS() (true) ? ((void) 0) : LogMessageVoidify() & StubStream()
 #  define LOG(severity) LOG_SUPPRESS()
 #  define VLOG(severity) LOG_SUPPRESS()
 #endif
index 79a535b..6b52e73 100644 (file)
@@ -53,7 +53,7 @@ public:
 
        T *allocate(size_t n, const void *hint = 0)
        {
-               (void)hint;
+               (void) hint;
                if(n == 0) {
                        return NULL;
                }
index 1b03988..34f428f 100644 (file)
@@ -52,14 +52,14 @@ int system_cpu_group_thread_count(int group)
        util_windows_init_numa_groups();
        return GetActiveProcessorCount(group);
 #elif defined(__APPLE__)
-       (void)group;
+       (void) group;
        int count;
        size_t len = sizeof(count);
        int mib[2] = { CTL_HW, HW_NCPU };
        sysctl(mib, 2, &count, &len, NULL, 0);
        return count;
 #else
-       (void)group;
+       (void) group;
        return sysconf(_SC_NPROCESSORS_ONLN);
 #endif
 }