From 371ddda4d0b3c2ef0c40f604715db801dc33b669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 4 Sep 2020 11:26:26 +0200 Subject: Cleanup: Clang-Tidy readability-redundant-preprocessor fixes Remove redundantly nested `#if` and `#ifdef` statements. One nested `#if 0` block was left untouched, as it's in particle code that's no longer maintained. Furthermore, that block also has some explanation as to the differences between the enabled & disabled parts. One nested `#if 0` construct was completely removed, leaving only the actually used bit of code. There was no explanation as to the usefulness of the disabled code, and it hasn't been touched in years. No functional changes. --- .../blender/editors/uvedit/uvedit_parametrizer.c | 30 +++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'source/blender/editors/uvedit/uvedit_parametrizer.c') diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index f6485fdef5d..8d30dc19732 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -43,29 +43,13 @@ /* Utils */ -#if 0 -# define param_assert(condition) -# define param_warning(message) -# define param_test_equals_ptr(condition) -# define param_test_equals_int(condition) -#else -# define param_assert(condition) \ - if (!(condition)) { /*printf("Assertion %s:%d\n", __FILE__, __LINE__); abort();*/ \ - } \ - (void)0 -# define param_warning(message) \ - {/*printf("Warning %s:%d: %s\n", __FILE__, __LINE__, message);*/}(void)0 -# if 0 -# define param_test_equals_ptr(str, a, b) \ - if (a != b) { /*printf("Equals %s => %p != %p\n", str, a, b);*/ \ - } \ - (void)0 -# define param_test_equals_int(str, a, b) \ - if (a != b) { /*printf("Equals %s => %d != %d\n", str, a, b);*/ \ - } \ - (void)0 -# endif -#endif +#define param_assert(condition) \ + if (!(condition)) { /*printf("Assertion %s:%d\n", __FILE__, __LINE__); abort();*/ \ + } \ + (void)0 +#define param_warning(message) \ + {/*printf("Warning %s:%d: %s\n", __FILE__, __LINE__, message);*/}(void)0 + typedef enum PBool { P_TRUE = 1, P_FALSE = 0, -- cgit v1.2.3