Branko Čibej wrote:
> On 21.03.2013 14:18, Philip Martin wrote:
>> julianfoad_at_apache.org writes:
>>> -svn_error_t *
>>> -svn_hash__clear(apr_hash_t *hash, apr_pool_t *pool)
>>> +void
>>> +svn_hash__clear(apr_hash_t *hash)
>>> {
>>> #if APR_VERSION_AT_LEAST(1, 3, 0)
>>> apr_hash_clear(hash);
>>> @@ -518,13 +518,12 @@ svn_hash__clear(apr_hash_t *hash, apr_po
>>> const void *key;
>>> apr_ssize_t klen;
>>>
>>> - for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
>>> + for (hi = apr_hash_first(NULL, hash); hi; hi = apr_hash_next(hi))
>>> {
>>> apr_hash_this(hi, &key, &klen, NULL);
>>> apr_hash_set(hash, key, klen, NULL);
>>> }
>>> #endif
>>> - return SVN_NO_ERROR;
>>> }
>>>
>> The declaration of svn_hash__clear is only present for old APR while the
>> definition is always visible. I get this warning:
>>
>> ../src2/subversion/libsvn_subr/hash.c:512:1: warning: no previous prototype
>> for 'svn_hash__clear' [-Wmissing-prototypes]
>>
>> We could fix it by moving the declaration outside the #if making
>> svn_hash__clear always available. Or we could wrap the definition in a
>> #if (dropping the call to apr_hash_clear) so it is only available when
>> the declaration is available.
>>
>> Which is the best solution?
>
> Given that this is an internal API and not subject to compatibility
> across patch releases, I think we can safely make the implementation
> conditional on the same predicate.
Sounds right to me too. I'll make it so (despite cmpilato's commit in the opposite direction a few minutes ago) unless anyone very soon disagrees.
- Julian
Received on 2013-03-21 16:25:09 CET