codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] mod_deflate: hardcoded "%ld" -> APR_OFF_T_FMT


mod_deflates hard-codes some off_t format directives to "%ld".
It seems to me this code should use the macro provided by APR instead.

Looking for another pair of eyes. Does this patch look good to commit?

Index: modules/filters/mod_deflate.c
===================================================================
--- modules/filters/mod_deflate.c	(revision 1849023)
+++ modules/filters/mod_deflate.c	(working copy)
@@ -893,7 +893,8 @@ static apr_status_t deflate_out_filter(ap_filter_t
                                        f->c->bucket_alloc);
             APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01384)
-                          "Zlib: Compressed %ld to %ld : URL %s",
+                          "Zlib: Compressed %" APR_OFF_T_FMT
+			  " to %" APR_OFF_T_FMT " : URL %s",
                           ctx->stream.total_in, ctx->stream.total_out, r->uri);
 
             /* leave notes for logging */
@@ -1438,7 +1439,8 @@ static apr_status_t deflate_in_filter(ap_filter_t
                 ctx->validation_buffer_length += valid;
 
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01393)
-                              "Zlib: Inflated %ld to %ld : URL %s",
+                              "Zlib: Inflated %" APR_OFF_T_FMT
+			      " to %" APR_OFF_T_FMT " : URL %s",
                               ctx->stream.total_in, ctx->stream.total_out,
                               r->uri);
 
@@ -1459,7 +1461,8 @@ static apr_status_t deflate_in_filter(ap_filter_t
                     if ((ctx->stream.total_out & 0xFFFFFFFF) != compLen) {
                         inflateEnd(&ctx->stream);
                         ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01395)
-                                      "Zlib: Length %ld of inflated data does "
+                                      "Zlib: Length %" APR_OFF_T_FMT
+				      " of inflated data does "
                                       "not match expected value %ld",
                                       ctx->stream.total_out, compLen);
                         return APR_EGENERAL;
@@ -1628,7 +1631,8 @@ static apr_status_t inflate_out_filter(ap_filter_t
              */
             flush_libz_buffer(ctx, c, inflate, Z_SYNC_FLUSH, UPDATE_CRC);
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01398)
-                          "Zlib: Inflated %ld to %ld : URL %s",
+                          "Zlib: Inflated %" APR_OFF_T_FMT
+			  " to %" APR_OFF_T_FMT " : URL %s",
                           ctx->stream.total_in, ctx->stream.total_out, r->uri);
 
             if (ctx->validation_buffer_length == VALIDATION_SIZE) {