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

RE: svn commit: r1577079 - in /subversion/trunk/subversion: include/private/ libsvn_client/ libsvn_delta/ libsvn_diff/ libsvn_fs_fs/ libsvn_ra/ libsvn_repos/ libsvn_subr/ libsvn_wc/ svndumpfilter/

From: Bert Huijben <bert_at_qqmail.nl>
Date: Thu, 13 Mar 2014 11:28:39 +0100

> -----Original Message-----
> From: ivan_at_apache.org [mailto:ivan_at_apache.org]
> Sent: donderdag 13 maart 2014 11:00
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1577079 - in /subversion/trunk/subversion:
> include/private/ libsvn_client/ libsvn_delta/ libsvn_diff/ libsvn_fs_fs/
> libsvn_ra/ libsvn_repos/ libsvn_subr/ libsvn_wc/ svndumpfilter/
>
> Author: ivan
> Date: Thu Mar 13 09:59:55 2014
> New Revision: 1577079
>
> URL: http://svn.apache.org/r1577079
> Log:
> Add svn_sort__array() -- simple wrapper around qsort() to sort APR array
> and use where applicable.
>
> * subversion/include/private/svn_sorts_private.h
> (svn_sort__array): New declaration.
>
> * subversion/libsvn_subr/sorts.c
> (svn_sort__array): New.
>
> * subversion/libsvn_client/add.c
> (): Include svn_sorts_private.h.
> (mkdir_urls): Use svn_sort__array().
>
> * subversion/libsvn_client/commit.c
> (): Include svn_sorts_private.h.
> (determine_lock_targets): Use svn_sort__array().
>
> * subversion/libsvn_client/commit_util.c
> (): Remove stdlib.h and include svn_sorts_private.h.
> (svn_client__condense_commit_items): Use svn_sort__array().
>
> * subversion/libsvn_client/ra.c
> (): Include svn_sorts_private.h.
> (svn_client__repos_location_segments): Use svn_sort__array().
>
> * subversion/libsvn_client/resolved.c
> (): Remove stdlib.h and include svn_sorts_private.h.
> (svn_client__resolve_conflicts): Use svn_sort__array().
>
> * subversion/libsvn_delta/path_driver.c
> (): Include svn_sorts_private.h.
> (svn_delta_path_driver2): Use svn_sort__array().
>
> * subversion/libsvn_diff/parse-diff.c
> (): Include svn_sorts_private.h.
> (svn_diff_parse_next_patch): Use svn_sort__array().
>
> * subversion/libsvn_fs_fs/cached_data.c
> (read_dir_entries): Use svn_sort__array().
>
> * subversion/libsvn_fs_fs/transaction.c
> (verify_locks): Use svn_sort__array().
>
> * subversion/libsvn_ra/compat.c
> (svn_ra__locations_from_log): Use svn_sort__array().
>
> * subversion/libsvn_repos/log.c
> (): Include svn_sorts_private.h.
> (turn_unique_copies_into_moves, combine_mergeinfo_path_lists,
> handle_merged_revisions): Use svn_sort__array().
>
> * subversion/libsvn_repos/replay.c
> (): Include svn_sorts_private.h.
> (svn_repos__replay_ev2): Use svn_sort__array().
>
> * subversion/libsvn_repos/rev_hunt.c
> (): Include svn_sorts_private.h.
> (find_merged_revisions): Use svn_sort__array().
>
> * subversion/libsvn_subr/mergeinfo.c
> (combine_with_lastrange, parse_revision_line, svn_mergeinfo_sort): Use
> svn_sort__array().
>
> * subversion/libsvn_wc/revert.c
> (): Include svn_sorts_private.h.
> (revert_restore_handle_copied_dirs): Use svn_sort__array().
>
> * subversion/svndumpfilter/svndumpfilter.c
> (): Include svn_sorts_private.h.
> (do_filter): Use svn_sort__array().
>
> Modified:
> subversion/trunk/subversion/include/private/svn_sorts_private.h
> subversion/trunk/subversion/libsvn_client/add.c
> subversion/trunk/subversion/libsvn_client/commit.c
> subversion/trunk/subversion/libsvn_client/commit_util.c
> subversion/trunk/subversion/libsvn_client/ra.c
> subversion/trunk/subversion/libsvn_client/resolved.c
> subversion/trunk/subversion/libsvn_delta/path_driver.c
> subversion/trunk/subversion/libsvn_diff/parse-diff.c
> subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
> subversion/trunk/subversion/libsvn_fs_fs/transaction.c
> subversion/trunk/subversion/libsvn_ra/compat.c
> subversion/trunk/subversion/libsvn_repos/log.c
> subversion/trunk/subversion/libsvn_repos/replay.c
> subversion/trunk/subversion/libsvn_repos/rev_hunt.c
> subversion/trunk/subversion/libsvn_subr/mergeinfo.c
> subversion/trunk/subversion/libsvn_subr/sorts.c
> subversion/trunk/subversion/libsvn_wc/revert.c
> subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
>
> Modified: subversion/trunk/subversion/include/private/svn_sorts_private.h
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private
> /svn_sorts_private.h?rev=1577079&r1=1577078&r2=1577079&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/include/private/svn_sorts_private.h
> (original)
> +++ subversion/trunk/subversion/include/private/svn_sorts_private.h Thu
> Mar 13 09:59:55 2014
> @@ -72,6 +72,14 @@ svn_sort__hash(apr_hash_t *ht,
> const svn_sort__item_t *),
> apr_pool_t *pool);
>
> +/* Sort APR array @a array using ordering defined by @a comparison_func.
> + * @a comparison_func is defined as for the C stdlib function qsort().
> + */
> +void
> +svn_sort__array(apr_array_header_t *array,
> + int (*comparison_func)(const void *,
> + const void *));

I think the documentation should note that the array values must be pointers as that is how you pass the comparison function.

There are pretty common cases where we use apr arrays with struct members, instead of pointer to struct. (E.g. for property changes)

        Bert
Received on 2014-03-13 11:29:33 CET

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.