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

Re: svn commit: r39770 - trunk/subversion/libsvn_wc

From: Greg Stein <gstein_at_gmail.com>
Date: Thu, 8 Oct 2009 01:16:29 -0400

On Fri, Oct 2, 2009 at 15:15, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>...
> +++ trunk/subversion/libsvn_wc/copy.c   Fri Oct  2 12:15:29 2009        (r39770)
> @@ -60,14 +60,8 @@ copy_props(svn_wc__db_t *db,
>                              scratch_pool, scratch_pool));
>   for (hi = apr_hash_first(scratch_pool, props); hi; hi = apr_hash_next(hi))
>     {
> -      const char *propname;
> -      svn_string_t *propval;
> -      const void *key;
> -      void *val;
> -
> -      apr_hash_this(hi, &key, NULL, &val);
> -      propname = key;
> -      propval = val;
> +      const char *propname = svn_apr_hash_index_key(hi);
> +      svn_string_t *propval = svn_apr_hash_index_val(hi);

const!!

>...
> +++ trunk/subversion/libsvn_wc/entries.c        Fri Oct  2 12:15:29 2009        (r39770)
>...
> @@ -1551,18 +1550,13 @@ prune_deleted(apr_hash_t **entries_prune
>        hi;
>        hi = apr_hash_next(hi))
>     {
> -      void *val;
> -      const void *key;
> -      const svn_wc_entry_t *entry;
> +      const void *key = svn_apr_hash_index_key(hi);

The new API allows you to extract the key/value with the Proper Type.
Thus, when you use these APIs, I think you should declare them with
the correct type. In this case 'const char *key'.

> +      const svn_wc_entry_t *entry = svn_apr_hash_index_val(hi);
>       svn_boolean_t hidden;
>
> -      apr_hash_this(hi, &key, NULL, &val);
> -      entry = val;
>       SVN_ERR(svn_wc__entry_is_hidden(&hidden, entry));
>       if (!hidden)
> -        {
> -          apr_hash_set(*entries_pruned, key, APR_HASH_KEY_STRING, entry);
> -        }
> +        apr_hash_set(*entries_pruned, key, APR_HASH_KEY_STRING, entry);

Especially given that you're treating it that way here.

>...
> +++ trunk/subversion/libsvn_wc/update_editor.c  Fri Oct  2 12:15:29 2009        (r39770)
> @@ -3351,13 +3351,8 @@ copy_regular_props(apr_hash_t *props_in,
>
>   for (hi = apr_hash_first(pool, props_in); hi; hi = apr_hash_next(hi))
>     {
> -      const void *key;
> -      void *val;
> -      const char *propname;
> -      svn_string_t *propval;
> -      apr_hash_this(hi, &key, NULL, &val);
> -      propname = key;
> -      propval = val;
> +      const char *propname = svn_apr_hash_index_key(hi);
> +      svn_string_t *propval = svn_apr_hash_index_val(hi);

const!

>...

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404780
Received on 2009-10-08 07:16:54 CEST

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.