make_unicode: Store the C2_* values directly in the kernel32 wctype table.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-05-22 11:26:19 +02:00
parent f09dade9cb
commit 02a04ba05e
3 changed files with 423 additions and 416 deletions

View File

@ -3067,26 +3067,6 @@ DWORD WINAPI VerLanguageNameW( DWORD wLang, LPWSTR szLang, DWORD nSize )
*/
BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype )
{
static const unsigned char type2_map[16] =
{
C2_NOTAPPLICABLE, /* unassigned */
C2_LEFTTORIGHT, /* L */
C2_RIGHTTOLEFT, /* R */
C2_EUROPENUMBER, /* EN */
C2_EUROPESEPARATOR, /* ES */
C2_EUROPETERMINATOR, /* ET */
C2_ARABICNUMBER, /* AN */
C2_COMMONSEPARATOR, /* CS */
C2_BLOCKSEPARATOR, /* B */
C2_SEGMENTSEPARATOR, /* S */
C2_WHITESPACE, /* WS */
C2_OTHERNEUTRAL, /* ON */
C2_RIGHTTOLEFT, /* AL */
C2_NOTAPPLICABLE, /* NSM */
C2_NOTAPPLICABLE, /* BN */
C2_OTHERNEUTRAL /* LRE, LRO, RLE, RLO, PDF */
};
if (!src)
{
SetLastError( ERROR_INVALID_PARAMETER );
@ -3100,7 +3080,7 @@ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype
while (count--) *chartype++ = get_wctype( *src++ ) & 0xfff;
break;
case CT_CTYPE2:
while (count--) *chartype++ = type2_map[get_wctype( *src++ ) >> 12];
while (count--) *chartype++ = get_wctype( *src++ ) >> 12;
break;
case CT_CTYPE3:
{

File diff suppressed because it is too large Load Diff

View File

@ -336,6 +336,33 @@ my %directions =
"PDI" => 15 # Pop Directional Isolate
);
my %c2_types =
(
"L" => 1, # C2_LEFTTORIGHT
"R" => 2, # C2_RIGHTTOLEFT
"AL" => 2, # C2_RIGHTTOLEFT
"EN" => 3, # C2_EUROPENUMBER
"ES" => 4, # C2_EUROPESEPARATOR
"ET" => 5, # C2_EUROPETERMINATOR
"AN" => 6, # C2_ARABICNUMBER
"CS" => 7, # C2_COMMONSEPARATOR
"NSM" => 0, # C2_NOTAPPLICABLE
"BN" => 0, # C2_NOTAPPLICABLE
"B" => 8, # C2_BLOCKSEPARATOR
"S" => 9, # C2_SEGMENTSEPARATOR
"WS" => 10, # C2_WHITESPACE
"ON" => 11, # C2_OTHERNEUTRAL
"LRE" => 11, # C2_OTHERNEUTRAL
"LRO" => 11, # C2_OTHERNEUTRAL
"RLE" => 11, # C2_OTHERNEUTRAL
"RLO" => 11, # C2_OTHERNEUTRAL
"PDF" => 11, # C2_OTHERNEUTRAL
"LRI" => 11, # C2_OTHERNEUTRAL
"RLI" => 11, # C2_OTHERNEUTRAL
"FSI" => 11, # C2_OTHERNEUTRAL
"PDI" => 11 # C2_OTHERNEUTRAL
);
my %joining_types =
(
"U" => 0, # Non_Joining
@ -2194,7 +2221,7 @@ sub dump_string_type_table($)
# add the direction in the high 4 bits of the category
for (my $i = 0; $i < 65536; $i++)
{
$table[$i] |= $directions{$direction_table[$i]} << 12 if defined $direction_table[$i];
$table[$i] |= $c2_types{$direction_table[$i]} << 12 if defined $direction_table[$i];
}
dump_simple_mapping( "DECLSPEC_HIDDEN wctype_table", 0, @table );