From: Jacek Caban Subject: Re: [RFC PATCH 3/9] ntdll: Fix functions that depend on wctype table. Message-Id: Date: Thu, 9 Jan 2020 16:14:14 +0100 In-Reply-To: References: <20200109065349.2549777-1-whydoubt@gmail.com> <20200109065349.2549777-3-whydoubt@gmail.com> On 09.01.2020 16:09, Jacek Caban wrote: > 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. Also, this patch needs a careful review of code that uses those function, most notably kernelbase.dll. A quick look suggests that it depends on working at least iswalpha for values above 255, so it will need to be changed first. Thanks, Jacek