diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-19 09:01:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-19 09:28:17 +0300 |
commit | 14b2a35c8bfd6d77f6357f929ddd82845436725f (patch) | |
tree | 54746d6a3cf0da24b95d2a9761e6222656eb5249 /intern/cycles | |
parent | 17a2820da8ad8ea23d336129f32e060e5746b047 (diff) |
Cleanup: use parenthesis for if statements in macros
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/device/opencl/device_opencl.h | 6 |
2 files changed, 16 insertions, 8 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()); \ } \ } \ |