From 203de0bbf05ed3952d1ee6c67cfc2d3de978b8e2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 9 Nov 2018 12:08:51 +0100 Subject: Cycles: Cleanup, space after (void) It was used in like 95% of places. --- intern/cycles/blender/blender_shader.cpp | 4 ++-- intern/cycles/device/device_cpu.cpp | 10 +++++----- intern/cycles/device/device_cuda.cpp | 6 +++--- intern/cycles/device/opencl/opencl.h | 4 ++-- intern/cycles/device/opencl/opencl_util.cpp | 8 ++++---- intern/cycles/kernel/bvh/bvh.h | 2 +- intern/cycles/kernel/bvh/obvh_shadow_all.h | 2 +- intern/cycles/kernel/bvh/obvh_traversal.h | 2 +- intern/cycles/kernel/bvh/qbvh_shadow_all.h | 2 +- intern/cycles/kernel/bvh/qbvh_traversal.h | 2 +- intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h | 2 +- intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h | 2 +- intern/cycles/kernel/osl/osl_services.cpp | 4 ++-- intern/cycles/kernel/osl/osl_shader.cpp | 2 +- intern/cycles/kernel/split/kernel_split_data.h | 4 ++-- intern/cycles/render/mesh.cpp | 8 ++++---- intern/cycles/render/shader.cpp | 2 +- intern/cycles/subd/subd_patch_table.cpp | 4 ++-- intern/cycles/util/util_atomic.h | 2 +- intern/cycles/util/util_defines.h | 10 +++++----- intern/cycles/util/util_guarded_allocator.h | 2 +- intern/cycles/util/util_logging.h | 2 +- intern/cycles/util/util_stack_allocator.h | 2 +- intern/cycles/util/util_system.cpp | 4 ++-- 24 files changed, 46 insertions(+), 46 deletions(-) diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 3eefb92f6af..e33a6c20a52 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -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)) { diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 9b37f4773bb..76f6466bbde 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -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"; diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index d338a565a02..46e7b043603 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -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. */ diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h index 6c73d10a376..8cb7f6d0b82 100644 --- a/intern/cycles/device/opencl/opencl.h +++ b/intern/cycles/device/opencl/opencl.h @@ -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 { diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp index 895e4149a3a..4c9f3cd6ef7 100644 --- a/intern/cycles/device/opencl/opencl_util.cpp +++ b/intern/cycles/device/opencl/opencl_util.cpp @@ -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() diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h index 57c850b8ef8..3646d6c70d0 100644 --- a/intern/cycles/kernel/bvh/bvh.h +++ b/intern/cycles/kernel/bvh/bvh.h @@ -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; diff --git a/intern/cycles/kernel/bvh/obvh_shadow_all.h b/intern/cycles/kernel/bvh/obvh_shadow_all.h index 6ea93c5e7b2..8b739b3438a 100644 --- a/intern/cycles/kernel/bvh/obvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/obvh_shadow_all.h @@ -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__ diff --git a/intern/cycles/kernel/bvh/obvh_traversal.h b/intern/cycles/kernel/bvh/obvh_traversal.h index 5010983057d..6bb19eb1ed9 100644 --- a/intern/cycles/kernel/bvh/obvh_traversal.h +++ b/intern/cycles/kernel/bvh/obvh_traversal.h @@ -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) diff --git a/intern/cycles/kernel/bvh/qbvh_shadow_all.h b/intern/cycles/kernel/bvh/qbvh_shadow_all.h index 3610bdd560b..37606e10b92 100644 --- a/intern/cycles/kernel/bvh/qbvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/qbvh_shadow_all.h @@ -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__ diff --git a/intern/cycles/kernel/bvh/qbvh_traversal.h b/intern/cycles/kernel/bvh/qbvh_traversal.h index ff675cab76b..35c6e3aeec9 100644 --- a/intern/cycles/kernel/bvh/qbvh_traversal.h +++ b/intern/cycles/kernel/bvh/qbvh_traversal.h @@ -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) diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h index 0a7b765c3a2..ae4fd85780d 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h @@ -26,7 +26,7 @@ template 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) { diff --git a/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h b/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h index dd9d683e030..79af831c2fb 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h +++ b/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h @@ -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) { diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index 81348f5594d..5a82748f345 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -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; diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index 6a690e880ad..a89bb3fd1a3 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -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); diff --git a/intern/cycles/kernel/split/kernel_split_data.h b/intern/cycles/kernel/split/kernel_split_data.h index 9297e1e0ad5..3f6b3977d79 100644 --- a/intern/cycles/kernel/split/kernel_split_data.h +++ b/intern/cycles/kernel/split/kernel_split_data.h @@ -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; diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index adc9a076fa4..5f884a3f871 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -1291,9 +1291,9 @@ void MeshManager::update_osl_attributes(Device *device, Scene *scene, vectorobject_names.clear(); } #else - (void)device; + (void) device; #endif } diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index a827f611583..d6c2d7502f2 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -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) { diff --git a/intern/cycles/subd/subd_patch_table.cpp b/intern/cycles/subd/subd_patch_table.cpp index 13a6f284542..0e9d3f37af4 100644 --- a/intern/cycles/subd/subd_patch_table.cpp +++ b/intern/cycles/subd/subd_patch_table.cpp @@ -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 } diff --git a/intern/cycles/util/util_atomic.h b/intern/cycles/util/util_atomic.h index b1396300329..477b667a6fe 100644 --- a/intern/cycles/util/util_atomic.h +++ b/intern/cycles/util/util_atomic.h @@ -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__ */ diff --git a/intern/cycles/util/util_defines.h b/intern/cycles/util/util_defines.h index 29eab4bbc6a..429cfe647ef 100644 --- a/intern/cycles/util/util_defines.h +++ b/intern/cycles/util/util_defines.h @@ -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 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) diff --git a/intern/cycles/util/util_guarded_allocator.h b/intern/cycles/util/util_guarded_allocator.h index c02aed93aa2..2c6f1790fd0 100644 --- a/intern/cycles/util/util_guarded_allocator.h +++ b/intern/cycles/util/util_guarded_allocator.h @@ -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) { diff --git a/intern/cycles/util/util_logging.h b/intern/cycles/util/util_logging.h index 01a9b62ad93..f66d7c92dcc 100644 --- a/intern/cycles/util/util_logging.h +++ b/intern/cycles/util/util_logging.h @@ -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 diff --git a/intern/cycles/util/util_stack_allocator.h b/intern/cycles/util/util_stack_allocator.h index 79a535bd170..6b52e73ee4e 100644 --- a/intern/cycles/util/util_stack_allocator.h +++ b/intern/cycles/util/util_stack_allocator.h @@ -53,7 +53,7 @@ public: T *allocate(size_t n, const void *hint = 0) { - (void)hint; + (void) hint; if(n == 0) { return NULL; } diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 1b039888452..34f428f111c 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -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 } -- cgit v1.2.3