[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1663450 - /subversion/trunk/subversion/libsvn_ra_svn/editorp.c

From: Branko Čibej <brane_at_wandisco.com>
Date: Tue, 03 Mar 2015 21:24:01 +0100

On 03.03.2015 19:10, Julian Foad wrote:
> Stefan Fuhrmann wrote:
>> Julian Foad wrote:
>>> #define svn_hash_sets(ht, key, val) \
>>> do { \
>>> const char *svn_hash__key = (key); \
>>> apr_hash_set(ht, svn_hash__key, APR_HASH_KEY_STRING, val); \
>>> } while (0)
>> But it would have caught the problem introduced in r1658194.
>>
>> So, that would be a 50% solution with no obvious drawbacks.
> [...]
>> I can't think of a way to sneak in a type check into the getter
>> without evaluating the key twice.
>>
>> In maintainer mode, though, we could replace the macro(s)
>> with a "proper" function. That would not produce overhead
>> for production code nor would it interfere with API guarantees.
> Yes.
>
> I'll change the 'set' macro as above, and I'll introduce a private 'get' function and make the (public) 'get' macro call the function in debug mode only. (That's a poor man's version of declaring a function as 'inline'.)
>
> Committed: http://svn.apache.org/r1663760

I'd have expected some symmetry in the get/set pair, not function for
one and magic macro for the other; but ... Emerson!

-- Brane
Received on 2015-03-03 21:26:01 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.