lkml.org 
[lkml]   [2010]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] x86, setup: reorgize the early_console_setup
On 08/02/2010 12:09 PM, Thiago Farina wrote:
> On Mon, Aug 2, 2010 at 3:27 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>> On 08/02/2010 10:56 AM, Thiago Farina wrote:
>>>
>>> These to functions above can be fairly simplified by writting as:
>>>
>>> static bool inline is_hex_digit(int c) {
>>> return (c >= '0' && c <= '9') ||
>>> (c >= 'A' && c <= 'F') ||
>>> (c >= 'a' && c <= 'f');
>>> }
>>>
>>
>> a) You lose the isdigit() functionality, which is useful on its own.
>> b) Does this enahance readability in any way?
>> c) Your proposed renaming is nonstandard.
>>
>
> What about this instead?
>
> static inline bool isxdigit(int ch) {
> return (isdigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f');
> }
>
>> As such, I don't think this is a good idea.
>>

Again, I don't think it adds any readability; the compiler will produce
the same code.

-hpa


\
 
 \ /
  Last update: 2010-08-02 22:37    [W:0.059 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site