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