[mirrorbrain-commits] r8325 - /trunk/mod_mirrorbrain/mod_mirrorbrain.c

From: <poeml_at_mirrorbrain.org>
Date: Tue, 07 Jan 2014 23:17:33 -0000
Author: poeml
Date: Wed Jan  8 00:17:30 2014
New Revision: 8325

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8325&view=rev
Log:
mod_mirrorbrain: 
- silence compiler warnings about using %d for size_t, now using APR_SIZE_T_FMT
  in those places.

Modified:
    trunk/mod_mirrorbrain/mod_mirrorbrain.c

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=8325&r1=8324&r2=8325&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c	(original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c	Wed Jan  8 00:17:30 2014
_at_@ -1521,7 +1521,7 @@
                                     return HTTP_INTERNAL_SERVER_ERROR;
                                 } else if (nr > n_matches) {
                                     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "[mod_mirrorbrain] "
-                                            "cannot substitute $%d in '%s' -- only %d args are defined", 
+                                            "cannot substitute $%" APR_SIZE_T_FMT " in '%s' -- only %d args are defined", 
                                             nr, d, y.args->nelts);
                                     return HTTP_INTERNAL_SERVER_ERROR;
                                 }
_at_@ -1529,7 +1529,7 @@
                                 a = ((yumarg_t *) y.args->elts)[nr - 1];
                                 val = form_lookup(r, a.key);
 
-                                debugLog(r, cfg, "substituting $%d with '%s'", nr, val);
+                                debugLog(r, cfg, "substituting $%" APR_SIZE_T_FMT " with '%s'", nr, val);
                                 len = strlen(val);
                                 memcpy(dst, val, len);
                                 dst += len;
