[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] add new module filevercmp
From: |
Jim Meyering |
Subject: |
Re: [PATCH] add new module filevercmp |
Date: |
Sat, 27 Sep 2008 13:14:31 +0200 |
Bruno Haible <address@hidden> wrote:
> Jim Meyering wrote:
>> To have any hope of sanity/reproducibility in different locales,
>> this function must return the same result, regardless of the current
>> locale settings.
>
> Yes. In the opposite case, if the function was to handle non-ASCII letters
> like ASCII letters, it should also have a codepath for multibyte locales.
>
>> I suggest using this macro in place of ISDIGIT:
>>
>> #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
>
> This is equivalent to the c_isdigit macro from "c-ctype.h", assuming the
> normal compiler optimizations. gcc yields identical code for ISDIGIT as for
> c_isdigit.
Good to know.
In that case, of course, it's better to use c_isdigit.
Re: [PATCH] add new module filevercmp, Bruno Haible, 2008/09/24