diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-20 15:21:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-20 15:21:27 +0300 |
commit | 38a2bf665b2e5efd3bf6d54ffa0e2fc0385b9847 (patch) | |
tree | 15cabcc8d5731014656d12f5bfd3213141721b68 /intern/cycles | |
parent | 81e584ed17902878579131776b4e5a9f7b54cdab (diff) |
Cycles: Cleanup, style and unused arguments
- Some arguments were inapproriatry tagged as unused
using (void)foo semantic.
Only use such semantic in tricky casses, when something
needs to be ignored in release builds or something is
dependent on tricky ifndef policy.
For rest of the cases just use void foo(int /bar*/)
semantic, which ensures variable is not used. Solves
confusion and code running out of sync with later
development.
- Used proper unused semantic to some arguments.
- Added braces to make code easier to follow, tricky
indentation with ifdef, uh.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 3 | ||||
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_base.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/shader.cpp | 5 | ||||
-rw-r--r-- | intern/cycles/util/util_guarded_allocator.h | 2 |
5 files changed, 6 insertions, 12 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index fea55049049..c2f74aa8903 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -532,9 +532,8 @@ public: bool denoising_combine_halves(device_ptr a_ptr, device_ptr b_ptr, device_ptr mean_ptr, device_ptr variance_ptr, - int r, int4 rect, DenoisingTask *task) + int r, int4 rect, DenoisingTask * /*task*/) { - (void) task; for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { filter_combine_halves_kernel()(x, y, diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 90647c344e3..26671bdde28 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -1148,8 +1148,6 @@ public: device_ptr mean_ptr, device_ptr variance_ptr, int r, int4 rect, DenoisingTask *task) { - (void) task; - if(have_error()) return false; @@ -1179,8 +1177,6 @@ public: device_ptr sample_variance_ptr, device_ptr sv_variance_ptr, device_ptr buffer_variance_ptr, DenoisingTask *task) { - (void) task; - if(have_error()) return false; diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp index 8f33014a00e..24b70e3446c 100644 --- a/intern/cycles/device/opencl/opencl_base.cpp +++ b/intern/cycles/device/opencl/opencl_base.cpp @@ -817,8 +817,6 @@ bool OpenCLDeviceBase::denoising_combine_halves(device_ptr a_ptr, int r, int4 rect, DenoisingTask *task) { - (void) task; - cl_mem a_mem = CL_MEM_PTR(a_ptr); cl_mem b_mem = CL_MEM_PTR(b_ptr); cl_mem mean_mem = CL_MEM_PTR(mean_ptr); @@ -847,8 +845,6 @@ bool OpenCLDeviceBase::denoising_divide_shadow(device_ptr a_ptr, device_ptr buffer_variance_ptr, DenoisingTask *task) { - (void) task; - cl_mem a_mem = CL_MEM_PTR(a_ptr); cl_mem b_mem = CL_MEM_PTR(b_ptr); cl_mem sample_variance_mem = CL_MEM_PTR(sample_variance_ptr); diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index a64f227a38c..50400edd5ca 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -335,11 +335,14 @@ ShaderManager *ShaderManager::create(Scene *scene, int shadingsystem) (void)shadingsystem; /* Ignored when built without OSL. */ #ifdef WITH_OSL - if(shadingsystem == SHADINGSYSTEM_OSL) + if(shadingsystem == SHADINGSYSTEM_OSL) { manager = new OSLShaderManager(); + } else #endif + { manager = new SVMShaderManager(); + } add_default(scene); diff --git a/intern/cycles/util/util_guarded_allocator.h b/intern/cycles/util/util_guarded_allocator.h index 5f9dcfb2481..1abcabd5294 100644 --- a/intern/cycles/util/util_guarded_allocator.h +++ b/intern/cycles/util/util_guarded_allocator.h @@ -50,9 +50,9 @@ public: T *allocate(size_t n, const void *hint = 0) { + (void)hint; size_t size = n * sizeof(T); util_guarded_mem_alloc(size); - (void)hint; if(n == 0) { return NULL; } |