You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2007/10/23 11:49:24 UTC

svn commit: r587431 - /apr/apr-util/trunk/encoding/apr_base64.c

Author: wrowe
Date: Tue Oct 23 02:49:21 2007
New Revision: 587431

URL: http://svn.apache.org/viewvc?rev=587431&view=rev
Log:
When dealing with deltas/offsets, use size_t until
the last possible moment (the API restricts us to
returning int's).

Modified:
    apr/apr-util/trunk/encoding/apr_base64.c

Modified: apr/apr-util/trunk/encoding/apr_base64.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/encoding/apr_base64.c?rev=587431&r1=587430&r2=587431&view=diff
==============================================================================
--- apr/apr-util/trunk/encoding/apr_base64.c (original)
+++ apr/apr-util/trunk/encoding/apr_base64.c Tue Oct 23 02:49:21 2007
@@ -111,13 +111,13 @@
 {
     int nbytesdecoded;
     register const unsigned char *bufin;
-    register int nprbytes;
+    register apr_size_t nprbytes;
 
     bufin = (const unsigned char *) bufcoded;
     while (pr2six[*(bufin++)] <= 63);
 
     nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
-    nbytesdecoded = ((nprbytes + 3) / 4) * 3;
+    nbytesdecoded = (((int)nprbytes + 3) / 4) * 3;
 
     return nbytesdecoded + 1;
 }
@@ -148,12 +148,12 @@
     int nbytesdecoded;
     register const unsigned char *bufin;
     register unsigned char *bufout;
-    register int nprbytes;
+    register apr_size_t nprbytes;
 
     bufin = (const unsigned char *) bufcoded;
     while (pr2six[*(bufin++)] <= 63);
     nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
-    nbytesdecoded = ((nprbytes + 3) / 4) * 3;
+    nbytesdecoded = (((int)nprbytes + 3) / 4) * 3;
 
     bufout = (unsigned char *) bufplain;
     bufin = (const unsigned char *) bufcoded;
@@ -183,7 +183,7 @@
 	    (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
     }
 
-    nbytesdecoded -= (4 - nprbytes) & 3;
+    nbytesdecoded -= (4 - (int)nprbytes) & 3;
     return nbytesdecoded;
 }
 
@@ -264,5 +264,5 @@
     }
 
     *p++ = '\0';
-    return p - encoded;
+    return (int)(p - encoded);
 }