[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: Wed, 10 Oct 2012 13:46:28 -0400

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);
> +}
...

-Hyrum
Received on 2012-10-10 19:47:06 CEST

This is an archived mail posted to the Subversion Dev mailing list.