httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@mch.sni.de>
Subject Re: cvs commit: apache-1.3/src/main util.c
Date Sun, 15 Mar 1998 20:02:59 GMT
>   -#define TEST_CHAR(c, f)	(test_char_table[((unsigned char)(c)) & 0xff] & (f))
>   +/* we assume the folks using this ensure the char < 256 */
>   +#define TEST_CHAR(c, f)	(test_char_table[(unsigned)(c)] & (f))

Wouldn't it have been sufficient to simply remove the "& 0xFF" part?
The (unsigned char) cast guarantees results between 0 and 255 anyway.
The new version doesn't guarantee an index in the range 0..255 any longer,
since the sign expansion of a (signed) char is done before the cast to
unsigned. So '\377'  ->  -1  ->  0xFFFFFFFFU now.

    Martin
-- 
| S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Mime
View raw message