[tz] disclaimer removals
Ian Abbott
abbotti at mev.co.uk
Thu Jun 26 17:03:55 UTC 2014
On 2014/06/26 05:56 PM, Ian Abbott wrote:
> On 2014/06/26 05:05 PM, Andreas Schwab wrote:
>> "Clive D.W. Feather" <clive at davros.org> writes:
>>
>>> isascii isn't part of the C Standard. It is better to follow C, which says
>>> that the argument to all the is* functions should be an unsigned char or
>>> EOF (which is what getc() and friends return).
>>
>> It says that only about the functions that the C Standard defines.
>
> zic.c will define isascii (as a function-like macro) if it doesn't
> exist. Unfortunately, it defines it like this:
>
> #ifndef isascii
> #define isascii(x) 1
> #endif
>
> which is pretty useless. This would be more useful:
>
> #define isascii(x) (!((x) & ~0x7f))
>
> or possibly:
>
> #define isascii(x) ((unsigned char)(x) < 128)
Scrub that last possible definition with the cast to (unsigned char).
It was a bit of a braino on my part as it doesn't work for all int
values as isascii is supposed to.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti at mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
More information about the tz
mailing list