------------------------------------------------------------ revno: 12645 revision-id: squid3@treenet.co.nz-20131103083224-8d0wtir5tiwdzqq6 parent: squid3@treenet.co.nz-20131024154536-d539m43t9zs92cw0 committer: Amos Jeffries branch nick: 3.3 timestamp: Sun 2013-11-03 01:32:24 -0700 message: Fix cbdata 'error: expression result unused' errors Detected by Clang. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131103083224-8d0wtir5tiwdzqq6 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: d9f51c475e352768f9c8dc5b7d780f671226d0c1 # timestamp: 2013-11-03 08:45:13 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20131024154536-\ # d539m43t9zs92cw0 # # Begin patch === modified file 'src/cbdata.h' --- src/cbdata.h 2013-10-24 15:26:21 +0000 +++ src/cbdata.h 2013-11-03 08:32:24 +0000 @@ -415,24 +415,24 @@ * Initializes the cbdatatype. Must be called prior to the first use of cbdataAlloc() for the type. * \par - * Alternative to CBDATA_INIT_TYPE_FREECB() - * - \param type Type being initialized - */ -#define CBDATA_INIT_TYPE(type) (CBDATA_##type ? CBDATA_UNKNOWN : (CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL))) - -/** - \ingroup CBDATAAPI - * - * Initializes the cbdatatype. Must be called prior to the first use of cbdataAlloc() for the type. - * - \par * Alternative to CBDATA_INIT_TYPE() * \param type Type being initialized \param free_func The freehandler called when the last known reference to an allocated entry goes away. */ -#define CBDATA_INIT_TYPE_FREECB(type, free_func) (CBDATA_##type ? CBDATA_UNKNOWN : (CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), free_func))) +#define CBDATA_INIT_TYPE_FREECB(type, free_func) do { if (!CBDATA_##type) CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), free_func); } while (false) + +/** + \ingroup CBDATAAPI + * + * Initializes the cbdatatype. Must be called prior to the first use of cbdataAlloc() for the type. + * + \par + * Alternative to CBDATA_INIT_TYPE_FREECB() + * + \param type Type being initialized + */ +#define CBDATA_INIT_TYPE(type) CBDATA_INIT_TYPE_FREECB(type, NULL) /** \ingroup CBDATA