Re: [x86 setup 20/33] Console-writing code for the new x86 setup code

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

 



Jan Engelhardt wrote:
> On Jul 9 2007 19:51, H. Peter Anvin wrote:
>> +
>> +static inline int isdigit(int ch)
>> +{
>> +	return (ch >= '0') && (ch <= '9');
>> +}
> 
> I'd say static inline unsigned int isdigit(unsigned char), since ASCII does not
> realistically exceed 255.

If you're trying to be standard, you're doing the wrong thing (the
standard is int, since -1 is a permitted value.)

It doesn't matter anyway, and your version would probably generate
slightly worse code.

>> +static int strnlen(const char *s, int maxlen)
> 
> unsigned int,  and               unsigned int, too?
> The glibc strnlen type also uses unsigned types.

If anything it should be size_t.  Fixing, and moved to string.c, where
it belongs.

	-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux