------------------------------------------------------------ revno: 12638 revision-id: squid3@treenet.co.nz-20131024152621-xzfpnzkkzib4z9no parent: squid3@treenet.co.nz-20131024152527-vj3nk892lvrk9t34 committer: Amos Jeffries branch nick: 3.3 timestamp: Thu 2013-10-24 09:26:21 -0600 message: 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. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131024152621-xzfpnzkkzib4z9no # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: f780f63159e5a9d96f5d905a0af24fb5228d61e2 # timestamp: 2013-10-24 15:46:53 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20131024152527-\ # vj3nk892lvrk9t34 # # Begin patch === modified file 'src/cbdata.h' --- src/cbdata.h 2013-09-29 18:13:17 +0000 +++ src/cbdata.h 2013-10-24 15:26:21 +0000 @@ -285,7 +285,8 @@ 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 @@ /** * \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 @@ 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) { \