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

Re: svn commit: rev 182 - trunk/subversion/libsvn_fs

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-10-01 12:09:04 CEST

On Fri, Sep 28, 2001 at 07:33:05PM -0500, brane@tigris.org wrote:
> Author: brane
> Date: 2001-09-29 00:33 GMT
> New Revision: 182
>
> Modified:
> trunk/subversion/libsvn_fs/key-gen.c
> trunk/subversion/libsvn_fs/skel.c
> trunk/subversion/libsvn_fs/txn-table.c
> trunk/subversion/libsvn_fs/validate.c
> Log:
> Fix signed/unsigned comparison warnings.
>...
> --- OLD/trunk/subversion/libsvn_fs/key-gen.c Fri Sep 28 19:33:05 2001
> +++ NEW/trunk/subversion/libsvn_fs/key-gen.c Fri Sep 28 19:33:05 2001
> @@ -41,14 +41,14 @@
>
> So we do the check for overflow before we multiply value and add
> in the new digit. */
> - int max_prefix = max / 10;
> - int max_digit = max % 10;
> - int i;
> + apr_size_t max_prefix = max / 10;
> + apr_size_t max_digit = max % 10;
> + apr_size_t i;

This is bogus. Digits are integers. The problem is with the "max" parameter,
not the internal values. A maximum integer shouldn't be an apr_size_t. Some
other type ought to be used.

apr_size_t is for memory sizes.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:43 2006

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.