_at_@ -3252,24 +3252,24 @@
         char *tracker = ((char **) scfg->tracker_urls->elts)[0];
         ap_rprintf(r, "d"
                           "8:announce"
-                              "%d:%s", strlen(tracker), tracker);
+                              "%" APR_SIZE_T_FMT ":%s", strlen(tracker), tracker);
 
         ap_rputs(         "13:announce-listll", r);
         for (i = 0; i < scfg->tracker_urls->nelts; i++) {
             tracker = ((char **) scfg->tracker_urls->elts)[i];
-            ap_rprintf(r,     "%d:%s", strlen(tracker), tracker);
+            ap_rprintf(r,     "%" APR_SIZE_T_FMT ":%s", strlen(tracker), tracker);
         }
         ap_rputs(             "e"
                           "e", r);
 
         ap_rprintf(r,     "7:comment"
-                              "%d:%s", strlen(basename), basename);
+                              "%" APR_SIZE_T_FMT ":%s", strlen(basename), basename);
 
                           /* This is meant to be the creation time of the torrent, 
                            * but let's take the mtime of the file since we can generate the
                            * torrent any time */
         ap_rprintf(r,     "10:created by"
-                              "%d:MirrorBrain/%s", 
+                              "%" APR_SIZE_T_FMT ":MirrorBrain/%s", 
                               strlen("MirrorBrain/") + strlen(MOD_MIRRORBRAIN_VER), 
                               MOD_MIRRORBRAIN_VER);
         ap_rprintf(r,     "13:creation date"
_at_@ -3283,7 +3283,7 @@
         ap_rprintf(r,             "6:md5sum"
                                       "%d:%s", MD5_DIGESTSIZE * 2, hashbag->md5hex);
         ap_rprintf(r,             "4:name"
-                                      "%d:%s"
+                                      "%" APR_SIZE_T_FMT ":%s"
                                   "12:piece length"
                                       "i%de"
                                   "6:pieces"
_at_@ -3313,7 +3313,7 @@
                               "l", r);
             for (i = 0; i < scfg->dhtnodes->nelts; i++) {
                 dhtnode_t node = ((dhtnode_t *) scfg->dhtnodes->elts)[i];
-                ap_rprintf(r,     "l" "%d:%s" "i%de" "e", strlen(node.name), node.name, 
+                ap_rprintf(r,     "l" "%" APR_SIZE_T_FMT ":%s" "i%de" "e", strlen(node.name), node.name, 
                                                          node.port);
             }
             ap_rputs(     "e", r);
_at_@ -3337,7 +3337,7 @@
             for (i = 0; i < mirrors_same_prefix->nelts; i++, found_urls++) {
                 mirror = mirrorp[i];
                 APR_ARRAY_PUSH(m, char *) = 
-                    apr_psprintf(r->pool, "%d:%s%s", (strlen(mirror->baseurl) + strlen(filename)),
+                    apr_psprintf(r->pool, "%" APR_SIZE_T_FMT ":%s%s", (strlen(mirror->baseurl) + strlen(filename)),
                                                      mirror->baseurl, filename);
             }
             if (!found_urls) {
_at_@ -3345,7 +3345,7 @@
                 for (i = 0; i < mirrors_same_as->nelts; i++, found_urls++) {
                     mirror = mirrorp[i];
                     APR_ARRAY_PUSH(m, char *) = 
-                        apr_psprintf(r->pool, "%d:%s%s", (strlen(mirror->baseurl) + strlen(filename)),
+                        apr_psprintf(r->pool, "%" APR_SIZE_T_FMT ":%s%s", (strlen(mirror->baseurl) + strlen(filename)),
                                                          mirror->baseurl, filename);
                 }
             }
_at_@ -3354,7 +3354,7 @@
                 for (i = 0; i < mirrors_same_country->nelts; i++, found_urls++) {
                     mirror = mirrorp[i];
                     APR_ARRAY_PUSH(m, char *) = 
-                        apr_psprintf(r->pool, "%d:%s%s", (strlen(mirror->baseurl) + strlen(filename)),
+                        apr_psprintf(r->pool, "%" APR_SIZE_T_FMT ":%s%s", (strlen(mirror->baseurl) + strlen(filename)),
                                                          mirror->baseurl, filename);
                 }
             }
_at_@ -3363,7 +3363,7 @@
                 for (i = 0; i < mirrors_same_region->nelts; i++, found_urls++) {
                     mirror = mirrorp[i];
                     APR_ARRAY_PUSH(m, char *) = 
-                        apr_psprintf(r->pool, "%d:%s%s", (strlen(mirror->baseurl) + strlen(filename)),
+                        apr_psprintf(r->pool, "%" APR_SIZE_T_FMT ":%s%s", (strlen(mirror->baseurl) + strlen(filename)),
                                                          mirror->baseurl, filename);
                 }
             }
_at_@ -3372,14 +3372,14 @@
                 for (i = 0; i < mirrors_elsewhere->nelts; i++, found_urls++) {
                     mirror = mirrorp[i];
                     APR_ARRAY_PUSH(m, char *) = 
-                        apr_psprintf(r->pool, "%d:%s%s", (strlen(mirror->baseurl) + strlen(filename)),
+                        apr_psprintf(r->pool, "%" APR_SIZE_T_FMT ":%s%s", (strlen(mirror->baseurl) + strlen(filename)),
                                                          mirror->baseurl, filename);
                 }
             }
             /* add the redirector, in case there wasn't any mirror */
             if (!found_urls) {
                 APR_ARRAY_PUSH(m, char *) = 
-                    apr_psprintf(r->pool, "%d:http://%s%s", (7 + strlen(r->hostname) + strlen(r->uri)), 
+                    apr_psprintf(r->pool, "%" APR_SIZE_T_FMT ":http://%s%s", (7 + strlen(r->hostname) + strlen(r->uri)), 
                                                             r->hostname, r->uri);
             }
 
_at_@ -3388,7 +3388,7 @@
              * retrieves a Metalink then and doesn't expect it in that situation. Maybe later */
             APR_ARRAY_PUSH(m, char *) = 
                 apr_psprintf(r->pool,     "8:url-list"
-                                          "%d:http://%s%s", (7 + strlen(r->hostname) + strlen(r->uri)), 
+                                          "%" APR_SIZE_T_FMT ":http://%s%s", (7 + strlen(r->hostname) + strlen(r->uri)), 
                                                             r->hostname, r->uri);
 #endif
 




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Jan 07 2014 - 23:17:42 GMT

This archive was generated by hypermail 2.3.0 : Tue Jan 07 2014 - 23:32:08 GMT