diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/device/opencl/device_opencl.h | 6 | ||||
-rw-r--r-- | intern/guardedalloc/MEM_guardedalloc.h | 6 |
3 files changed, 20 insertions, 10 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index bb2240142b0..ec62fa63f73 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -482,8 +482,10 @@ PassType BlenderSync::get_pass_type(BL::RenderPass &b_pass) { string name = b_pass.name(); #define MAP_PASS(passname, passtype) \ - if (name == passname) \ - return passtype; + if (name == passname) { \ + return passtype; \ + } \ + ((void)0) /* NOTE: Keep in sync with defined names from DNA_scene_types.h */ MAP_PASS("Combined", PASS_COMBINED); MAP_PASS("Depth", PASS_DEPTH); @@ -546,8 +548,10 @@ int BlenderSync::get_denoising_pass(BL::RenderPass &b_pass) name = name.substr(10); #define MAP_PASS(passname, offset) \ - if (name == passname) \ - return offset; + if (name == passname) { \ + return offset; \ + } \ + ((void)0) MAP_PASS("Normal", DENOISING_PASS_PREFILTERED_NORMAL); MAP_PASS("Albedo", DENOISING_PASS_PREFILTERED_ALBEDO); MAP_PASS("Depth", DENOISING_PASS_PREFILTERED_DEPTH); @@ -586,8 +590,10 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, if (denoising.use || denoising.store_passes) { if (denoising.type == DENOISER_NLM) { #define MAP_OPTION(name, flag) \ - if (!get_boolean(crl, name)) \ - scene->film->denoising_flags |= flag; + if (!get_boolean(crl, name)) { \ + scene->film->denoising_flags |= flag; \ + } \ + ((void)0) MAP_OPTION("denoising_diffuse_direct", DENOISING_CLEAN_DIFFUSE_DIR); MAP_OPTION("denoising_diffuse_indirect", DENOISING_CLEAN_DIFFUSE_IND); MAP_OPTION("denoising_glossy_direct", DENOISING_CLEAN_GLOSSY_DIR); diff --git a/intern/cycles/device/opencl/device_opencl.h b/intern/cycles/device/opencl/device_opencl.h index e0140996cf0..4fd3c27f17e 100644 --- a/intern/cycles/device/opencl/device_opencl.h +++ b/intern/cycles/device/opencl/device_opencl.h @@ -230,8 +230,9 @@ class OpenCLCache { if (err != CL_SUCCESS) { \ string message = string_printf( \ "OpenCL error: %s in %s (%s:%d)", clewErrorString(err), #stmt, __FILE__, __LINE__); \ - if ((device)->error_message() == "") \ + if ((device)->error_message() == "") { \ (device)->set_error(message); \ + } \ fprintf(stderr, "%s\n", message.c_str()); \ } \ } \ @@ -244,8 +245,9 @@ class OpenCLCache { if (err != CL_SUCCESS) { \ string message = string_printf( \ "OpenCL error: %s in %s (%s:%d)", clewErrorString(err), #stmt, __FILE__, __LINE__); \ - if (error_msg == "") \ + if (error_msg == "") { \ error_msg = message; \ + } \ fprintf(stderr, "%s\n", message.c_str()); \ } \ } \ diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 78e629a6971..f12eb0ac340 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -243,8 +243,9 @@ void MEM_use_guarded_allocator(void); } \ void operator delete(void *mem) \ { \ - if (mem) \ + if (mem) { \ MEM_freeN(mem); \ + } \ } \ void *operator new[](size_t num_bytes) \ { \ @@ -252,8 +253,9 @@ void MEM_use_guarded_allocator(void); } \ void operator delete[](void *mem) \ { \ - if (mem) \ + if (mem) { \ MEM_freeN(mem); \ + } \ } \ void *operator new(size_t /*count*/, void *ptr) \ { \ |