subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r938968 - /subversion/trunk/subversion/libsvn_wc/props.c
Date Wed, 28 Apr 2010 12:29:36 GMT
Author: julianfoad
Date: Wed Apr 28 12:29:36 2010
New Revision: 938968

URL: http://svn.apache.org/viewvc?rev=938968&view=rev
Log:
Avoid casting away 'const'.

* subversion/libsvn_wc/props.c
  (combine_mergeinfo_props, combine_forked_mergeinfo_props,
   apply_single_mergeinfo_prop_change): Put the result in a temporary
    variable first to avoid casting away 'const'.

Modified:
    subversion/trunk/subversion/libsvn_wc/props.c

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=938968&r1=938967&r2=938968&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Wed Apr 28 12:29:36 2010
@@ -514,11 +514,14 @@ combine_mergeinfo_props(const svn_string
                         apr_pool_t *scratch_pool)
 {
   svn_mergeinfo_t mergeinfo1, mergeinfo2;
+  svn_string_t *mergeinfo_string;
+
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo1, prop_val1->data, scratch_pool));
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo2, prop_val2->data, scratch_pool));
   SVN_ERR(svn_mergeinfo_merge(mergeinfo1, mergeinfo2, scratch_pool));
-  return svn_mergeinfo_to_string((svn_string_t **)output, mergeinfo1,
-                                 result_pool);
+  SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_string, mergeinfo1, result_pool));
+  *output = mergeinfo_string;
+  return SVN_NO_ERROR;
 }
 
 /* Perform a 3-way merge operation on mergeinfo.  FROM_PROP_VAL is
@@ -532,6 +535,7 @@ combine_forked_mergeinfo_props(const svn
                                apr_pool_t *pool)
 {
   svn_mergeinfo_t from_mergeinfo, l_deleted, l_added, r_deleted, r_added;
+  svn_string_t *mergeinfo_string;
 
   /* ### OPTIMIZE: Use from_mergeinfo when diff'ing. */
   SVN_ERR(diff_mergeinfo_props(&l_deleted, &l_added, from_prop_val,
@@ -548,7 +552,9 @@ combine_forked_mergeinfo_props(const svn
   SVN_ERR(svn_mergeinfo_remove2(&from_mergeinfo, l_deleted,
                                 from_mergeinfo, TRUE, pool, pool));
 
-  return svn_mergeinfo_to_string((svn_string_t **)output, from_mergeinfo, pool);
+  SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_string, from_mergeinfo, pool));
+  *output = mergeinfo_string;
+  return SVN_NO_ERROR;
 }
 
 
@@ -1439,12 +1445,15 @@ apply_single_mergeinfo_prop_change(svn_w
              incoming value relative to the base, and
              "combine" those with the empty WC value. */
           svn_mergeinfo_t deleted_mergeinfo, added_mergeinfo;
+          svn_string_t *mergeinfo_string;
+
           SVN_ERR(diff_mergeinfo_props(&deleted_mergeinfo,
                                        &added_mergeinfo,
                                        old_val, new_val, scratch_pool));
-          SVN_ERR(svn_mergeinfo_to_string((svn_string_t **)&new_val,
+          SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_string,
                                           added_mergeinfo, result_pool));
-          apr_hash_set(working_props, propname, APR_HASH_KEY_STRING, new_val);
+          apr_hash_set(working_props, propname, APR_HASH_KEY_STRING,
+                       mergeinfo_string);
     }
 
   else /* means working && base && svn_string_compare(working, base) */



Mime
View raw message