diff --git a/src/common/darktable.c b/src/common/darktable.c index 9a48b38bc72d..9e1f094667be 100644 --- a/src/common/darktable.c +++ b/src/common/darktable.c @@ -2468,7 +2468,7 @@ void dt_configure_runtime_performance(const int old, char *info) dt_conf_set_bool("cache_disk_backend_full", largedisk); dt_print(DT_DEBUG_DEV, "[dt_configure_runtime_performance] cache_disk_backend_full=%s", - (largedisk) ? "TRUE" : "FALSE"); + STR_TRUEFALSE(largedisk)); } gboolean updated_mandatory = FALSE; diff --git a/src/common/darktable.h b/src/common/darktable.h index 40a2e3c375e7..54191d1aa119 100644 --- a/src/common/darktable.h +++ b/src/common/darktable.h @@ -158,6 +158,10 @@ G_BEGIN_DECLS #define __DT_CLONE_TARGETS__ #endif + +#define STR_YESNO(b) ((b) ? "YES" : "NO") +#define STR_TRUEFALSE(b) ((b) ? "TRUE" : "FALSE") + typedef int32_t dt_imgid_t; typedef int32_t dt_filmid_t; #define NO_IMGID (0) diff --git a/src/common/opencl.c b/src/common/opencl.c index a1f5ca4a6cc2..5886671b457e 100644 --- a/src/common/opencl.c +++ b/src/common/opencl.c @@ -867,11 +867,11 @@ static gboolean _opencl_device_init(dt_opencl_t *cl, } dt_print_nts(DT_DEBUG_OPENCL, - " ASYNC PIXELPIPE: %s\n", cl->dev[dev].asyncmode ? "YES" : "NO"); + " ASYNC PIXELPIPE: %s\n", STR_YESNO(cl->dev[dev].asyncmode)); dt_print_nts(DT_DEBUG_OPENCL, - " PINNED MEMORY TRANSFER: %s\n", cl->dev[dev].pinned_memory ? "YES" : "NO"); + " PINNED MEMORY TRANSFER: %s\n", STR_YESNO(cl->dev[dev].pinned_memory)); dt_print_nts(DT_DEBUG_OPENCL, - " AVOID ATOMICS: %s\n", cl->dev[dev].avoid_atomics ? "YES" : "NO"); + " AVOID ATOMICS: %s\n", STR_YESNO(cl->dev[dev].avoid_atomics)); dt_print_nts(DT_DEBUG_OPENCL, " MICRO NAP: %i\n", cl->dev[dev].micro_nap); dt_print_nts(DT_DEBUG_OPENCL, @@ -881,7 +881,7 @@ static gboolean _opencl_device_init(dt_opencl_t *cl, dt_print_nts(DT_DEBUG_OPENCL, " TILING ADVANTAGE: %.3f\n", cl->dev[dev].advantage); dt_print_nts(DT_DEBUG_OPENCL, - " DEFAULT DEVICE: %s\n", (type & CL_DEVICE_TYPE_DEFAULT) ? "YES" : "NO"); + " DEFAULT DEVICE: %s\n", STR_YESNO(type & CL_DEVICE_TYPE_DEFAULT)); if(cl->dev[dev].disabled) { @@ -1451,7 +1451,7 @@ void dt_opencl_init(dt_opencl_t *cl, finally: dt_print(DT_DEBUG_OPENCL, "[opencl_init] FINALLY: opencl PREFERENCE=%s is %sAVAILABLE and %sENABLED.", - opencl_requested ? "ON" : "OFF", + STR_YESNO(opencl_requested), cl->inited ? "" : "NOT ", cl->enabled ? "" : "NOT "); if(cl->inited && cl->enabled) diff --git a/src/imageio/imageio.c b/src/imageio/imageio.c index dc20eed1cd56..2660c06a3aed 100644 --- a/src/imageio/imageio.c +++ b/src/imageio/imageio.c @@ -852,7 +852,7 @@ gboolean dt_imageio_has_mono_preview(const char *filename) dt_print(DT_DEBUG_IMAGEIO, "[dt_imageio_has_mono_preview] testing `%s', monochrome=%s, %ix%i", - filename, mono ? "YES" : "FALSE", thumb_width, thumb_height); + filename, STR_YESNO(mono), thumb_width, thumb_height); dt_free_align(tmp); return mono; } @@ -1302,8 +1302,8 @@ gboolean dt_imageio_export_with_flags(const dt_imgid_t imgid, thumbnail_export ? "thumbnail" : "export", imgid, pipe.processed_width, pipe.processed_height, processed_width, processed_height, scale, max_scale, - upscale ? "yes" : "no", - high_quality_processing || scale > 1.0f ? "yes" : "no", + STR_YESNO(upscale), + STR_YESNO(high_quality_processing || scale > 1.0f), dt_check_gimpmode("file") ? " GIMP" : ""); const int bpp = format->bpp(format_params); diff --git a/src/iop/channelmixerrgb.c b/src/iop/channelmixerrgb.c index 657cf81b3793..e32ee65ebdc9 100644 --- a/src/iop/channelmixerrgb.c +++ b/src/iop/channelmixerrgb.c @@ -2042,7 +2042,7 @@ static void _set_trouble_messages(dt_iop_module_t *self) problem1 ? "white balance applied twice, " : "", problem2 ? "double CAT applied, " : "", problem3 ? "white balance missing, " : "", - _dev_is_D65_chroma(dev) ? "YES" : "NO", + STR_YESNO(_dev_is_D65_chroma(dev)), chr->D65coeffs[0], chr->D65coeffs[1], chr->D65coeffs[2], chr->as_shot[0], chr->as_shot[1], chr->as_shot[2], img->id); diff --git a/src/iop/temperature.c b/src/iop/temperature.c index 4b7c5a7cd0ff..0e858c64a062 100644 --- a/src/iop/temperature.c +++ b/src/iop/temperature.c @@ -1596,9 +1596,9 @@ void reload_defaults(dt_iop_module_t *self) dt_print(DT_DEBUG_PARAMS, "[dt_iop_reload_defaults] scene=%s, modern=%s, CAT=%s. D65 %.3f %.3f %.3f, AS-SHOT %.3f %.3f %.3f", - dt_is_scene_referred() ? "YES" : "NO", - is_modern ? "YES" : "NO", - another_cat_defined ? "YES" : "NO", + STR_YESNO(dt_is_scene_referred()), + STR_YESNO(is_modern), + STR_YESNO(another_cat_defined), daylights[0], daylights[1], daylights[2], as_shot[0], as_shot[1], as_shot[2]); d->preset = p->preset = DT_IOP_TEMP_AS_SHOT;