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
July
June
May
April
March
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
July 2015
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
567 discussions
Start a n
N
ew thread
Sebastian Lackner : vcomp/tests: Add tests for _vcomp_for_static_init.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: a250c0b29f47aa6fe9c5d3ab12091d266475b9cf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a250c0b29f47aa6fe9c5d3ab1…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:18:45 2015 +0200 vcomp/tests: Add tests for _vcomp_for_static_init. --- dlls/vcomp/tests/vcomp.c | 220 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a250c0b29f47aa6fe9c5d…
1
0
0
0
Sebastian Lackner : vcomp: Implement _vcomp_for_static_init.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: c34c9b4f39ec11ca89f4fa3a0f61c4547f031fe2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c34c9b4f39ec11ca89f4fa3a0…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:17:47 2015 +0200 vcomp: Implement _vcomp_for_static_init. --- dlls/vcomp/main.c | 63 +++++++++++++++++++++++++++++++++++++++++++++ dlls/vcomp/vcomp.spec | 2 +- dlls/vcomp100/vcomp100.spec | 2 +- dlls/vcomp90/vcomp90.spec | 2 +- 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index c06625a..ae5623b 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -412,6 +412,69 @@ void CDECL _vcomp_for_static_simple_init(unsigned int first, unsigned int last, *end = *begin + (per_thread - 1) * step; } +void CDECL _vcomp_for_static_init(int first, int last, int step, int chunksize, unsigned int *loops, + int *begin, int *end, int *next, int *lastchunk) +{ + unsigned int iterations, num_chunks, per_thread, remaining; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_team_data *team_data = thread_data->team; + int num_threads = team_data ? team_data->num_threads : 1; + int thread_num = thread_data->thread_num; + + TRACE("(%d, %d, %d, %d, %p, %p, %p, %p, %p)\n", + first, last, step, chunksize, loops, begin, end, next, lastchunk); + + if (num_threads == 1 && chunksize != 1) + { + *loops = 1; + *begin = first; + *end = last; + *next = 0; + *lastchunk = first; + return; + } + + if (first == last) + { + *loops = !thread_num; + if (!thread_num) + { + *begin = first; + *end = last; + *next = 0; + *lastchunk = first; + } + return; + } + + if (step <= 0) + { + *loops = 0; + return; + } + + if (first < last) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + if (chunksize < 1) + chunksize = 1; + + num_chunks = ((DWORD64)iterations + chunksize - 1) / chunksize; + per_thread = num_chunks / num_threads; + remaining = num_chunks - per_thread * num_threads; + + *loops = per_thread + (thread_num < remaining); + *begin = first + thread_num * chunksize * step; + *end = *begin + (chunksize - 1) * step; + *next = chunksize * num_threads * step; + *lastchunk = first + (num_chunks - 1) * chunksize * step; +} + void CDECL _vcomp_for_static_end(void) { TRACE("()\n"); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index d6b8bf5..7083ce4 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -60,7 +60,7 @@ @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() -@ stub _vcomp_for_static_init +@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ stub _vcomp_for_static_simple_init_i8 diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index a6933c8..56c7ae3 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -60,7 +60,7 @@ @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end -@ stub _vcomp_for_static_init +@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init @ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ stub _vcomp_for_static_simple_init_i8 diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index a6933c8..56c7ae3 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -60,7 +60,7 @@ @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end -@ stub _vcomp_for_static_init +@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init @ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ stub _vcomp_for_static_simple_init_i8
1
0
0
0
Sebastian Lackner : vcomp/tests: Add tests for _vcomp_for_static_simple_init.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: 02054a75226f941c9f5c4f31d34db6423be3dca7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02054a75226f941c9f5c4f31d…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:17:05 2015 +0200 vcomp/tests: Add tests for _vcomp_for_static_simple_init. --- dlls/vcomp/tests/vcomp.c | 173 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index 7346655..ec845c4 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -32,6 +32,9 @@ static BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR); static VOID (WINAPI *pReleaseActCtx)(HANDLE); static void (CDECL *p_vcomp_barrier)(void); +static void (CDECL *p_vcomp_for_static_end)(void); +static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, + BOOL increment, unsigned int *begin, unsigned int *end); static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); static void (CDECL *p_vcomp_sections_init)(int n); static int (CDECL *p_vcomp_sections_next)(void); @@ -171,6 +174,8 @@ static BOOL init_vcomp(void) } VCOMP_GET_PROC(_vcomp_barrier); + VCOMP_GET_PROC(_vcomp_for_static_end); + VCOMP_GET_PROC(_vcomp_for_static_simple_init); VCOMP_GET_PROC(_vcomp_fork); VCOMP_GET_PROC(_vcomp_sections_init); VCOMP_GET_PROC(_vcomp_sections_next); @@ -458,6 +463,173 @@ if (0) pomp_set_num_threads(max_threads); } +static void my_for_static_simple_init(unsigned int first, unsigned int last, int step, + BOOL increment, unsigned int *begin, unsigned int *end) +{ + unsigned int iterations, per_thread, remaining; + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + + if (num_threads == 1) + { + *begin = first; + *end = last; + return; + } + + if (step <= 0) + { + *begin = 0; + *end = increment ? -1 : 1; + return; + } + + if (increment) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + per_thread = iterations / num_threads; + remaining = iterations - per_thread * num_threads; + + if (thread_num < remaining) + per_thread++; + else if (per_thread) + first += remaining * step; + else + { + *begin = first; + *end = first - step; + return; + } + + *begin = first + per_thread * thread_num * step; + *end = *begin + (per_thread - 1) * step; +} + + +static void CDECL for_static_simple_cb(void) +{ + static const struct + { + unsigned int first; + unsigned int last; + int step; + } + tests[] = + { + { 0, 0, 1 }, /* 0 */ + { 0, 1, 1 }, + { 0, 2, 1 }, + { 0, 3, 1 }, + { 0, 100, 0 }, + { 0, 100, 1 }, + { 0, 100, 2 }, + { 0, 100, 3 }, + { 0, 100, -1 }, + { 0, 100, -2 }, + { 0, 100, -3 }, /* 10 */ + { 0, 100, 10 }, + { 0, 100, 50 }, + { 0, 100, 100 }, + { 0, 100, 150 }, + { 0, 0x80000000, 1 }, + { 0, 0xfffffffe, 1 }, + { 0, 0xffffffff, 1 }, + { 50, 50, 0 }, + { 50, 50, 1 }, + { 50, 50, 2 }, /* 20 */ + { 50, 50, 3 }, + { 50, 50, -1 }, + { 50, 50, -2 }, + { 50, 50, -3 }, + { 100, 200, 1 }, + { 100, 200, 5 }, + { 100, 200, 10 }, + { 100, 200, 50 }, + { 100, 200, 100 }, + { 100, 200, 150 }, /* 30 */ + }; + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + unsigned int my_begin, my_end, begin, end; + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, FALSE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, FALSE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, TRUE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, TRUE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + if (tests[i].first == tests[i].last) continue; + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, FALSE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, FALSE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, TRUE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, TRUE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + } +} + +static void test_vcomp_for_static_simple_init(void) +{ + int max_threads = pomp_get_max_threads(); + int i; + + for_static_simple_cb(); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + p_vcomp_fork(TRUE, 0, for_static_simple_cb); + p_vcomp_fork(FALSE, 0, for_static_simple_cb); + } + + pomp_set_num_threads(max_threads); +} + START_TEST(vcomp) { if (!init_vcomp()) @@ -467,6 +639,7 @@ START_TEST(vcomp) test_omp_get_num_threads(TRUE); test_vcomp_fork(); test_vcomp_sections_init(); + test_vcomp_for_static_simple_init(); release_vcomp(); }
1
0
0
0
Sebastian Lackner : vcomp: Implement _vcomp_for_static_simple_init and _vcomp_for_static_end.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: 6f34d0fe1f67632cc24b304a536a9790e9365ec0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f34d0fe1f67632cc24b304a5…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:16:47 2015 +0200 vcomp: Implement _vcomp_for_static_simple_init and _vcomp_for_static_end. --- dlls/vcomp/main.c | 57 +++++++++++++++++++++++++++++++++++++++++++++ dlls/vcomp/vcomp.spec | 4 ++-- dlls/vcomp100/vcomp100.spec | 4 ++-- dlls/vcomp90/vcomp90.spec | 4 ++-- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index d76df1e..c06625a 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -361,6 +361,63 @@ int CDECL _vcomp_sections_next(void) return i; } +void CDECL _vcomp_for_static_simple_init(unsigned int first, unsigned int last, int step, + BOOL increment, unsigned int *begin, unsigned int *end) +{ + unsigned int iterations, per_thread, remaining; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_team_data *team_data = thread_data->team; + int num_threads = team_data ? team_data->num_threads : 1; + int thread_num = thread_data->thread_num; + + TRACE("(%u, %u, %d, %u, %p, %p)\n", first, last, step, increment, begin, end); + + if (num_threads == 1) + { + *begin = first; + *end = last; + return; + } + + if (step <= 0) + { + *begin = 0; + *end = increment ? -1 : 1; + return; + } + + if (increment) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + per_thread = iterations / num_threads; + remaining = iterations - per_thread * num_threads; + + if (thread_num < remaining) + per_thread++; + else if (per_thread) + first += remaining * step; + else + { + *begin = first; + *end = first - step; + return; + } + + *begin = first + per_thread * thread_num * step; + *end = *begin + (per_thread - 1) * step; +} + +void CDECL _vcomp_for_static_end(void) +{ + TRACE("()\n"); + /* nothing to do here */ +} + int CDECL omp_in_parallel(void) { TRACE("()\n"); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index 5a5b114..d6b8bf5 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -59,10 +59,10 @@ @ stub _vcomp_for_dynamic_init_i8 @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 -@ stub _vcomp_for_static_end +@ cdecl _vcomp_for_static_end() @ stub _vcomp_for_static_init @ stub _vcomp_for_static_init_i8 -@ stub _vcomp_for_static_simple_init +@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) @ stub _vcomp_get_thread_num diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index debc5ff..a6933c8 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -59,10 +59,10 @@ @ stub _vcomp_for_dynamic_init_i8 @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 -@ stub _vcomp_for_static_end +@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end @ stub _vcomp_for_static_init @ stub _vcomp_for_static_init_i8 -@ stub _vcomp_for_static_simple_init +@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index debc5ff..a6933c8 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -59,10 +59,10 @@ @ stub _vcomp_for_dynamic_init_i8 @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 -@ stub _vcomp_for_static_end +@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end @ stub _vcomp_for_static_init @ stub _vcomp_for_static_init_i8 -@ stub _vcomp_for_static_simple_init +@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num
1
0
0
0
Sebastian Lackner : vcomp: Implement omp_in_parallel and add tests.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: bc10d127b472d456e5308903e3556b72d8c80fca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bc10d127b472d456e5308903e…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:16:12 2015 +0200 vcomp: Implement omp_in_parallel and add tests. --- dlls/vcomp/main.c | 6 +++++ dlls/vcomp/tests/vcomp.c | 61 +++++++++++++++++++++++++++++++++------------ dlls/vcomp/vcomp.spec | 2 +- dlls/vcomp100/vcomp100.spec | 2 +- dlls/vcomp90/vcomp90.spec | 2 +- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 1dad029..d76df1e 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -361,6 +361,12 @@ int CDECL _vcomp_sections_next(void) return i; } +int CDECL omp_in_parallel(void) +{ + TRACE("()\n"); + return vcomp_init_thread_data()->parallel; +} + static DWORD WINAPI _vcomp_fork_worker(void *param) { struct vcomp_thread_data *thread_data = param; diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index dd91b4f..7346655 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -40,6 +40,7 @@ static int (CDECL *pomp_get_max_threads)(void); static int (CDECL *pomp_get_nested)(void); static int (CDECL *pomp_get_num_threads)(void); static int (CDECL *pomp_get_thread_num)(void); +static int (CDECL *pomp_in_parallel)(void); static void (CDECL *pomp_set_nested)(int nested); static void (CDECL *pomp_set_num_threads)(int num_threads); @@ -178,6 +179,7 @@ static BOOL init_vcomp(void) VCOMP_GET_PROC(omp_get_nested); VCOMP_GET_PROC(omp_get_num_threads); VCOMP_GET_PROC(omp_get_thread_num); + VCOMP_GET_PROC(omp_in_parallel); VCOMP_GET_PROC(omp_set_nested); VCOMP_GET_PROC(omp_set_num_threads); @@ -186,14 +188,17 @@ static BOOL init_vcomp(void) #undef VCOMP_GET_PROC -static void CDECL num_threads_cb2(LONG *count) +static void CDECL num_threads_cb2(int parallel, LONG *count) { + int is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + InterlockedIncrement(count); } -static void CDECL num_threads_cb(BOOL nested, int nested_threads, LONG *count) +static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads, LONG *count) { - int num_threads, thread_num; + int is_parallel, num_threads, thread_num; LONG thread_count; InterlockedIncrement(count); @@ -205,29 +210,41 @@ static void CDECL num_threads_cb(BOOL nested, int nested_threads, LONG *count) ok(thread_num >= 0 && thread_num < num_threads, "expected thread_num in range [0, %d], got %d\n", num_threads - 1, thread_num); + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + thread_count = 0; - p_vcomp_fork(TRUE, 1, num_threads_cb2, &thread_count); + p_vcomp_fork(TRUE, 2, num_threads_cb2, TRUE, &thread_count); if (nested) ok(thread_count == nested_threads, "expected %d threads, got %d\n", nested_threads, thread_count); else ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + thread_count = 0; - p_vcomp_fork(FALSE, 1, num_threads_cb2, &thread_count); + p_vcomp_fork(FALSE, 2, num_threads_cb2, parallel, &thread_count); ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + p_vcomp_set_num_threads(4); thread_count = 0; - p_vcomp_fork(TRUE, 1, num_threads_cb2, &thread_count); + p_vcomp_fork(TRUE, 2, num_threads_cb2, TRUE, &thread_count); if (nested) ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); else ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); } static void test_omp_get_num_threads(BOOL nested) { - int is_nested, max_threads, num_threads, thread_num; + int is_nested, is_parallel, max_threads, num_threads, thread_num; LONG thread_count; pomp_set_nested(nested); @@ -239,61 +256,73 @@ static void test_omp_get_num_threads(BOOL nested) thread_num = pomp_get_thread_num(); ok(thread_num == 0, "expected thread_num == 0, got %d\n", thread_num); + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, max_threads, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, max_threads, &thread_count); ok(thread_count == max_threads, "expected %d threads, got %d\n", max_threads, thread_count); + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(FALSE, 3, num_threads_cb, TRUE, max_threads, &thread_count); + p_vcomp_fork(FALSE, 4, num_threads_cb, TRUE, FALSE, max_threads, &thread_count); ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + pomp_set_num_threads(1); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 1, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 1, &thread_count); ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + pomp_set_num_threads(2); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 2, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 2, &thread_count); ok(thread_count == 2, "expected 2 threads, got %d\n", thread_count); pomp_set_num_threads(4); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 4, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); p_vcomp_set_num_threads(8); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 4, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); ok(thread_count == 8, "expected 8 threads, got %d\n", thread_count); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 4, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); p_vcomp_set_num_threads(0); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 4, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); pomp_set_num_threads(0); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); thread_count = 0; - p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 4, &thread_count); + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); pomp_set_num_threads(max_threads); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index dfbd184..5a5b114 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -98,7 +98,7 @@ @ cdecl omp_get_thread_num() @ stub omp_get_wtick @ cdecl omp_get_wtime() -@ stub omp_in_parallel +@ cdecl omp_in_parallel() @ stub omp_init_lock @ stub omp_init_nest_lock @ cdecl omp_set_dynamic(long) diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index 6eb6ae5..debc5ff 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -98,7 +98,7 @@ @ cdecl omp_get_thread_num() vcomp.omp_get_thread_num @ stub omp_get_wtick @ cdecl omp_get_wtime() vcomp.omp_get_wtime -@ stub omp_in_parallel +@ cdecl omp_in_parallel() vcomp.omp_in_parallel @ stub omp_init_lock @ stub omp_init_nest_lock @ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index 6eb6ae5..debc5ff 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -98,7 +98,7 @@ @ cdecl omp_get_thread_num() vcomp.omp_get_thread_num @ stub omp_get_wtick @ cdecl omp_get_wtime() vcomp.omp_get_wtime -@ stub omp_in_parallel +@ cdecl omp_in_parallel() vcomp.omp_in_parallel @ stub omp_init_lock @ stub omp_init_nest_lock @ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
1
0
0
0
Sebastian Lackner : vcomp: Fix handling of _vcomp_fork with ifval == FALSE.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: c06167b172a3db8d903a275b38af87ec8851c7d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c06167b172a3db8d903a275b3…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:15:49 2015 +0200 vcomp: Fix handling of _vcomp_fork with ifval == FALSE. Forks with ifval == FALSE do not count as "parallel", so nested forks are still allowed. Please note that calling _vcomp_fork(FALSE, ...) or directly calling the callback is still different in some aspects, the synchronization functions run in a different context for example. --- dlls/vcomp/main.c | 10 ++++++++-- dlls/vcomp/tests/vcomp.c | 23 ++++++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 6e99d21..1dad029 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -54,6 +54,7 @@ struct vcomp_thread_data struct vcomp_team_data *team; struct vcomp_task_data *task; int thread_num; + BOOL parallel; int fork_threads; /* only used for concurrent tasks */ @@ -203,6 +204,7 @@ static struct vcomp_thread_data *vcomp_init_thread_data(void) thread_data->team = NULL; thread_data->task = &data->task; thread_data->thread_num = 0; + thread_data->parallel = FALSE; thread_data->fork_threads = 0; thread_data->section = 1; @@ -410,10 +412,11 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) TRACE("(%d, %d, %p, ...)\n", ifval, nargs, wrapper); + if (prev_thread_data->parallel && !vcomp_nested_fork) + ifval = FALSE; + if (!ifval) num_threads = 1; - else if (prev_thread_data->team && !vcomp_nested_fork) - num_threads = 1; else if (prev_thread_data->fork_threads) num_threads = prev_thread_data->fork_threads; else @@ -433,6 +436,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) thread_data.team = &team_data; thread_data.task = &task_data; thread_data.thread_num = 0; + thread_data.parallel = ifval || prev_thread_data->parallel; thread_data.fork_threads = 0; thread_data.section = 1; list_init(&thread_data.entry); @@ -450,6 +454,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) data->team = &team_data; data->task = &task_data; data->thread_num = team_data.num_threads++; + data->parallel = thread_data.parallel; data->fork_threads = 0; data->section = 1; list_remove(&data->entry); @@ -470,6 +475,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) data->team = &team_data; data->task = &task_data; data->thread_num = team_data.num_threads; + data->parallel = thread_data.parallel; data->fork_threads = 0; data->section = 1; InitializeConditionVariable(&data->cond); diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index a96f957..dd91b4f 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -208,17 +208,21 @@ static void CDECL num_threads_cb(BOOL nested, int nested_threads, LONG *count) thread_count = 0; p_vcomp_fork(TRUE, 1, num_threads_cb2, &thread_count); if (nested) - ok(thread_count == nested_threads, "expected %d thread, got %d\n", nested_threads, thread_count); + ok(thread_count == nested_threads, "expected %d threads, got %d\n", nested_threads, thread_count); else ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + thread_count = 0; + p_vcomp_fork(FALSE, 1, num_threads_cb2, &thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + p_vcomp_set_num_threads(4); thread_count = 0; p_vcomp_fork(TRUE, 1, num_threads_cb2, &thread_count); if (nested) - ok(thread_count == 4 , "expected 4 thread, got %d\n", thread_count); + ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); else - ok(thread_count == 1 , "expected 1 thread, got %d\n", thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); } static void test_omp_get_num_threads(BOOL nested) @@ -241,6 +245,19 @@ static void test_omp_get_num_threads(BOOL nested) p_vcomp_fork(TRUE, 3, num_threads_cb, nested, max_threads, &thread_count); ok(thread_count == max_threads, "expected %d threads, got %d\n", max_threads, thread_count); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(FALSE, 3, num_threads_cb, TRUE, max_threads, &thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + pomp_set_num_threads(1); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 3, num_threads_cb, nested, 1, &thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + pomp_set_num_threads(2); num_threads = pomp_get_num_threads(); ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads);
1
0
0
0
Sebastian Lackner : vcomp: Allow calls to _vcomp_sections_init outside of parallel environment.
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: 889eba36e93918e7957cb3fda142d87abc2b9c84 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=889eba36e93918e7957cb3fda…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Jul 20 05:15:27 2015 +0200 vcomp: Allow calls to _vcomp_sections_init outside of parallel environment. --- dlls/vcomp/main.c | 47 +++++++++++++++++++++++++++++++++-------------- dlls/vcomp/tests/vcomp.c | 26 +++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 0f8a272..6e99d21 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -52,6 +52,7 @@ static RTL_CRITICAL_SECTION vcomp_section = { &critsect_debug, -1, 0, 0, 0, 0 }; struct vcomp_thread_data { struct vcomp_team_data *team; + struct vcomp_task_data *task; int thread_num; int fork_threads; @@ -77,7 +78,10 @@ struct vcomp_team_data /* barrier */ unsigned int barrier; int barrier_count; +}; +struct vcomp_task_data +{ /* section */ unsigned int section; int num_sections; @@ -180,17 +184,27 @@ static inline void vcomp_set_thread_data(struct vcomp_thread_data *thread_data) static struct vcomp_thread_data *vcomp_init_thread_data(void) { struct vcomp_thread_data *thread_data = vcomp_get_thread_data(); - if (thread_data) return thread_data; + struct + { + struct vcomp_thread_data thread; + struct vcomp_task_data task; + } *data; - if (!(thread_data = HeapAlloc(GetProcessHeap(), 0, sizeof(*thread_data)))) + if (thread_data) return thread_data; + if (!(data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)))) { ERR("could not create thread data\n"); ExitProcess(1); } + data->task.section = 0; + + thread_data = &data->thread; thread_data->team = NULL; + thread_data->task = &data->task; thread_data->thread_num = 0; thread_data->fork_threads = 0; + thread_data->section = 1; vcomp_set_thread_data(thread_data); return thread_data; @@ -311,35 +325,35 @@ void CDECL _vcomp_single_end(void) void CDECL _vcomp_sections_init(int n) { - struct vcomp_thread_data *thread_data = vcomp_get_thread_data(); - struct vcomp_team_data *team_data = thread_data->team; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_task_data *task_data = thread_data->task; TRACE("(%d)\n", n); EnterCriticalSection(&vcomp_section); thread_data->section++; - if ((int)(thread_data->section - team_data->section) > 0) + if ((int)(thread_data->section - task_data->section) > 0) { - team_data->section = thread_data->section; - team_data->num_sections = n; - team_data->section_index = 0; + task_data->section = thread_data->section; + task_data->num_sections = n; + task_data->section_index = 0; } LeaveCriticalSection(&vcomp_section); } int CDECL _vcomp_sections_next(void) { - struct vcomp_thread_data *thread_data = vcomp_get_thread_data(); - struct vcomp_team_data *team_data = thread_data->team; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_task_data *task_data = thread_data->task; int i = -1; TRACE("()\n"); EnterCriticalSection(&vcomp_section); - if (thread_data->section == team_data->section && - team_data->section_index != team_data->num_sections) + if (thread_data->section == task_data->section && + task_data->section_index != task_data->num_sections) { - i = team_data->section_index++; + i = task_data->section_index++; } LeaveCriticalSection(&vcomp_section); return i; @@ -391,6 +405,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) struct vcomp_thread_data *prev_thread_data = vcomp_init_thread_data(); struct vcomp_thread_data thread_data; struct vcomp_team_data team_data; + struct vcomp_task_data task_data; int num_threads; TRACE("(%d, %d, %p, ...)\n", ifval, nargs, wrapper); @@ -412,9 +427,11 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) __ms_va_start(team_data.valist, wrapper); team_data.barrier = 0; team_data.barrier_count = 0; - team_data.section = 0; + + task_data.section = 0; thread_data.team = &team_data; + thread_data.task = &task_data; thread_data.thread_num = 0; thread_data.fork_threads = 0; thread_data.section = 1; @@ -431,6 +448,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) { struct vcomp_thread_data *data = LIST_ENTRY(ptr, struct vcomp_thread_data, entry); data->team = &team_data; + data->task = &task_data; data->thread_num = team_data.num_threads++; data->fork_threads = 0; data->section = 1; @@ -450,6 +468,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) if (!data) break; data->team = &team_data; + data->task = &task_data; data->thread_num = team_data.num_threads; data->fork_threads = 0; data->section = 1; diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index c433991..a96f957 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -378,15 +378,35 @@ static void test_vcomp_sections_init(void) int max_threads = pomp_get_max_threads(); int i; +if (0) +{ + /* calling _vcomp_sections_next without prior _vcomp_sections_init + * returns uninitialized memory on Windows. */ + i = p_vcomp_sections_next(); + ok(i == -1, "expected -1, got %d\n", i); +} + + a = b = c = 0; + section_cb(&a, &b, &c); + ok(a == 20, "expected a == 20, got %d\n", a); + ok(b == 30, "expected b == 30, got %d\n", b); + ok(c == 40, "expected c == 40, got %d\n", c); + for (i = 1; i <= 4; i++) { pomp_set_num_threads(i); a = b = c = 0; p_vcomp_fork(TRUE, 3, section_cb, &a, &b, &c); - ok(a == 20, "expected a = 20, got %d\n", a); - ok(b == 30, "expected b = 30, got %d\n", b); - ok(c == 40, "expected c = 40, got %d\n", c); + ok(a == 20, "expected a == 20, got %d\n", a); + ok(b == 30, "expected b == 30, got %d\n", b); + ok(c == 40, "expected c == 40, got %d\n", c); + + a = b = c = 0; + p_vcomp_fork(FALSE, 3, section_cb, &a, &b, &c); + ok(a == 20, "expected a == 20, got %d\n", a); + ok(b == 30, "expected b == 30, got %d\n", b); + ok(c == 40, "expected c == 40, got %d\n", c); } pomp_set_num_threads(max_threads);
1
0
0
0
André Hentschel : notepad: Use character count for GetFileTitleW (Coverity).
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: 457c5f1977a328062b69834c473ce38a87bb01eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=457c5f1977a328062b69834c4…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Sun Jul 19 23:36:06 2015 +0200 notepad: Use character count for GetFileTitleW (Coverity). --- programs/notepad/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/notepad/main.c b/programs/notepad/main.c index 8b654da..480f866 100644 --- a/programs/notepad/main.c +++ b/programs/notepad/main.c @@ -76,7 +76,7 @@ VOID SetFileNameAndEncoding(LPCWSTR szFileName, ENCODING enc) { lstrcpyW(Globals.szFileName, szFileName); Globals.szFileTitle[0] = 0; - GetFileTitleW(szFileName, Globals.szFileTitle, sizeof(Globals.szFileTitle)); + GetFileTitleW(szFileName, Globals.szFileTitle, sizeof(Globals.szFileTitle) / sizeof(WCHAR)); Globals.encFile = enc; }
1
0
0
0
André Hentschel : wordpad: Copy the correct amount of data with lstrcpynW (Coverity).
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: b5c3408a5e2060792058b9db1c64b69c9efe9731 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5c3408a5e2060792058b9db1…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Sun Jul 19 23:30:15 2015 +0200 wordpad: Copy the correct amount of data with lstrcpynW (Coverity). --- programs/wordpad/wordpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index f1a7ceb..bb34f2e 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -1232,7 +1232,7 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr) if (pFr->lpstrFindWhat != custom_data->findBuffer) { lstrcpynW(custom_data->findBuffer, pFr->lpstrFindWhat, - sizeof(custom_data->findBuffer)); + sizeof(custom_data->findBuffer) / sizeof(WCHAR)); pFr->lpstrFindWhat = custom_data->findBuffer; }
1
0
0
0
André Hentschel : mcicda: Remove dead code (Coverity) .
by Alexandre Julliard
20 Jul '15
20 Jul '15
Module: wine Branch: master Commit: fd490262ce5cf422d0e96c391ac278af5dc97815 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fd490262ce5cf422d0e96c391…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Sun Jul 19 22:49:52 2015 +0200 mcicda: Remove dead code (Coverity). --- dlls/mcicda/mcicda.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/mcicda/mcicda.c b/dlls/mcicda/mcicda.c index 1ea9a58..c7bacff 100644 --- a/dlls/mcicda/mcicda.c +++ b/dlls/mcicda/mcicda.c @@ -655,10 +655,9 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW lpParms) if (!ret) { TRACE("=> %s\n", debugstr_w(str)); if (lpParms->dwRetSize) { - WCHAR zero = 0; /* FIXME? Since NT, mciwave, mciseq and mcicda set dwRetSize * to the number of characters written, excluding \0. */ - lstrcpynW(lpParms->lpstrReturn, str ? str : &zero, lpParms->dwRetSize); + lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize); } else ret = MCIERR_PARAM_OVERFLOW; } if (MMSYSERR_NOERROR==ret && (dwFlags & MCI_NOTIFY))
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
57
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
Results per page:
10
25
50
100
200