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

Re: svn commit: r935837 - /subversion/trunk/subversion/libsvn_subr/dirent_uri.c

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 20 Apr 2010 09:12:23 -0400

On Tue, Apr 20, 2010 at 05:04, <rhuijben_at_apache.org> wrote:
> Author: rhuijben
> Date: Tue Apr 20 09:04:27 2010
> New Revision: 935837
>
> URL: http://svn.apache.org/viewvc?rev=935837&view=rev
> Log:
> Following up on r935829, replace usages of apr_uintptr_t with apr_size_t,
> to fix the build on older apr versions. (It would be nice if apr used the
> same @since convention as Subversion).

You don't need apr_uintptr_t here. That type is used to stash a
pointer into an integer type. What you really want to do is something
like:

apr_size_t amt = (apr_size_t)((char *)ptr1 - (char *)ptr2);

>...
> +++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Tue Apr 20 09:04:27 2010
> @@ -560,9 +560,9 @@ canonicalize(path_type_t type, const cha
>
>       if (need_extra > 0)
>         {
> -          apr_size_t pre_schema_size = (apr_uintptr_t)schema_data - (apr_uintptr_t)canon;
> +          apr_size_t pre_schema_size = (apr_size_t)schema_data - (apr_size_t)canon;

pre_schema_size = (apr_size_t)(schema_data - canon);

>
> -          dst = apr_palloc(pool, (apr_uintptr_t)src - (apr_uintptr_t)canon + need_extra + 1);
> +          dst = apr_palloc(pool, (apr_size_t)src - (apr_size_t)canon + need_extra + 1);

(apr_size_t)(src - canon) + need_extra + 1

>           memcpy(dst, canon, pre_schema_size);
>           canon = dst;
>
>
>
>
Received on 2010-04-20 15:12:56 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.