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

Re: svn commit: r1507044 -

From: Ben Reser <ben_at_reser.org>
Date: Thu, 25 Jul 2013 16:39:03 -0700

On Thu, Jul 25, 2013 at 3:45 PM, Ben Reser <ben_at_reser.org> wrote:
> On Thu, Jul 25, 2013 at 3:37 PM, Bert Huijben <bert_at_qqmail.nl> wrote:
>> If svn_hash_sets doesn't have a return value we could redefine it with
>> a temporary variable (and catch some type warnings too)
>
> Yup, apr_hash_set() has a void return. So we could still fix this
> with the macro.
>
> Does this look okay?
> #define svn_hash_sets(ht, key_expression, val) \
> do { \
> const char *key = key_expression; \
> apr_hash_set(ht, key, strlen(key), val); \
> } while (0)

Ended up commiting:
  #define svn_hash_sets(ht, key, val) \
    do { \
      const void *keystr = (key); \
      apr_hash_set(ht, keystr, strlen(keystr), val); \
    } while (0)

In:
http://svn.apache.org/r1507155

svn_hash_gets() has a similar issue but can't be fixed with a macro
since it has a return value.
Received on 2013-07-26 01:39:38 CEST

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