subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1616630 - in /subversion/branches/svn-auth-x509/subversion/libsvn_subr: x509.h x509parse.c
Date Thu, 07 Aug 2014 23:30:52 GMT
Author: breser
Date: Thu Aug  7 23:30:52 2014
New Revision: 1616630

URL: http://svn.apache.org/r1616630
Log:
Fix compiler warning about sign conversion when compare the len variable
to the actual length by subtracting pointers.

* subversion/libsvn_subr/x509.h
  (x509_buf): Switch len member from apr_size_t to ptrdiff_t.

* subversion/libsvn_subr/x509parse.c
  (asn1_get_len, asn1_get_tag, asn1_get_int, x509_get_version, x509_get_alg,
   x509_get_name, x509_get_date, x509_get_dates, x509_get_sig, x509_get_ext,
   svn_x509_parse_cert): Change length variables to use ptrdiff_t instead of
    apr_size_t.

Modified:
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h?rev=1616630&r1=1616629&r2=1616630&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h Thu Aug  7 23:30:52 2014
@@ -35,6 +35,7 @@
 #ifndef SVN_LIBSVN_SUBR_X509_H
 #define SVN_LIBSVN_SUBR_X509_H
 
+#include <stddef.h>
 #include <apr_time.h>
 
 /*
@@ -84,7 +85,7 @@ extern "C" {
  */
 typedef struct _x509_buf {
   int tag;
-  apr_size_t len;
+  ptrdiff_t len;
   const unsigned char *p;
 } x509_buf;
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c?rev=1616630&r1=1616629&r2=1616630&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c Thu Aug  7 23:30:52
2014
@@ -67,7 +67,7 @@
  */
 static svn_error_t *
 asn1_get_len(const unsigned char **p, const unsigned char *end,
-             apr_size_t *len)
+             ptrdiff_t *len)
 {
   if ((end - *p) < 1)
     return svn_error_create(SVN_ERR_ASN1_OUT_OF_DATA, NULL, NULL);
@@ -106,7 +106,7 @@ asn1_get_len(const unsigned char **p, co
 
 static svn_error_t *
 asn1_get_tag(const unsigned char **p,
-             const unsigned char *end, apr_size_t *len, int tag)
+             const unsigned char *end, ptrdiff_t *len, int tag)
 {
   if ((end - *p) < 1)
     return svn_error_create(SVN_ERR_ASN1_OUT_OF_DATA, NULL, NULL);
@@ -122,7 +122,7 @@ asn1_get_tag(const unsigned char **p,
 static svn_error_t *
 asn1_get_int(const unsigned char **p, const unsigned char *end, int *val)
 {
-  apr_size_t len;
+  ptrdiff_t len;
 
   SVN_ERR(asn1_get_tag(p, end, &len, ASN1_INTEGER));
 
@@ -146,7 +146,7 @@ static svn_error_t *
 x509_get_version(const unsigned char **p, const unsigned char *end, int *ver)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
 
   err = asn1_get_tag(p, end, &len,
                      ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED | 0);
@@ -220,7 +220,7 @@ static svn_error_t *
 x509_get_alg(const unsigned char **p, const unsigned char *end, x509_buf * alg)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
 
   err = asn1_get_tag(p, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
   if (err)
@@ -272,7 +272,7 @@ x509_get_name(const unsigned char **p, c
               x509_name * cur, apr_pool_t *result_pool)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
   const unsigned char *end2;
   x509_buf *oid;
   x509_buf *val;
@@ -363,7 +363,7 @@ x509_get_date(apr_time_t *when,
   svn_error_t *err;
   apr_status_t ret;
   int tag;
-  apr_size_t len;
+  ptrdiff_t len;
   char *date;
   apr_time_exp_t xt = { 0 };
   char tz;
@@ -450,7 +450,7 @@ x509_get_dates(apr_time_t *from,
                apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
 
   err = asn1_get_tag(p, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
   if (err)
@@ -475,7 +475,7 @@ static svn_error_t *
 x509_get_sig(const unsigned char **p, const unsigned char *end, x509_buf * sig)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
 
   sig->tag = **p;
 
@@ -536,7 +536,7 @@ x509_get_ext(apr_array_header_t *dnsname
              const unsigned char *end)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
 
   if (*p == end)
     return SVN_NO_ERROR;
@@ -567,7 +567,7 @@ x509_get_ext(apr_array_header_t *dnsname
 
   while (*p < end)
     {
-      apr_size_t ext_len;
+      ptrdiff_t ext_len;
       const unsigned char *ext_start, *sna_end;
       err = asn1_get_tag(p, end, &ext_len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
       if (err)
@@ -1029,7 +1029,7 @@ svn_x509_parse_cert(svn_x509_certinfo_t 
                     apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
-  apr_size_t len;
+  ptrdiff_t len;
   const unsigned char *p;
   const unsigned char *end;
   x509_cert *crt;



Mime
View raw message