httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject [PATCH] fix mod_dav warning
Date Fri, 23 Feb 2001 12:03:47 GMT
gcc complains about wrong format (%ld -- long int) for range_start and
range_end.

range_start and range_end are off_t.

off_t is 64 bit on FreeBSD 3.4.

APR_OFF_T_FMT is correct for off_t on any platform where off_t is
defined since apr_off_t is off_t on such platforms.

mod_dav only compiles on platforms where off_t is defined.

Thus APR_OFF_T_FMT is correct for range_start and range_end.

But maybe Greg prefers a different solution?  

I'm a little uncomfortable with the use of an APR _FMT with a non-APR 
type, but I have no interest at the present time in changing DAV to
use apr_off_t instead of off_t.

Index: mod_dav.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/dav/main/mod_dav.c,v
retrieving revision 1.48
diff -u -r1.48 mod_dav.c
--- mod_dav.c   2001/02/16 04:26:35     1.48
+++ mod_dav.c   2001/02/23 11:56:05
@@ -835,7 +835,7 @@
             r->status = HTTP_PARTIAL_CONTENT;
             apr_table_setn(r->headers_out,
                           "Content-Range",
-                          apr_psprintf(r->pool, "bytes %ld-%ld/*",
+                          apr_psprintf(r->pool, "bytes %" APR_OFF_T_FMT "-%" APR_OFF_T_FMT
"/*",
                                       range_start, range_end));
             ap_set_content_length(r, range_end - range_start + 1);
         } 

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message