httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plüm, Rüdiger, VF-Group <ruediger.pl...@vodafone.com>
Subject Re: svn commit: r602503 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/http/http_etag.c
Date Tue, 11 Dec 2007 13:48:21 GMT


> -----Ursprüngliche Nachricht-----
> Von: William A. Rowe, Jr. 
> Gesendet: Montag, 10. Dezember 2007 22:23
> An: dev@httpd.apache.org
> Cc: cvs@httpd.apache.org
> Betreff: Re: svn commit: r602503 - in 
> /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/http/http_etag.c
> 
> 
> rpluem@apache.org wrote:
> > Author: rpluem
> > Date: Sat Dec  8 08:50:12 2007
> > New Revision: 602503
> > 
> > @@ -28,16 +28,16 @@
> >  #include "http_protocol.h"   /* For index_of_response().  Grump. */
> >  #include "http_request.h"
> >  
> > -/* Generate the human-readable hex representation of an 
> unsigned long
> > - * (basically a faster version of 'sprintf("%lx")')
> > +/* Generate the human-readable hex representation of an 
> apr_uint64_t
> > + * (basically a faster version of 'sprintf("%llx")')
> >   */
> >  #define HEX_DIGITS "0123456789abcdef"
> > -static char *etag_ulong_to_hex(char *next, unsigned long u)
> > +static char *etag_uint64_to_hex(char *next, apr_uint64_t u)
> >  {
> >      int printing = 0;
> > -    int shift = sizeof(unsigned long) * 8 - 4;
> > +    int shift = sizeof(apr_uint64_t) * 8 - 4;
> >      do {
> > -        unsigned long next_digit = ((u >> shift) & 
> (unsigned long)0xf);
> > +        unsigned short next_digit = ((u >> shift) & 
> (apr_uint64_t)0xf);
> 
> Folks, what's the desire to emit warning messages about our deliberate
> (unsigned short) truncation from an unsigned long value?
> 
> Mind adding the appropriate cast to quiet the build here on line 40?

I get no warning with gcc 3.4.6 here (currently cannot test with a more
recent version). But yes, a cast may make sense here. Joe?

Regards

Rüdiger


Mime
View raw message