Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/gen



On Thu, Apr 17, 2008 at 04:24:40PM +0000, Alan Barrett wrote:
> 
> * Use toupper((int)(unsigned char)*s)) instead of just
>   toupper((unsigned char)*s) in an example.

Why is the (int) cast needed.
The code is ugly enough without it.

I wonder if we should have defined some alternate functions/defines [1]
that exclude EOF from the domain, and can thus include the mask/cast
internally.

When I added all the (unsigned char) casts I don't remember finding
a single place where EOF could be passed to any of the ctype functions.

        David

[1] picking a name is the hard part :-)

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index