Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 10700 invoked by uid 6000); 7 Jul 1998 18:01:10 -0000 Received: (qmail 10689 invoked from network); 7 Jul 1998 18:01:09 -0000 Received: from twinlark.arctic.org (204.62.130.91) by taz.hyperreal.org with SMTP; 7 Jul 1998 18:01:09 -0000 Received: (qmail 14738 invoked by uid 500); 7 Jul 1998 18:01:02 -0000 Date: Tue, 7 Jul 1998 11:01:02 -0700 (PDT) From: Dean Gaudet To: new-httpd@apache.org Subject: Re: PR 2553 and 2282 In-Reply-To: <9807071055.aa09310@paris.ics.uci.edu> Message-ID: X-Comment: Visit http://www.arctic.org/~dgaudet/legal for information regarding copyright and disclaimer. MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org On Tue, 7 Jul 1998, Roy T. Fielding wrote: > Shouldn't (unsigned) be (unsigned char), as in Both work, but (unsigned char)c can introduce an extra (c & 0xff) when c is actually an int (because the cast to char has to loose the high bits, and the compiler can't prove that they're already zero in general)... whereas (unsigned)(c) does nothing for ints (we assume they're already in 0..0xff), and zero extends chars (which is what we want -- rather than sign extend). Dean, performance freak > > #define ap_isalnum(c) (isalnum(((unsigned char)(c))) > #define ap_isalpha(c) (isalpha(((unsigned char)(c))) > #define ap_iscntrl(c) (iscntrl(((unsigned char)(c))) > #define ap_isdigit(c) (isdigit(((unsigned char)(c))) > #define ap_isgraph(c) (isgraph(((unsigned char)(c))) > #define ap_islower(c) (islower(((unsigned char)(c))) > #define ap_isprint(c) (isprint(((unsigned char)(c))) > #define ap_ispunct(c) (ispunct(((unsigned char)(c))) > #define ap_isspace(c) (isspace(((unsigned char)(c))) > #define ap_isupper(c) (isupper(((unsigned char)(c))) > > or is the potential lack of (unsigned char) the problem? > Color me confused. > > ....Roy [resisting the temptation to comment on casts, almost] >