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

Re: svn commit: r1390438 - in /subversion/trunk: ./ subversion/include/private/ subversion/libsvn_ra_svn/ subversion/libsvn_subr/ tools/client-side/svn-bench/ tools/dist/

From: Hyrum K Wright <hyrum_at_hyrumwright.org>
Date: Thu, 11 Oct 2012 12:27:18 -0400

On Wed, Oct 10, 2012 at 1:46 PM, Hyrum K Wright <hyrum_at_hyrumwright.org> wrote:
> On Wed, Sep 26, 2012 at 8:39 AM, <stefan2_at_apache.org> wrote:
>> Author: stefan2
>> Date: Wed Sep 26 12:38:59 2012
>> New Revision: 1390438
>>
>> URL: http://svn.apache.org/viewvc?rev=1390438&view=rev
>> Log:
>> Merge second batch of changes from the 10Gb branch. These add the
>> svn-bench tool.
> ...
>> Modified: subversion/trunk/subversion/libsvn_subr/string.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/string.c?rev=1390438&r1=1390437&r2=1390438&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_subr/string.c (original)
>> +++ subversion/trunk/subversion/libsvn_subr/string.c Wed Sep 26 12:38:59 2012
>> @@ -1093,3 +1093,44 @@ svn__i64toa(char * dest, apr_int64_t num
>> *dest = '-';
>> return svn__ui64toa(dest + 1, (apr_uint64_t)(0-number)) + 1;
>> }
>> +
>> +static void
>> +ui64toa_sep(apr_uint64_t number, char seperator, char *buffer)
>> +{
>> + apr_size_t length = svn__ui64toa(buffer, number);
>> + apr_size_t i;
>> +
>> + for (i = length; i > 3; i -= 3)
>> + {
>> + memmove(&buffer[i - 2], &buffer[i - 3], length - i + 3);
>> + buffer[i-3] = seperator;
>> + length++;
>> + }
>> +
>> + buffer[length] = 0;
>> +}
>> +
>> +char *
>> +svn__ui64toa_sep(apr_uint64_t number, char seperator, apr_pool_t *pool)
>> +{
>> + char buffer[2 * SVN_INT64_BUFFER_SIZE];
>> + ui64toa_sep(number, seperator, buffer);
>> +
>> + return apr_pstrdup(pool, buffer);
>> +}
>> +
>> +char *
>> +svn__i64toa_sep(apr_uint64_t number, char seperator, apr_pool_t *pool)
>
> This function name looks like it takes a signed integer, but the
> actual argument type is an unsigned int...
>
>> +{
>> + char buffer[2 * SVN_INT64_BUFFER_SIZE];
>> + if (number < 0)
>
> ...which means this conditional will never evaluate as true.
>
>> + {
>> + buffer[0] = '-';
>> + ui64toa_sep((apr_uint64_t)(-number), seperator, &buffer[1]);
>> + }
>> + else
>> + ui64toa_sep((apr_uint64_t)(number), seperator, buffer);
>> +
>> + return apr_pstrdup(pool, buffer);
>> +}
> ...

Talked to Stefan about this in person, and updated in r1397148.

-Hyrum
Received on 2012-10-11 18:27:53 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.