[RFC PATCH 3/9] ntdll: Fix functions that depend on wctype table.

Jacek Caban jacek at codeweavers.com
Thu Jan 9 09:09:31 CST 2020


Hi Jeff,

On 09.01.2020 07:53, Jeff Smith wrote:
> +/* Some abbreviations to make the following table readable */
> +#define_C_  C1_CNTRL
> +#define_S_  C1_SPACE
> +#define_P_  C1_PUNCT
> +#define_D_  C1_DIGIT
> +#define_H_  C1_XDIGIT
> +#define_U_  C1_UPPER|C1_ALPHA
> +#define_L_  C1_LOWER|C1_ALPHA
> +#define_B_  C1_BLANK
> +
> +static const WORD NTDLL_wctype [256] = {
> +_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_S_|_C_|_B_,_S_|_C_,_S_|_C_,
> +_S_|_C_,_S_|_C_,_C_,_C_,
> +_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,
> +_S_|_B_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,
> +_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,_D_|_H_,
> +_P_,_P_,_P_,_P_,_P_,_P_,
> +_P_,_U_|_H_,_U_|_H_,_U_|_H_,_U_|_H_,_U_|_H_,_U_|_H_,_U_,_U_,_U_,_U_,_U_,
> +_U_,_U_,_U_,_U_,
> +_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_P_,_P_,_P_,_P_,_P_,
> +_P_,_L_|_H_,_L_|_H_,_L_|_H_,_L_|_H_,_L_|_H_,_L_|_H_,_L_,_L_,_L_,_L_,_L_,
> +_L_,_L_,_L_,_L_,
> +_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_P_,_P_,_P_,_P_,_C_,
> +_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,
> +_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,_C_,
> +_S_|_B_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,_P_,
> +_P_,_P_,_P_|_D_,_P_|_D_,_P_,_P_,_P_,_P_,_P_,_P_|_D_,_P_,_P_,_P_,_P_,_P_,_P_,
> +_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,
> +_U_,_U_,_U_,_U_,_U_,_U_,_U_,_P_,_U_,_U_,_U_,_U_,_U_,_U_,_U_,_L_,
> +_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,
> +_L_,_L_,_L_,_L_,_L_,_L_,_L_,_P_,_L_,_L_,_L_,_L_,_L_,_L_,_L_,_L_
> +};


Those macros don't really make the table much more readable, IMHO. You 
could just use numeric literals and make it more compact. In fact, you 
could probably just copy the first chunk of wctype_table from 
kernelbase/wctype.c.


Thanks,

Jacek




More information about the wine-devel mailing list