[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: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Thu, 13 Mar 2014 15:29:10 +0400

On 13 March 2014 14:28, Bert Huijben <bert_at_qqmail.nl> wrote:
>>
>> +/* 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)
>

Why? svn_sort__array() as qsort() invoke ordering callback with a
pointer to array element. It could pointer to pointer if array
contains pointer or pointer to any struct.

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Received on 2014-03-13 12:30:05 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.