winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1019 discussions
Start a n
N
ew thread
Alexandre Julliard : make_unicode: Store the full BiDi direction type in the table.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: d68f8d7b350012e0e982faf55a7db14dfc9c9c52 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d68f8d7b350012e0e982faf5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 22 15:59:49 2019 +0200 make_unicode: Store the full BiDi direction type in the table. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/bidi.c | 48 +-- dlls/usp10/direction.c | 1100 ++++++++++++++++++++---------------------------- tools/make_unicode | 32 +- 3 files changed, 486 insertions(+), 694 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d68f8d7b350012e0e982…
1
0
0
0
Alexandre Julliard : make_unicode: Generate a separate table for BiDi direction type in usp10.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: 2f6918cbe2e49817511336d0aaddd727c72a8b74 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2f6918cbe2e49817511336d0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 22 15:37:29 2019 +0200 make_unicode: Generate a separate table for BiDi direction type in usp10. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/Makefile.in | 1 + dlls/usp10/bidi.c | 4 +- dlls/usp10/direction.c | 769 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/make_unicode | 26 ++ 4 files changed, 798 insertions(+), 2 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2f6918cbe2e498175113…
1
0
0
0
Alexandre Julliard : make_unicode: Use a two-level table for the kernel32 wctype table.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: bb6bd8a2f1c8e6d30e576d590b669ffd20b32f59 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bb6bd8a2f1c8e6d30e576d59…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 22 11:27:13 2019 +0200 make_unicode: Use a two-level table for the kernel32 wctype table. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/locale.c | 26 +- dlls/kernel32/wctype.c | 1575 ++++++------------------------------------------ tools/make_unicode | 2 +- 3 files changed, 205 insertions(+), 1398 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=bb6bd8a2f1c8e6d30e57…
1
0
0
0
Alexandre Julliard : make_unicode: Store the C2_* values directly in the kernel32 wctype table.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: 02a04ba05ebf6f2f5f471ddd6b8c6723b74b32f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=02a04ba05ebf6f2f5f471ddd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 22 11:26:19 2019 +0200 make_unicode: Store the C2_* values directly in the kernel32 wctype table. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/locale.c | 22 +- dlls/kernel32/wctype.c | 804 ++++++++++++++++++++++++------------------------- tools/make_unicode | 29 +- 3 files changed, 431 insertions(+), 424 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=02a04ba05ebf6f2f5f47…
1
0
0
0
Alexandre Julliard : make_unicode: Add a wctype table in kernel32 for GetStringTypeW().
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: f09dade9cb73f0e8f6cece95af5087d879bdaaec URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f09dade9cb73f0e8f6cece95…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 22 10:31:55 2019 +0200 make_unicode: Add a wctype table in kernel32 for GetStringTypeW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/Makefile.in | 1 + dlls/kernel32/locale.c | 18 +- dlls/kernel32/wctype.c | 2154 +++++++++++++++++++++++++++++++++++++++++++++ tools/make_unicode | 36 +- 4 files changed, 2201 insertions(+), 8 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f09dade9cb73f0e8f6ce…
1
0
0
0
Piotr Caban : libwine: Ignore 0 weights as described in Unicode collation algorithm.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: 4a6e69ad3aff6fff2817b05ee2cdcc7e94f960a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4a6e69ad3aff6fff2817b05e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue May 21 17:19:52 2019 +0200 libwine: Ignore 0 weights as described in Unicode collation algorithm. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/locale.c | 8 ++++---- libs/port/sortkey.c | 28 ++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 1c632cc..81e7453 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -2043,9 +2043,9 @@ static void test_CompareStringW(void) ok(ret == CSTR_GREATER_THAN, "expected CSTR_GREATER_THAN, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, ABC_EE, 4, A_ACUTE_BC, 4); - todo_wine ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret); + ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, ABC_EE, 4, A_ACUTE_BC_DECOMP, 5); - todo_wine ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret); + ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, A_ACUTE_BC, 4, A_ACUTE_BC_DECOMP, 5); ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); @@ -2057,9 +2057,9 @@ static void test_CompareStringW(void) ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, ABC_EE, 4, A_NULL_BC, 4); - todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_LESS_THAN, got %d\n", ret); + ok(ret == CSTR_EQUAL, "expected CSTR_LESS_THAN, got %d\n", ret); ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, ABC_EE, 4, A_NULL_BC, 4); - todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); + ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, A_NULL_BC, 4, A_ACUTE_BC, 4); ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret); diff --git a/libs/port/sortkey.c b/libs/port/sortkey.c index 5d83fcd..f62289b 100644 --- a/libs/port/sortkey.c +++ b/libs/port/sortkey.c @@ -245,22 +245,38 @@ static inline int compare_weights(int flags, const WCHAR *str1, int len1, } ce1 = get_weight(dstr1[dpos1], type); + if (!ce1) + { + inc_str_pos(&str1, &len1, &dpos1, &dlen1); + continue; + } ce2 = get_weight(dstr2[dpos2], type); + if (!ce2) + { + inc_str_pos(&str2, &len2, &dpos2, &dlen2); + continue; + } if (ce1 - ce2) return ce1 - ce2; inc_str_pos(&str1, &len1, &dpos1, &dlen1); inc_str_pos(&str2, &len2, &dpos2, &dlen2); } - while (len1 && !*str1) + while (len1) { - str1++; - len1--; + if (!dlen1) dlen1 = wine_decompose(0, *str1, dstr1, 4); + + ce1 = get_weight(dstr1[dpos1], type); + if (ce1) break; + inc_str_pos(&str1, &len1, &dpos1, &dlen1); } - while (len2 && !*str2) + while (len2) { - str2++; - len2--; + if (!dlen2) dlen2 = wine_decompose(0, *str2, dstr2, 4); + + ce2 = get_weight(dstr2[dpos2], type); + if (ce2) break; + inc_str_pos(&str2, &len2, &dpos2, &dlen2); } return len1 - len2; }
1
0
0
0
Piotr Caban : libwine: Decompose characters before comparing in wine_compare_string.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: 40a1a9e9a242aa694bd28f640f51f66ce9eb99ba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=40a1a9e9a242aa694bd28f64…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue May 21 17:19:48 2019 +0200 libwine: Decompose characters before comparing in wine_compare_string. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/locale.c | 24 +++++++++++----------- libs/port/sortkey.c | 48 ++++++++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index a8d6e4c..1c632cc 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -1975,7 +1975,7 @@ static void test_CompareStringA(void) /* \xB9 character lies between a and b */ ret = CompareStringA(lcid, 0, "a", 1, "\xB9", 1); - todo_wine ok(ret == CSTR_LESS_THAN, "\'\\xB9\' character should be greater than \'a\'\n"); + ok(ret == CSTR_LESS_THAN, "\'\\xB9\' character should be greater than \'a\'\n"); ret = CompareStringA(lcid, 0, "\xB9", 1, "b", 1); ok(ret == CSTR_LESS_THAN, "\'\\xB9\' character should be smaller than \'b\'\n"); @@ -2047,14 +2047,14 @@ static void test_CompareStringW(void) ret = CompareStringW(CP_ACP, 0, ABC_EE, 4, A_ACUTE_BC_DECOMP, 5); todo_wine ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, A_ACUTE_BC, 4, A_ACUTE_BC_DECOMP, 5); - todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); + ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, ABC_EE, 3, A_ACUTE_BC, 4); - ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); + todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, ABC_EE, 4, A_ACUTE_BC_DECOMP, 5); todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, A_ACUTE_BC, 4, A_ACUTE_BC_DECOMP, 5); - todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); + ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); ret = CompareStringW(CP_ACP, 0, ABC_EE, 4, A_NULL_BC, 4); todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_LESS_THAN, got %d\n", ret); @@ -2098,7 +2098,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 3 */ "tr-TR", 0, - {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 4 */ "tr-TR", 0, @@ -2115,7 +2115,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 7 */ "tr-TR", NORM_IGNORECASE, - {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 8 */ "tr-TR", NORM_IGNORECASE, @@ -2123,7 +2123,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 9 */ "tr-TR", NORM_IGNORECASE, - {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 10 */ "tr-TR", NORM_IGNORECASE, @@ -2148,7 +2148,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 15 */ "tr-TR", NORM_LINGUISTIC_CASING, - {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 16 */ "tr-TR", NORM_LINGUISTIC_CASING, @@ -2173,7 +2173,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 21 */ "tr-TR", LINGUISTIC_IGNORECASE, - {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 22 */ "tr-TR", LINGUISTIC_IGNORECASE, @@ -2190,7 +2190,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 25 */ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, - {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, FALSE + {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE }, { /* 26 */ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, @@ -2198,7 +2198,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 27 */ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, - {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 28 */ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, @@ -2223,7 +2223,7 @@ static const struct comparestringex_test comparestringex_tests[] = { }, { /* 33 */ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, - {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE }, { /* 34 */ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, diff --git a/libs/port/sortkey.c b/libs/port/sortkey.c index 7ca1a20..5d83fcd 100644 --- a/libs/port/sortkey.c +++ b/libs/port/sortkey.c @@ -180,9 +180,22 @@ static unsigned int get_weight(WCHAR ch, enum weight type) } } +static void inc_str_pos(const WCHAR **str, int *len, int *dpos, int *dlen) +{ + (*dpos)++; + if (*dpos == *dlen) + { + *dpos = *dlen = 0; + (*str)++; + (*len)--; + } +} + static inline int compare_weights(int flags, const WCHAR *str1, int len1, const WCHAR *str2, int len2, enum weight type) { + int dpos1 = 0, dpos2 = 0, dlen1 = 0, dlen2 = 0; + WCHAR dstr1[4], dstr2[4]; unsigned int ce1, ce2; /* 32-bit collation element table format: @@ -191,20 +204,21 @@ static inline int compare_weights(int flags, const WCHAR *str1, int len1, */ while (len1 > 0 && len2 > 0) { + if (!dlen1) dlen1 = wine_decompose(0, *str1, dstr1, 4); + if (!dlen2) dlen2 = wine_decompose(0, *str2, dstr2, 4); + if (flags & NORM_IGNORESYMBOLS) { int skip = 0; /* FIXME: not tested */ - if (get_char_typeW(*str1) & (C1_PUNCT | C1_SPACE)) + if (get_char_typeW(dstr1[dpos1]) & (C1_PUNCT | C1_SPACE)) { - str1++; - len1--; + inc_str_pos(&str1, &len1, &dpos1, &dlen1); skip = 1; } - if (get_char_typeW(*str2) & (C1_PUNCT | C1_SPACE)) + if (!dlen2 && get_char_typeW(dstr2[dpos2]) & (C1_PUNCT | C1_SPACE)) { - str2++; - len2--; + inc_str_pos(&str2, &len2, &dpos2, &dlen2); skip = 1; } if (skip) continue; @@ -215,32 +229,28 @@ static inline int compare_weights(int flags, const WCHAR *str1, int len1, */ if (type == UNICODE_WEIGHT && !(flags & SORT_STRINGSORT)) { - if (*str1 == '-' || *str1 == '\'') + if (dstr1[dpos1] == '-' || dstr1[dpos1] == '\'') { - if (*str2 != '-' && *str2 != '\'') + if (dstr2[dpos2] != '-' && dstr2[dpos2] != '\'') { - str1++; - len1--; + inc_str_pos(&str1, &len1, &dpos1, &dlen1); continue; } } - else if (*str2 == '-' || *str2 == '\'') + else if (dstr2[dpos2] == '-' || dstr2[dpos2] == '\'') { - str2++; - len2--; + inc_str_pos(&str2, &len2, &dpos2, &dlen2); continue; } } - ce1 = get_weight(*str1, type); - ce2 = get_weight(*str2, type); + ce1 = get_weight(dstr1[dpos1], type); + ce2 = get_weight(dstr2[dpos2], type); if (ce1 - ce2) return ce1 - ce2; - str1++; - str2++; - len1--; - len2--; + inc_str_pos(&str1, &len1, &dpos1, &dlen1); + inc_str_pos(&str2, &len2, &dpos2, &dlen2); } while (len1 && !*str1) {
1
0
0
0
Piotr Caban : libwine: Add helper function to compare character weights.
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: ac5ac588f3965e5116c8933ad354fb6bf3502709 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ac5ac588f3965e5116c8933a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue May 21 17:19:44 2019 +0200 libwine: Add helper function to compare character weights. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/port/sortkey.c | 169 +++++++++++----------------------------------------- 1 file changed, 36 insertions(+), 133 deletions(-) diff --git a/libs/port/sortkey.c b/libs/port/sortkey.c index c61a7e5..7ca1a20 100644 --- a/libs/port/sortkey.c +++ b/libs/port/sortkey.c @@ -153,11 +153,37 @@ int wine_get_sortkey(int flags, const WCHAR *src, int srclen, char *dst, int dst return key_ptr[3] - dst; } -static inline int compare_unicode_weights(int flags, const WCHAR *str1, int len1, - const WCHAR *str2, int len2) +enum weight +{ + UNICODE_WEIGHT, + DIACRITIC_WEIGHT, + CASE_WEIGHT +}; + +static unsigned int get_weight(WCHAR ch, enum weight type) +{ + unsigned int ret; + + ret = collation_table[collation_table[ch >> 8] + (ch & 0xff)]; + if (ret == (unsigned int)-1) + return ch; + + switch(type) + { + case UNICODE_WEIGHT: + return ret >> 16; + case DIACRITIC_WEIGHT: + return (ret >> 8) & 0xff; + case CASE_WEIGHT: + default: + return (ret >> 4) & 0x0f; + } +} + +static inline int compare_weights(int flags, const WCHAR *str1, int len1, + const WCHAR *str2, int len2, enum weight type) { unsigned int ce1, ce2; - int ret; /* 32-bit collation element table format: * unicode weight - high 16 bit, diacritic weight - high 8 bit of low 16 bit, @@ -187,7 +213,7 @@ static inline int compare_unicode_weights(int flags, const WCHAR *str1, int len1 /* hyphen and apostrophe are treated differently depending on * whether SORT_STRINGSORT specified or not */ - if (!(flags & SORT_STRINGSORT)) + if (type == UNICODE_WEIGHT && !(flags & SORT_STRINGSORT)) { if (*str1 == '-' || *str1 == '\'') { @@ -206,133 +232,10 @@ static inline int compare_unicode_weights(int flags, const WCHAR *str1, int len1 } } - ce1 = collation_table[collation_table[*str1 >> 8] + (*str1 & 0xff)]; - ce2 = collation_table[collation_table[*str2 >> 8] + (*str2 & 0xff)]; - - if (ce1 != (unsigned int)-1 && ce2 != (unsigned int)-1) - ret = (ce1 >> 16) - (ce2 >> 16); - else - ret = *str1 - *str2; - - if (ret) return ret; - - str1++; - str2++; - len1--; - len2--; - } - while (len1 && !*str1) - { - str1++; - len1--; - } - while (len2 && !*str2) - { - str2++; - len2--; - } - return len1 - len2; -} - -static inline int compare_diacritic_weights(int flags, const WCHAR *str1, int len1, - const WCHAR *str2, int len2) -{ - unsigned int ce1, ce2; - int ret; - - /* 32-bit collation element table format: - * unicode weight - high 16 bit, diacritic weight - high 8 bit of low 16 bit, - * case weight - high 4 bit of low 8 bit. - */ - while (len1 > 0 && len2 > 0) - { - if (flags & NORM_IGNORESYMBOLS) - { - int skip = 0; - /* FIXME: not tested */ - if (get_char_typeW(*str1) & (C1_PUNCT | C1_SPACE)) - { - str1++; - len1--; - skip = 1; - } - if (get_char_typeW(*str2) & (C1_PUNCT | C1_SPACE)) - { - str2++; - len2--; - skip = 1; - } - if (skip) continue; - } - - ce1 = collation_table[collation_table[*str1 >> 8] + (*str1 & 0xff)]; - ce2 = collation_table[collation_table[*str2 >> 8] + (*str2 & 0xff)]; - - if (ce1 != (unsigned int)-1 && ce2 != (unsigned int)-1) - ret = ((ce1 >> 8) & 0xff) - ((ce2 >> 8) & 0xff); - else - ret = *str1 - *str2; - - if (ret) return ret; - - str1++; - str2++; - len1--; - len2--; - } - while (len1 && !*str1) - { - str1++; - len1--; - } - while (len2 && !*str2) - { - str2++; - len2--; - } - return len1 - len2; -} - -static inline int compare_case_weights(int flags, const WCHAR *str1, int len1, - const WCHAR *str2, int len2) -{ - unsigned int ce1, ce2; - int ret; - - /* 32-bit collation element table format: - * unicode weight - high 16 bit, diacritic weight - high 8 bit of low 16 bit, - * case weight - high 4 bit of low 8 bit. - */ - while (len1 > 0 && len2 > 0) - { - if (flags & NORM_IGNORESYMBOLS) - { - int skip = 0; - /* FIXME: not tested */ - if (get_char_typeW(*str1) & (C1_PUNCT | C1_SPACE)) - { - str1++; - len1--; - skip = 1; - } - if (get_char_typeW(*str2) & (C1_PUNCT | C1_SPACE)) - { - str2++; - len2--; - skip = 1; - } - if (skip) continue; - } - - ce1 = collation_table[collation_table[*str1 >> 8] + (*str1 & 0xff)]; - ce2 = collation_table[collation_table[*str2 >> 8] + (*str2 & 0xff)]; - - if (ce1 != (unsigned int)-1 && ce2 != (unsigned int)-1) - ret = ((ce1 >> 4) & 0x0f) - ((ce2 >> 4) & 0x0f); - else - ret = *str1 - *str2; + ce1 = get_weight(*str1, type); + ce2 = get_weight(*str2, type); - if (ret) return ret; + if (ce1 - ce2) return ce1 - ce2; str1++; str2++; @@ -357,13 +260,13 @@ int wine_compare_string(int flags, const WCHAR *str1, int len1, { int ret; - ret = compare_unicode_weights(flags, str1, len1, str2, len2); + ret = compare_weights(flags, str1, len1, str2, len2, UNICODE_WEIGHT); if (!ret) { if (!(flags & NORM_IGNORENONSPACE)) - ret = compare_diacritic_weights(flags, str1, len1, str2, len2); + ret = compare_weights(flags, str1, len1, str2, len2, DIACRITIC_WEIGHT); if (!ret && !(flags & NORM_IGNORECASE)) - ret = compare_case_weights(flags, str1, len1, str2, len2); + ret = compare_weights(flags, str1, len1, str2, len2, CASE_WEIGHT); } return ret; }
1
0
0
0
Gijs Vermeulen : crypt32/tests: Fix some memory leaks (Valgrind).
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: 1eca63440d54cbaa0be8616eb0d153205f4909d1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1eca63440d54cbaa0be8616e…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Tue May 21 21:22:30 2019 +0200 crypt32/tests: Fix some memory leaks (Valgrind). Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/tests/cert.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index e4f4c59..880ae72 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -1736,6 +1736,7 @@ static void testGetIssuerCert(void) CertFreeCertificateContext(child); CertFreeCertificateContext(cert1); CertFreeCertificateContext(cert2); + CertFreeCertificateContext(cert3); CertCloseStore(store, 0); HeapFree(GetProcessHeap(), 0, certencoded); @@ -1750,6 +1751,7 @@ static void testGetIssuerCert(void) ok(!parent, "Expected NULL\n"); ok(GetLastError() == CRYPT_E_SELF_SIGNED, "Expected CRYPT_E_SELF_SIGNED, got %08X\n", GetLastError()); + CertFreeCertificateContext(cert1); CertCloseStore(store, 0); }
1
0
0
0
Zebediah Figura : qcap/avimux: Use BaseFilter_Destroy().
by Alexandre Julliard
22 May '19
22 May '19
Module: wine Branch: master Commit: f96c2bd64feeb615b1e38ba7983705b81cc359a7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f96c2bd64feeb615b1e38ba7…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed May 22 00:02:16 2019 -0500 qcap/avimux: Use BaseFilter_Destroy(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/avimux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 3a269a3..ff45fb0 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -175,7 +175,7 @@ static HRESULT WINAPI AviMux_QueryInterface(IBaseFilter *iface, REFIID riid, voi static ULONG WINAPI AviMux_Release(IBaseFilter *iface) { AviMux *This = impl_from_IBaseFilter(iface); - ULONG ref = BaseFilterImpl_Release(iface); + ULONG ref = InterlockedDecrement(&This->filter.refCount); TRACE("(%p) new refcount: %u\n", This, ref); @@ -192,6 +192,7 @@ static ULONG WINAPI AviMux_Release(IBaseFilter *iface) } HeapFree(GetProcessHeap(), 0, This->idx1); + strmbase_filter_cleanup(&This->filter); HeapFree(GetProcessHeap(), 0, This); ObjectRefCount(FALSE); } @@ -2364,7 +2365,7 @@ IUnknown* WINAPI QCAP_createAVIMux(IUnknown *pUnkOuter, HRESULT *phr) hr = BaseOutputPin_Construct(&AviMuxOut_PinVtbl, sizeof(AviMuxOut), &info, &AviMuxOut_BaseOutputFuncTable, &avimux->filter.csFilter, (IPin**)&avimux->out); if(FAILED(hr)) { - BaseFilterImpl_Release(&avimux->filter.IBaseFilter_iface); + strmbase_filter_cleanup(&avimux->filter); HeapFree(GetProcessHeap(), 0, avimux); *phr = hr; return NULL; @@ -2377,7 +2378,7 @@ IUnknown* WINAPI QCAP_createAVIMux(IUnknown *pUnkOuter, HRESULT *phr) hr = create_input_pin(avimux); if(FAILED(hr)) { BaseOutputPinImpl_Release(&avimux->out->pin.pin.IPin_iface); - BaseFilterImpl_Release(&avimux->filter.IBaseFilter_iface); + strmbase_filter_cleanup(&avimux->filter); HeapFree(GetProcessHeap(), 0, avimux); *phr = hr; return NULL;
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
102
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Results per page:
10
25
50
100
200