| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| NNTP-Posting-Date: | Sat, 25 Dec 2004 05:57:34 -0600 |
| Date: | Sat, 25 Dec 2004 06:57:44 -0500 |
| From: | Joe Wright <joewwright AT comcast DOT net> |
| User-Agent: | Mozilla Thunderbird 0.9 (Windows/20041103) |
| X-Accept-Language: | en-us, en |
| MIME-Version: | 1.0 |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: CTYPE stuff for Eli or DJ |
| References: | <KpSdnePxHo9G_VHcRVn-oQ AT comcast DOT com> <200412241848 DOT iBOImiRM013524 AT envy DOT delorie DOT com> <Ub6dnQHCSdfA-lHcRVn-1w AT comcast DOT com> <200412241919 DOT iBOJJnq5014101 AT envy DOT delorie DOT com> <ZrGdnQaTgL1eIlHcRVn-vg AT comcast DOT com> <01c4ea6a$Blat.v2.2.2$88d35240 AT zahav DOT net DOT il> |
| In-Reply-To: | <01c4ea6a$Blat.v2.2.2$88d35240@zahav.net.il> |
| Message-ID: | <fe-dnemo0_kzyFDcRVn-2A@comcast.com> |
| Lines: | 23 |
| NNTP-Posting-Host: | 69.143.13.12 |
| X-Trace: | sv3-caH7oEpeZ9ykXWBVrqBVfabRtbde8mzEfCR9bevcJP55qcseeO4EpbWze42dvCN37CYgTvUal85Runz!UL1Sez9I7HOuU1xhoYQ3UYYHe6eoW+W51YW0DO/86NMUfGjerifxre5z2v5v |
| X-Complaints-To: | abuse AT comcast DOT net |
| X-DMCA-Complaints-To: | dmca AT comcast DOT net |
| X-Abuse-and-DMCA-Info: | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info: | Otherwise we will be unable to process your complaint properly |
| X-Postfilter: | 1.3.22 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Eli Zaretskii wrote:
>>Date: Fri, 24 Dec 2004 20:18:03 -0500
>>From: Joe Wright <joewwright AT comcast DOT net>
>>
>>No need for that, I think. Consider..
>>
>>__dj_ctype_flags[(unsigned)(c) > 255 ? 0 : ((c)+1)]
>>
>>..which will allow 'int is*(int c)' to take any int, including EOF
>>and do the 'Wright' thing.
>
>
> How in the world returning 0 for out-of-range arguments is the Right
> Thing?
It's the right thing because the array itself has 257 elements of
unsigned short, element 0 being 0. Elements 1..256 have bits set (or
not) depending on the characteristics of characters 0..255, hence
the +1 in the macro. Out-of-range should return 0. What you return?
--
Joe Wright mailto:joewwright AT comcast DOT net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |