Am 09.08.2011 19:33, schrieb Rich Felker:
> On Tue, Aug 09, 2011 at 09:37:58AM +0200, Denys Vlasenko wrote:
>> #define isalnum(a) bb_ascii_isalnum(a)
>> static ALWAYS_INLINE int bb_ascii_isalnum(unsigned char a)
>> {
>>         unsigned char b = a - '0';
>>         if (b <= 9)
>>                 return (b <= 9);
>>         b = (a|0x20) - 'a';
>>         return b <= 'z' - 'a';
>> }
> 
> I'm scared to ask why this is written in such an obfuscated way rather
> than just
> 
> return a-'0'<10U || (a|32)-'a'<26U;

It could also take a comment as to how EOF is handled... (implicitly
because it wraps to 0xff which is outside the tested ranges) -- and note
it will fail horribly if it's referenced before the definition.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to