You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/04/20 11:04:28 UTC

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

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).

* subversion/libsvn_subr/dirent_uri.c
  (canonicalize): Use apr_size_t.

Modified:
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c

Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=935837&r1=935836&r2=935837&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ 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;
 
-          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);
           memcpy(dst, canon, pre_schema_size);
           canon = dst;
 



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

Posted by Greg Stein <gs...@gmail.com>.
On Tue, Apr 20, 2010 at 05:04,  <rh...@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;
>
>
>
>