subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1706634 - in /subversion/trunk/subversion: libsvn_client/merge.c libsvn_fs_base/tree.c mod_dav_svn/repos.c tests/libsvn_client/client-test.c
Date Sat, 03 Oct 2015 21:20:45 GMT
Author: rhuijben
Date: Sat Oct  3 21:20:44 2015
New Revision: 1706634

URL: http://svn.apache.org/viewvc?rev=1706634&view=rev
Log:
Use the typesafe svn_sort__array() helper instead of qsort() in a few places.

* subversion/libsvn_client/merge.c
  (get_mergeinfo_paths,
   combine_range_with_segments): Use svn_sort__array().

* subversion/libsvn_fs_base/tree.c
  (includes): Add svn_sorts_private.h.
  (verify_locks): Use svn_sort__array().

* subversion/mod_dav_svn/repos.c
  (negotiate_encoding_prefs): Use svn_sort__array(). Remove const from local
    variable.

* subversion/tests/libsvn_client/client-test.c
  (includes): Add svn_sorts_private.h.
  (test_remote_only_status): Use svn_sort__array().

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_fs_base/tree.c
    subversion/trunk/subversion/mod_dav_svn/repos.c
    subversion/trunk/subversion/tests/libsvn_client/client-test.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1706634&r1=1706633&r2=1706634&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Sat Oct  3 21:20:44 2015
@@ -6465,10 +6465,7 @@ get_mergeinfo_paths(apr_array_header_t *
       /* Sort CHILDREN_WITH_MERGEINFO by each child's path (i.e. as per
          compare_merge_path_t_as_paths).  Any subsequent insertions of new
          children with insert_child_to_merge() require this ordering. */
-      qsort(children_with_mergeinfo->elts,
-            children_with_mergeinfo->nelts,
-            children_with_mergeinfo->elt_size,
-            compare_merge_path_t_as_paths);
+      svn_sort__array(children_with_mergeinfo, compare_merge_path_t_as_paths);
     }
 
   /* Case 2: Switched subtrees
@@ -7077,8 +7074,7 @@ combine_range_with_segments(apr_array_he
   /* If this was a subtractive merge, and we created more than one
      merge source, we need to reverse the sort ordering of our sources. */
   if (subtractive && (merge_source_ts->nelts > 1))
-    qsort(merge_source_ts->elts, merge_source_ts->nelts,
-          merge_source_ts->elt_size, compare_merge_source_ts);
+    svn_sort__array(merge_source_ts, compare_merge_source_ts);
 
   *merge_source_ts_p = merge_source_ts;
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/tree.c?rev=1706634&r1=1706633&r2=1706634&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/tree.c Sat Oct  3 21:20:44 2015
@@ -68,6 +68,7 @@
 #include "private/svn_fspath.h"
 #include "private/svn_fs_util.h"
 #include "private/svn_mergeinfo_private.h"
+#include "private/svn_sorts_private.h"
 
 
 /* ### I believe this constant will become internal to reps-strings.c.
@@ -2580,8 +2581,7 @@ verify_locks(const char *txn_name,
       apr_hash_this(hi, &key, NULL, NULL);
       APR_ARRAY_PUSH(changed_paths, const char *) = key;
     }
-  qsort(changed_paths->elts, changed_paths->nelts,
-        changed_paths->elt_size, svn_sort_compare_paths);
+  svn_sort__array(changed_paths, svn_sort_compare_paths);
 
   /* Now, traverse the array of changed paths, verify locks.  Note
      that if we need to do a recursive verification a path, we'll skip

Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1706634&r1=1706633&r2=1706634&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Sat Oct  3 21:20:44 2015
@@ -1729,7 +1729,7 @@ negotiate_encoding_prefs(request_rec *r,
      httpd/modules/mappers/mod_negotiation.c).  Thus, we duplicate the
      necessary ones in this file. */
   int i;
-  const apr_array_header_t *encoding_prefs;
+  apr_array_header_t *encoding_prefs;
   encoding_prefs = do_header_line(r->pool,
                                   apr_table_get(r->headers_in,
                                                 "Accept-Encoding"));
@@ -1741,8 +1741,7 @@ negotiate_encoding_prefs(request_rec *r,
     }
 
   *svndiff_version = 0;
-  qsort(encoding_prefs->elts, (size_t) encoding_prefs->nelts,
-        sizeof(accept_rec), sort_encoding_pref);
+  svn_sort__array(encoding_prefs, sort_encoding_pref);
   for (i = 0; i < encoding_prefs->nelts; i++)
     {
       struct accept_rec rec = APR_ARRAY_IDX(encoding_prefs, i,

Modified: subversion/trunk/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/client-test.c?rev=1706634&r1=1706633&r2=1706634&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/client-test.c Sat Oct  3 21:20:44 2015
@@ -34,6 +34,7 @@
 #include "private/svn_client_mtcc.h"
 #include "svn_repos.h"
 #include "svn_subst.h"
+#include "private/svn_sorts_private.h"
 #include "private/svn_wc_private.h"
 #include "svn_props.h"
 #include "svn_hash.h"
@@ -1014,8 +1015,7 @@ test_remote_only_status(const svn_test_o
   SVN_TEST_ASSERT(results->nelts == i);
 
   if (opts->verbose)
-    qsort(results->elts, results->nelts, results->elt_size,
-          compare_status_paths);
+    svn_sort__array(results, compare_status_paths);
 
   for (i = 0; i < results->nelts; ++i)
     {



Mime
View raw message