serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1774378 - in /serf/trunk/buckets: hpack_buckets.c log_wrapper_buckets.c mmap_buckets.c ssl_buckets.c
Date Thu, 15 Dec 2016 07:17:25 GMT
Author: brane
Date: Thu Dec 15 07:17:25 2016
New Revision: 1774378

URL: http://svn.apache.org/viewvc?rev=1774378&view=rev
Log:
Fix some compilation warnings.

* buckets/hpack_buckets.c (handle_read_entry_and_clear):
   The precision argument for printf format "%.*" must be an int.

* buckets/log_wrapper_buckets.c
  (serf_log_wrapped_readline,
   serf_log_wrapped_read_iovec,
   serf_log_wrapped_read): Likewise.

* buckets/ssl_buckets.c
  (ssl_decrypt, ssl_encrypt): Likelwise.

* buckets/mmap_buckets.c
  (serf_mmap_read,
   serf_mmap_readline,
   serf_mmap_peek): Fix pointer types in output arguments.

Modified:
    serf/trunk/buckets/hpack_buckets.c
    serf/trunk/buckets/log_wrapper_buckets.c
    serf/trunk/buckets/mmap_buckets.c
    serf/trunk/buckets/ssl_buckets.c

Modified: serf/trunk/buckets/hpack_buckets.c
URL: http://svn.apache.org/viewvc/serf/trunk/buckets/hpack_buckets.c?rev=1774378&r1=1774377&r2=1774378&view=diff
==============================================================================
--- serf/trunk/buckets/hpack_buckets.c (original)
+++ serf/trunk/buckets/hpack_buckets.c Thu Dec 15 07:17:25 2016
@@ -1402,7 +1402,7 @@ handle_read_entry_and_clear(serf_hpack_d
 
     serf__log(LOGLVL_INFO, SERF_LOGCOMP_PROTOCOL, __FILE__, ctx->config,
               "Parsed from HPACK: %.*s: %.*s\n",
-              ctx->key_size, ctx->key, ctx->val_size, ctx->val);
+              (int)ctx->key_size, ctx->key, (int)ctx->val_size, ctx->val);
 
     if (!ctx->headers)
     {

Modified: serf/trunk/buckets/log_wrapper_buckets.c
URL: http://svn.apache.org/viewvc/serf/trunk/buckets/log_wrapper_buckets.c?rev=1774378&r1=1774377&r2=1774378&view=diff
==============================================================================
--- serf/trunk/buckets/log_wrapper_buckets.c (original)
+++ serf/trunk/buckets/log_wrapper_buckets.c Thu Dec 15 07:17:25 2016
@@ -61,7 +61,7 @@ serf_log_wrapped_readline(serf_bucket_t
         serf__log(LOGLVL_DEBUG, LOGCOMP_CONN, ctx->prefix, ctx->config,
                   "--- %"APR_SIZE_T_FMT" bytes. --\n", *len);
         serf__log(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->prefix, ctx->config,
-                  "%.*s\n", *len, *data);
+                  "%.*s\n", (int)*len, *data);
     }
 
     return status;
@@ -93,7 +93,7 @@ serf_log_wrapped_read_iovec(serf_bucket_
 
     for (i = 0; i < *vecs_used; i++) {
         serf__log_nopref(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->config,
-                         "%.*s", vecs[i].iov_len, vecs[i].iov_base);
+                         "%.*s", (int)vecs[i].iov_len, vecs[i].iov_base);
     }
     serf__log_nopref(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->config, "\n");
 
@@ -116,7 +116,7 @@ serf_log_wrapped_read(serf_bucket_t *buc
         serf__log(LOGLVL_DEBUG, LOGCOMP_CONN, ctx->prefix, ctx->config,
                   "--- %"APR_SIZE_T_FMT" bytes. --\n", *len);
         serf__log(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->prefix, ctx->config,
-                  "%.*s\n", *len, *data);
+                  "%.*s\n", (int)*len, *data);
     }
 
     return status;

Modified: serf/trunk/buckets/mmap_buckets.c
URL: http://svn.apache.org/viewvc/serf/trunk/buckets/mmap_buckets.c?rev=1774378&r1=1774377&r2=1774378&view=diff
==============================================================================
--- serf/trunk/buckets/mmap_buckets.c (original)
+++ serf/trunk/buckets/mmap_buckets.c Thu Dec 15 07:17:25 2016
@@ -55,7 +55,7 @@ static apr_status_t serf_mmap_read(serf_
 {
     mmap_context_t *ctx = bucket->data;
     apr_status_t status;
-    char *rd;
+    void *rd;
 
     if (requested == SERF_READ_ALL_AVAIL || requested > ctx->remaining) {
         *len = ctx->remaining;
@@ -87,18 +87,19 @@ static apr_status_t serf_mmap_readline(s
 {
     mmap_context_t *ctx = bucket->data;
     apr_status_t status;
-    char *end;
+    const char *eol;
+    void *end;
 
     /* ### Would it be faster to call this once and do the offset ourselves? */
     status = apr_mmap_offset(&end, ctx->mmap, ctx->offset);
     if (SERF_BUCKET_READ_ERROR(status))
         return status;
 
-    *data = end;
+    *data = eol = end;
 
     *len = ctx->remaining;
-    serf_util_readline(&end, len, acceptable, found);
-    *len = end - *data;
+    serf_util_readline(&eol, len, acceptable, found);
+    *len = eol - *data;
 
     ctx->offset += *len;
     ctx->remaining -= *len;
@@ -115,7 +116,7 @@ static apr_status_t serf_mmap_peek(serf_
 {
     mmap_context_t *ctx = bucket->data;
     apr_status_t status;
-    char *rd;
+    void *rd;
 
     /* return whatever we have left */
     status = apr_mmap_offset(&rd, ctx->mmap, ctx->offset);

Modified: serf/trunk/buckets/ssl_buckets.c
URL: http://svn.apache.org/viewvc/serf/trunk/buckets/ssl_buckets.c?rev=1774378&r1=1774377&r2=1774378&view=diff
==============================================================================
--- serf/trunk/buckets/ssl_buckets.c (original)
+++ serf/trunk/buckets/ssl_buckets.c Thu Dec 15 07:17:25 2016
@@ -1098,7 +1098,7 @@ static apr_status_t ssl_decrypt(void *ba
         *len = ssl_len;
         status = ctx->crypt_status;
         serf__log(LOGLVL_DEBUG, LOGCOMP_SSLMSG, __FILE__, ctx->config,
-                    "---\n%.*s\n-(%"APR_SIZE_T_FMT")-\n", *len, buf, *len);
+                  "---\n%.*s\n-(%"APR_SIZE_T_FMT")-\n", (int)*len, buf, *len);
     }
 
 
@@ -1265,7 +1265,7 @@ static apr_status_t ssl_encrypt(void *ba
 
                     serf__log(LOGLVL_DEBUG, LOGCOMP_SSL, __FILE__, ctx->config,
                               "---\n%.*s\n-(%"APR_SIZE_T_FMT")-\n",
-                              interim_len, vecs_data, interim_len);
+                              (int)interim_len, vecs_data, interim_len);
 
                 }
             }



Mime
View raw message