From f24746bf2086e02aea010977576b4152895eb3cc Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 24 Oct 2013 09:26:21 -0600 Subject: [PATCH] Fix CBDATA_CLASS2 macro definition CBDATA_UNKNOWN was being used in place of a void no-op statement. This was incorrect and useless. Now that the value definition is fixed it is being picked up by the stricter compilers. Replace the trinary conditional with an if-statement. --- src/cbdata.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cbdata.h b/src/cbdata.h index fdb116c542..5c73dc5b44 100644 --- a/src/cbdata.h +++ b/src/cbdata.h @@ -285,7 +285,8 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, public: \ void *operator new(size_t size) { \ assert(size == sizeof(type)); \ - (CBDATA_##type ? CBDATA_UNKNOWN : (CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL))); \ + if (!CBDATA_##type) \ + CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL); \ return cbdataInternalAllocDbg(CBDATA_##type,__FILE__,__LINE__); \ } \ void operator delete (void *address) { \ @@ -332,7 +333,7 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, /** * \ingroup CBDATAAPI * - * This needs to be defined LAST in teh class definition. It plays with private/public states in C++. + * This needs to be defined LAST in the class definition. It plays with private/public states in C++. */ #define CBDATA_CLASS2(type) \ private: \ @@ -340,7 +341,8 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, public: \ void *operator new(size_t size) { \ assert(size == sizeof(type)); \ - (CBDATA_##type ? CBDATA_UNKNOWN : (CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL))); \ + if (!CBDATA_##type) \ + CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL); \ return (type *)cbdataInternalAlloc(CBDATA_##type); \ } \ void operator delete (void *address) { \ -- 2.47.2