You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against d318f43559dbb0093e22bab1aa0eb9dc01170cc2.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
From 96bd1ab47a39d621c5f63264fb4bc415164d371c Mon Sep 17 00:00:00 2001
|
||||
From e5ed00ac26224e2f7cc6e2ee769d254ead973ef2 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Maurer <dark.shadow4@web.de>
|
||||
Date: Fri, 10 Apr 2020 18:47:18 +0200
|
||||
Subject: [PATCH] kernelbase: Implement sortkey generation on official tables
|
||||
@ -10,7 +10,7 @@ Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
|
||||
2 files changed, 413 insertions(+), 123 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
|
||||
index 94c9ce3ad1b..8447e67486c 100644
|
||||
index 8f48b89334c..1ce19b5b418 100644
|
||||
--- a/dlls/kernel32/tests/locale.c
|
||||
+++ b/dlls/kernel32/tests/locale.c
|
||||
@@ -2560,6 +2560,13 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f
|
||||
@ -163,7 +163,7 @@ index 94c9ce3ad1b..8447e67486c 100644
|
||||
static void test_FoldStringA(void)
|
||||
{
|
||||
int ret, i, j;
|
||||
@@ -7201,6 +7337,7 @@ START_TEST(locale)
|
||||
@@ -7194,6 +7330,7 @@ START_TEST(locale)
|
||||
test_NLSVersion();
|
||||
test_geo_name();
|
||||
test_sorting();
|
||||
@ -172,7 +172,7 @@ index 94c9ce3ad1b..8447e67486c 100644
|
||||
test_EnumCalendarInfoW();
|
||||
test_EnumCalendarInfoExA();
|
||||
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
|
||||
index 667d1a4dc65..095e0a68558 100644
|
||||
index 2f2154a0e7c..c16535a5f1a 100644
|
||||
--- a/dlls/kernelbase/locale.c
|
||||
+++ b/dlls/kernelbase/locale.c
|
||||
@@ -2164,127 +2164,6 @@ static int wcstombs_codepage( UINT codepage, DWORD flags, const WCHAR *src, int
|
||||
@ -585,7 +585,7 @@ index 667d1a4dc65..095e0a68558 100644
|
||||
static const struct geoinfo *get_geoinfo_ptr( GEOID geoid )
|
||||
{
|
||||
@@ -5302,8 +5455,8 @@ INT WINAPI DECLSPEC_HOTPATCH LCMapStringEx( const WCHAR *locale, DWORD flags, co
|
||||
TRACE( "(%s,0x%08x,%s,%d,%p,%d)\n",
|
||||
TRACE( "(%s,0x%08lx,%s,%d,%p,%d)\n",
|
||||
debugstr_w(locale), flags, debugstr_wn(src, srclen), srclen, dst, dstlen );
|
||||
|
||||
- if ((ret = get_sortkey( flags, src, srclen, (char *)dst, dstlen ))) ret++;
|
||||
@ -596,5 +596,5 @@ index 667d1a4dc65..095e0a68558 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
2.34.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 1ef8d8455449563aaa1d3c9ce16444134f3a9ef4 Mon Sep 17 00:00:00 2001
|
||||
From 74ed8758a238f1747055b4c8fa78edc2d5e7aba9 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Maurer <dark.shadow4@web.de>
|
||||
Date: Sat, 8 Aug 2020 17:32:56 +0200
|
||||
Subject: [PATCH] kernelbase: Implement sortkey language support
|
||||
@ -10,10 +10,10 @@ Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
|
||||
2 files changed, 109 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
|
||||
index e8adb32bbbd..e4a31c120f0 100644
|
||||
index 0aaa87e38c1..84931318075 100644
|
||||
--- a/dlls/kernel32/tests/locale.c
|
||||
+++ b/dlls/kernel32/tests/locale.c
|
||||
@@ -3335,6 +3335,56 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
|
||||
@@ -3210,6 +3210,56 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
|
||||
{ L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\x0f75", L"\x0f71\x0f74" }, /* Expansion character always follow default character logic */
|
||||
{ L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\xfc5e", L"\x064c\x0651" }, /* Expansion character always follow default character logic */
|
||||
{ L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\xfb2b", L"\x05e9\x05c2" }, /* Expansion character always follow default character logic */
|
||||
@ -71,10 +71,10 @@ index e8adb32bbbd..e4a31c120f0 100644
|
||||
|
||||
static void test_unicode_sorting(void)
|
||||
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
|
||||
index da358d74934..ef135e48c2f 100644
|
||||
index e81ed0e0f2e..394912307a9 100644
|
||||
--- a/dlls/kernelbase/locale.c
|
||||
+++ b/dlls/kernelbase/locale.c
|
||||
@@ -2494,9 +2494,27 @@ struct sortkey_data
|
||||
@@ -2530,9 +2530,27 @@ struct sortkey_data
|
||||
int buffer_len;
|
||||
};
|
||||
|
||||
@ -104,7 +104,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
info->weight_case = value >> 24;
|
||||
info->weight_diacritic = (value >> 16) & 0xff;
|
||||
info->script_member = (value >> 8) & 0xff;
|
||||
@@ -2548,18 +2566,18 @@ static void sortkey_add_diacritic_weight(struct sortkey_data *data, BYTE value,
|
||||
@@ -2584,18 +2602,18 @@ static void sortkey_add_diacritic_weight(struct sortkey_data *data, BYTE value,
|
||||
*last_weighted_pos = data->buffer_pos;
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
if (info.script_member != SORTKEY_UNSORTABLE)
|
||||
{
|
||||
sortkey_add_weight(data, info.script_member);
|
||||
@@ -2569,11 +2587,11 @@ static void sortkey_handle_expansion_main(struct sortkey_data *data, int flags,
|
||||
@@ -2605,11 +2623,11 @@ static void sortkey_handle_expansion_main(struct sortkey_data *data, int flags,
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
switch (info.script_member)
|
||||
{
|
||||
@@ -2581,7 +2599,7 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
@@ -2617,7 +2635,7 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
break;
|
||||
|
||||
case SORTKEY_EXPANSION:
|
||||
@ -150,7 +150,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
break;
|
||||
|
||||
case SORTKEY_DIACRITIC:
|
||||
@@ -2640,18 +2658,18 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
@@ -2676,18 +2694,18 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
if (info.script_member != SORTKEY_UNSORTABLE)
|
||||
{
|
||||
if (!sortkey_is_PUA(info.script_member))
|
||||
@@ -2659,12 +2677,12 @@ static void sortkey_handle_expansion_diacritic(struct sortkey_data *data, int fl
|
||||
@@ -2695,12 +2713,12 @@ static void sortkey_handle_expansion_diacritic(struct sortkey_data *data, int fl
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
switch (info.script_member)
|
||||
{
|
||||
@@ -2672,7 +2690,7 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
|
||||
@@ -2708,7 +2726,7 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
|
||||
break;
|
||||
|
||||
case SORTKEY_EXPANSION:
|
||||
@ -197,7 +197,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
break;
|
||||
|
||||
case SORTKEY_DIACRITIC:
|
||||
@@ -2728,29 +2746,29 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
|
||||
@@ -2764,29 +2782,29 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
switch (info.script_member)
|
||||
{
|
||||
@@ -2758,7 +2776,7 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
@@ -2794,7 +2812,7 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
break;
|
||||
|
||||
case SORTKEY_EXPANSION:
|
||||
@ -242,7 +242,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
break;
|
||||
|
||||
case SORTKEY_DIACRITIC:
|
||||
@@ -2800,12 +2818,12 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
@@ -2836,12 +2854,12 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
if (info.script_member == SORTKEY_PUNCTUATION)
|
||||
{
|
||||
@@ -2818,11 +2836,11 @@ static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WC
|
||||
@@ -2854,11 +2872,11 @@ static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WC
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
if (info.script_member == SORTKEY_JAPANESE)
|
||||
{
|
||||
@@ -2840,11 +2858,11 @@ static void sortkey_add_extra_weights_small(struct sortkey_data *data, int flags
|
||||
@@ -2876,11 +2894,11 @@ static void sortkey_add_extra_weights_small(struct sortkey_data *data, int flags
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
if (info.script_member == SORTKEY_JAPANESE)
|
||||
{
|
||||
@@ -2861,11 +2879,11 @@ static void sortkey_add_extra_weights_kana(struct sortkey_data *data, int flags,
|
||||
@@ -2897,11 +2915,11 @@ static void sortkey_add_extra_weights_kana(struct sortkey_data *data, int flags,
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
if (info.script_member == SORTKEY_JAPANESE)
|
||||
{
|
||||
@@ -2882,13 +2900,14 @@ static void sortkey_add_extra_weights_width(struct sortkey_data *data, int flags
|
||||
@@ -2918,13 +2936,14 @@ static void sortkey_add_extra_weights_width(struct sortkey_data *data, int flags
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
|
||||
data.buffer = buffer;
|
||||
data.buffer_pos = 0;
|
||||
@@ -2899,7 +2918,7 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
|
||||
@@ -2935,7 +2954,7 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
|
||||
|
||||
/* Main weights */
|
||||
for (i = 0; i < str_len; i++)
|
||||
@ -324,7 +324,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
|
||||
|
||||
/* Diacritic weights */
|
||||
@@ -2908,7 +2927,7 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
|
||||
@@ -2944,7 +2963,7 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
|
||||
int diacritic_start_pos = data.buffer_pos;
|
||||
int last_weighted_pos = data.buffer_pos;
|
||||
for (i = 0; i < str_len; i++)
|
||||
@ -333,7 +333,7 @@ index da358d74934..ef135e48c2f 100644
|
||||
/* Remove all weights <= SORTKEY_MIN_WEIGHT from the end */
|
||||
data.buffer_pos = last_weighted_pos;
|
||||
}
|
||||
@@ -2916,24 +2935,24 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
|
||||
@@ -2952,24 +2971,24 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
|
||||
|
||||
/* Case weights */
|
||||
for (i = 0; i < str_len; i++)
|
||||
@ -363,8 +363,8 @@ index da358d74934..ef135e48c2f 100644
|
||||
sortkey_add_weight(&data, SORTKEY_TERMINATOR);
|
||||
|
||||
if (data.buffer_pos <= buffer_len || !buffer)
|
||||
@@ -5622,7 +5641,7 @@ INT WINAPI DECLSPEC_HOTPATCH LCMapStringEx( const WCHAR *locale, DWORD flags, co
|
||||
TRACE( "(%s,0x%08x,%s,%d,%p,%d)\n",
|
||||
@@ -5667,7 +5686,7 @@ INT WINAPI DECLSPEC_HOTPATCH LCMapStringEx( const WCHAR *locale, DWORD flags, co
|
||||
TRACE( "(%s,0x%08lx,%s,%d,%p,%d)\n",
|
||||
debugstr_w(locale), flags, debugstr_wn(src, srclen), srclen, dst, dstlen );
|
||||
|
||||
- if (!(ret = sortkey_generate(flags, L"", src, srclen, (BYTE *)dst, dstlen )))
|
||||
@ -373,5 +373,5 @@ index da358d74934..ef135e48c2f 100644
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.29.2
|
||||
2.34.1
|
||||
|
||||
|
Reference in New Issue
Block a user