------------------------------------------------------------ revno: 13010 revision-id: squid3@treenet.co.nz-20131013134155-khinz1g5an15opg7 parent: squid3@treenet.co.nz-20131013133355-c1pwl5iz8mo3bwg8 committer: Amos Jeffries branch nick: 3.4 timestamp: Sun 2013-10-13 07:41:55 -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-20131013134155-khinz1g5an15opg7 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: e33bd2d649d6e3f384f2d69cc220dedb95cca531 # timestamp: 2013-10-13 13:42:22 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20131013133355-\ # c1pwl5iz8mo3bwg8 # # Begin patch === modified file 'src/cbdata.h' --- src/cbdata.h 2013-09-29 14:31:05 +0000 +++ src/cbdata.h 2013-10-13 13:41:55 +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) { \