lkml.org 
[lkml]   [2005]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/13] FAT: IS_BADCHAR/IS_REPLACECHR/IS_SKIPCHAR cleanup
On Tue, Jan 18, 2005 at 02:41:05AM +0900, OGAWA Hirofumi wrote:
> +static inline wchar_t vfat_bad_char(wchar_t w)
> +{
> + return (w < 0x0020)
> + || (w == 0x002A) /* * */ || (w == 0x003F) /* ? */
> + || (w == 0x003C) /* < */ || (w == 0x003E) /* > */
> + || (w == 0x007C) /* | */ || (w == 0x0022) /* " */
> + || (w == 0x003A) /* : */ || (w == 0x002F) /* / */
> + || (w == 0x005C);/* \ */
> +}

Ugh... What's wrong with comparison to '*', '<', etc.? All values are
below 0x80, so signedness of char doesn't matter and when they get
promoted to int, they will give you the values you want...

> +static inline wchar_t vfat_replace_char(wchar_t w)
> +{
> + return (w == 0x005B) /* [ */ || (w == 0x005D) /* ] */
> + || (w == 0x003B) /* ; */ || (w == 0x002C) /* , */
> + || (w == 0x002B) /* + */ || (w == 0x003D);/* = */
> +}

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

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.059 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site