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
April 2021
----- 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
865 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Only read "*rect_count" when "rects" is non-NULL in wined3d_device_context_get_scissor_rects() (Valgrind).
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: ca03802a456e7cf4efd834edfeddc483ac72e4b5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ca03802a456e7cf4efd834ed…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 29 19:06:05 2021 +0200 wined3d: Only read "*rect_count" when "rects" is non-NULL in wined3d_device_context_get_scissor_rects() (Valgrind). When "rects" is NULL, "*rect_count" is potentially uninitialised. That's fairly benign because the resulting "count" value is inconsequential in that case, but it's also unnecessary, and easy to avoid. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f3d7cff74bf..813ee773478 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1722,8 +1722,7 @@ void CDECL wined3d_device_context_get_scissor_rects(const struct wined3d_device_ TRACE("context %p, rect_count %p, rects %p.\n", context, rect_count, rects); - count = rect_count ? min(*rect_count, state->scissor_rect_count) : 1; - if (count && rects) + if (rects && (count = rect_count ? min(*rect_count, state->scissor_rect_count) : 1)) memcpy(rects, state->scissor_rects, count * sizeof(*rects)); if (rect_count) *rect_count = state->scissor_rect_count;
1
0
0
0
Henri Verbeet : d3d11/tests: Initialise "constant" in test_device_context_state() (Valgrind).
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: e7ebe3d8d24c872e44dd9f62b001fec8e4014d0d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e7ebe3d8d24c872e44dd9f62…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 29 19:06:04 2021 +0200 d3d11/tests: Initialise "constant" in test_device_context_state() (Valgrind). We're mostly just using this to make sure the value we read back is that same as the one we set, so in that sense the actual value is inconsequential. Nevertheless, randomness is generally undesirable in the tests. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ca60170d080..191df67a41d 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6775,6 +6775,7 @@ static void test_device_context_state(void) 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000020, 0x00050050, 0x00000008, 0x0100086a, 0x0400009b, 0x00000001, 0x00000001, 0x00000001, 0x0100003e, }; + static const struct vec4 constant = {1.257f, 1.885f, 2.513f, 3.770f}; ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; UINT ib_offset, vb_offset, vb_stride, so_offset, offset, stride, sample_mask, stencil_ref, count; @@ -6814,7 +6815,6 @@ static void test_device_context_state(void) ID3D11Texture2D *texture; enum DXGI_FORMAT format; float blend_factor[4]; - struct vec4 constant; DWORD data_size; BOOL pred_value; ULONG refcount;
1
0
0
0
Henri Verbeet : wined3d: Free the program variants array in shader_spirv_destroy() (Valgrind).
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 55795588f45be11c296214cfb1e60b3fb51e81bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=55795588f45be11c296214cf…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 29 19:06:03 2021 +0200 wined3d: Free the program variants array in shader_spirv_destroy() (Valgrind). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/shader_spirv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index eb2647db12d..7617ee9d6ef 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1019,6 +1019,7 @@ static void shader_spirv_destroy(struct wined3d_shader *shader) shader_spirv_invalidate_contexts_graphics_program_variant(&device_vk->d, variant_vk); VK_CALL(vkDestroyShaderModule(device_vk->vk_device, variant_vk->vk_module, NULL)); } + heap_free(program_vk->variants); vkd3d_shader_free_scan_descriptor_info(&program_vk->descriptor_info); shader->backend_data = NULL;
1
0
0
0
Henri Verbeet : wined3d: Avoid accessing the bo_user list from outside the command stream thread (Valgrind).
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 7e64eba5b343e6ad2487c691911b0430c422bb5e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7e64eba5b343e6ad2487c691…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 29 19:06:02 2021 +0200 wined3d: Avoid accessing the bo_user list from outside the command stream thread (Valgrind). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 69 ++++++++++++++++++++---------------------- dlls/wined3d/adapter_vk.c | 77 ++++++++++++++++++++++------------------------- 2 files changed, 68 insertions(+), 78 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7e64eba5b343e6ad2487…
1
0
0
0
Piotr Caban : msvcrt: Import round implementation from musl.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: f4de92a4ed5c8d8d8c1b57222ad3d10e7bd63229 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f4de92a4ed5c8d8d8c1b5722…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 29 17:06:41 2021 +0200 msvcrt: Import round implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 33 ++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 32 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 2251a30af72..ca517b1d31a 100755 --- a/configure +++ b/configure @@ -19651,7 +19651,6 @@ for ac_func in \ remquof \ rint \ rintf \ - round \ tgamma \ tgammaf \ trunc \ diff --git a/configure.ac b/configure.ac index 20ec971b5bb..46bbb8a70f8 100644 --- a/configure.ac +++ b/configure.ac @@ -2694,7 +2694,6 @@ AC_CHECK_FUNCS(\ remquof \ rint \ rintf \ - round \ tgamma \ tgammaf \ trunc \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 018a8ae47e4..a29ed5786e2 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -87,6 +87,14 @@ static inline float fp_barrierf(float x) return y; } +#if _MSVCR_VER>=120 +static inline double fp_barrier(double x) +{ + volatile double y = x; + return y; +} +#endif + static inline double CDECL ret_nan( BOOL update_sw ) { double x = 1.0; @@ -4321,10 +4329,33 @@ short CDECL _dclass(double x) /********************************************************************* * round (MSVCR120.@) + * + * Copied from musl: src/math/round.c */ double CDECL round(double x) { - return unix_funcs->round(x); + static const double toint = 1 / DBL_EPSILON; + + ULONGLONG llx = *(ULONGLONG*)&x; + int e = llx >> 52 & 0x7ff; + double y; + + if (e >= 0x3ff + 52) + return x; + if (llx >> 63) + x = -x; + if (e < 0x3ff - 1) + return 0 * *(double*)&llx; + y = fp_barrier(x + toint) - toint - x; + if (y > 0.5) + y = y + x - 1; + else if (y <= -0.5) + y = y + x + 1; + else + y = y + x; + if (llx >> 63) + y = -y; + return y; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index a7c7202c516..33c25ef8d40 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -753,18 +753,6 @@ static float CDECL unix_rintf(float x) #endif } -/********************************************************************* - * round - */ -static double CDECL unix_round(double x) -{ -#ifdef HAVE_ROUND - return round(x); -#else - return unix_rint(x); -#endif -} - /********************************************************************* * sin */ @@ -948,7 +936,6 @@ static const struct unix_funcs funcs = unix_remquof, unix_rint, unix_rintf, - unix_round, unix_sin, unix_sinf, unix_sinh, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 89972ed669f..c96eda3c3a0 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -90,7 +90,6 @@ struct unix_funcs float (CDECL *remquof)(float x, float y, int *quo); double (CDECL *rint)(double x); float (CDECL *rintf)(float x); - double (CDECL *round)(double x); double (CDECL *sin)(double x); float (CDECL *sinf)(float x); double (CDECL *sinh)(double x); diff --git a/include/config.h.in b/include/config.h.in index 387c8b718ff..a0bc1b4b247 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -690,9 +690,6 @@ /* Define to 1 if you have the `rintf' function. */ #undef HAVE_RINTF -/* Define to 1 if you have the `round' function. */ -#undef HAVE_ROUND - /* Define to 1 if you have the <sasl/sasl.h> header file. */ #undef HAVE_SASL_SASL_H
1
0
0
0
Piotr Caban : msvcrt: Import lround implementation from musl.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 69ad3c11cfb00b518c78103525e3452502173195 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=69ad3c11cfb00b518c781035…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 29 17:06:38 2021 +0200 msvcrt: Import lround implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 9 ++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 794a3e09c29..2251a30af72 100755 --- a/configure +++ b/configure @@ -19641,7 +19641,6 @@ for ac_func in \ log2f \ lrint \ lrintf \ - lround \ nearbyint \ nearbyintf \ nexttoward \ diff --git a/configure.ac b/configure.ac index 3bfa2885002..20ec971b5bb 100644 --- a/configure.ac +++ b/configure.ac @@ -2684,7 +2684,6 @@ AC_CHECK_FUNCS(\ log2f \ lrint \ lrintf \ - lround \ nearbyint \ nearbyintf \ nexttoward \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index e1251ba7115..018a8ae47e4 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4360,10 +4360,17 @@ float CDECL roundf(float x) /********************************************************************* * lround (MSVCR120.@) + * + * Copied from musl: src/math/lround.c */ __msvcrt_long CDECL lround(double x) { - return unix_funcs->lround( x ); + double d = round(x); + if (d != (double)(__msvcrt_long)d) { + *_errno() = EDOM; + return 0; + } + return d; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 3bf99c09c24..a7c7202c516 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -765,18 +765,6 @@ static double CDECL unix_round(double x) #endif } -/********************************************************************* - * lround - */ -static int CDECL unix_lround(double x) -{ -#ifdef HAVE_LROUND - return lround(x); -#else - return unix_round(x); -#endif -} - /********************************************************************* * sin */ @@ -944,7 +932,6 @@ static const struct unix_funcs funcs = unix_logbf, unix_lrint, unix_lrintf, - unix_lround, unix_modf, unix_modff, unix_nearbyint, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index c74115bc76c..89972ed669f 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -74,7 +74,6 @@ struct unix_funcs float (CDECL *logbf)(float x); int (CDECL *lrint)(double x); int (CDECL *lrintf)(float x); - int (CDECL *lround)(double x); double (CDECL *modf)(double x, double *iptr); float (CDECL *modff)(float x, float *iptr); double (CDECL *nearbyint)(double num); diff --git a/include/config.h.in b/include/config.h.in index 544fe85b248..387c8b718ff 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -477,9 +477,6 @@ /* Define to 1 if you have the `lrintf' function. */ #undef HAVE_LRINTF -/* Define to 1 if you have the `lround' function. */ -#undef HAVE_LROUND - /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT
1
0
0
0
Piotr Caban : msvcrt: Import lroundf implementation from musl.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 7fa8b03cd3ff16664bd3bfb3286dff1346e5dc08 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7fa8b03cd3ff16664bd3bfb3…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 29 17:06:35 2021 +0200 msvcrt: Import lroundf implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 9 ++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 690f9333f14..794a3e09c29 100755 --- a/configure +++ b/configure @@ -19642,7 +19642,6 @@ for ac_func in \ lrint \ lrintf \ lround \ - lroundf \ nearbyint \ nearbyintf \ nexttoward \ diff --git a/configure.ac b/configure.ac index b0977c112b4..3bfa2885002 100644 --- a/configure.ac +++ b/configure.ac @@ -2685,7 +2685,6 @@ AC_CHECK_FUNCS(\ lrint \ lrintf \ lround \ - lroundf \ nearbyint \ nearbyintf \ nexttoward \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index c8dd53cf095..e1251ba7115 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4368,10 +4368,17 @@ __msvcrt_long CDECL lround(double x) /********************************************************************* * lroundf (MSVCR120.@) + * + * Copied from musl: src/math/lroundf.c */ __msvcrt_long CDECL lroundf(float x) { - return unix_funcs->lroundf( x ); + float f = roundf(x); + if (f != (float)(__msvcrt_long)f) { + *_errno() = EDOM; + return 0; + } + return f; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index e3ddd486e93..3bf99c09c24 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -777,18 +777,6 @@ static int CDECL unix_lround(double x) #endif } -/********************************************************************* - * lroundf - */ -static int CDECL unix_lroundf(float x) -{ -#ifdef HAVE_LROUNDF - return lroundf(x); -#else - return unix_lround(x); -#endif -} - /********************************************************************* * sin */ @@ -957,7 +945,6 @@ static const struct unix_funcs funcs = unix_lrint, unix_lrintf, unix_lround, - unix_lroundf, unix_modf, unix_modff, unix_nearbyint, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 49ec319d219..c74115bc76c 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -75,7 +75,6 @@ struct unix_funcs int (CDECL *lrint)(double x); int (CDECL *lrintf)(float x); int (CDECL *lround)(double x); - int (CDECL *lroundf)(float x); double (CDECL *modf)(double x, double *iptr); float (CDECL *modff)(float x, float *iptr); double (CDECL *nearbyint)(double num); diff --git a/include/config.h.in b/include/config.h.in index 71f9f4350b0..544fe85b248 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -480,9 +480,6 @@ /* Define to 1 if you have the `lround' function. */ #undef HAVE_LROUND -/* Define to 1 if you have the `lroundf' function. */ -#undef HAVE_LROUNDF - /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT
1
0
0
0
Piotr Caban : msvcrt: Import llround implementation from musl.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 389e0532fe2ae0eac770c90df31773a3c6c91a47 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=389e0532fe2ae0eac770c90d…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 29 17:06:33 2021 +0200 msvcrt: Import llround implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 9 ++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 61ff110a9d4..690f9333f14 100755 --- a/configure +++ b/configure @@ -19635,7 +19635,6 @@ for ac_func in \ lgammaf \ llrint \ llrintf \ - llround \ log1p \ log1pf \ log2 \ diff --git a/configure.ac b/configure.ac index a8842bcb52a..b0977c112b4 100644 --- a/configure.ac +++ b/configure.ac @@ -2678,7 +2678,6 @@ AC_CHECK_FUNCS(\ lgammaf \ llrint \ llrintf \ - llround \ log1p \ log1pf \ log2 \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index e5c2ed66d2b..c8dd53cf095 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4376,10 +4376,17 @@ __msvcrt_long CDECL lroundf(float x) /********************************************************************* * llround (MSVCR120.@) + * + * Copied from musl: src/math/llround.c */ __int64 CDECL llround(double x) { - return unix_funcs->llround( x ); + double d = round(x); + if (d != (double)(__int64)d) { + *_errno() = EDOM; + return 0; + } + return d; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index e23456e8250..e3ddd486e93 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -789,18 +789,6 @@ static int CDECL unix_lroundf(float x) #endif } -/********************************************************************* - * llround - */ -static __int64 CDECL unix_llround(double x) -{ -#ifdef HAVE_LLROUND - return llround(x); -#else - return unix_round(x); -#endif -} - /********************************************************************* * sin */ @@ -956,7 +944,6 @@ static const struct unix_funcs funcs = unix_lgammaf, unix_llrint, unix_llrintf, - unix_llround, unix_log, unix_logf, unix_log10, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index db090a9a2aa..49ec319d219 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -62,7 +62,6 @@ struct unix_funcs float (CDECL *lgammaf)(float x); __int64 (CDECL *llrint)(double x); __int64 (CDECL *llrintf)(float x); - __int64 (CDECL *llround)(double x); double (CDECL *log)(double x); float (CDECL *logf)(float x); double (CDECL *log10)(double x); diff --git a/include/config.h.in b/include/config.h.in index 25c4e3f42ec..71f9f4350b0 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -459,9 +459,6 @@ /* Define to 1 if you have the `llrintf' function. */ #undef HAVE_LLRINTF -/* Define to 1 if you have the `llround' function. */ -#undef HAVE_LLROUND - /* Define to 1 if you have the `log1p' function. */ #undef HAVE_LOG1P
1
0
0
0
Piotr Caban : msvcrt: Import llroundf implementation from musl.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 668cf2e66d3665612503b2bc2a4f254b3a7fa553 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=668cf2e66d3665612503b2bc…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 29 17:06:30 2021 +0200 msvcrt: Import llroundf implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 9 ++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 1ff743f0328..61ff110a9d4 100755 --- a/configure +++ b/configure @@ -19636,7 +19636,6 @@ for ac_func in \ llrint \ llrintf \ llround \ - llroundf \ log1p \ log1pf \ log2 \ diff --git a/configure.ac b/configure.ac index 8ce76f1d645..a8842bcb52a 100644 --- a/configure.ac +++ b/configure.ac @@ -2679,7 +2679,6 @@ AC_CHECK_FUNCS(\ llrint \ llrintf \ llround \ - llroundf \ log1p \ log1pf \ log2 \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 586f8950e0a..e5c2ed66d2b 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4384,10 +4384,17 @@ __int64 CDECL llround(double x) /********************************************************************* * llroundf (MSVCR120.@) + * + * Copied from musl: src/math/llroundf.c */ __int64 CDECL llroundf(float x) { - return unix_funcs->llroundf( x ); + float f = roundf(x); + if (f != (float)(__int64)f) { + *_errno() = EDOM; + return 0; + } + return f; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 456cb3de574..e23456e8250 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -801,18 +801,6 @@ static __int64 CDECL unix_llround(double x) #endif } -/********************************************************************* - * llroundf - */ -static __int64 CDECL unix_llroundf(float x) -{ -#ifdef HAVE_LLROUNDF - return llroundf(x); -#else - return unix_llround(x); -#endif -} - /********************************************************************* * sin */ @@ -969,7 +957,6 @@ static const struct unix_funcs funcs = unix_llrint, unix_llrintf, unix_llround, - unix_llroundf, unix_log, unix_logf, unix_log10, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 2841a28f478..db090a9a2aa 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -63,7 +63,6 @@ struct unix_funcs __int64 (CDECL *llrint)(double x); __int64 (CDECL *llrintf)(float x); __int64 (CDECL *llround)(double x); - __int64 (CDECL *llroundf)(float x); double (CDECL *log)(double x); float (CDECL *logf)(float x); double (CDECL *log10)(double x); diff --git a/include/config.h.in b/include/config.h.in index 749b79e1092..25c4e3f42ec 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -462,9 +462,6 @@ /* Define to 1 if you have the `llround' function. */ #undef HAVE_LLROUND -/* Define to 1 if you have the `llroundf' function. */ -#undef HAVE_LLROUNDF - /* Define to 1 if you have the `log1p' function. */ #undef HAVE_LOG1P
1
0
0
0
Piotr Caban : msvcrt: Import roundf implementation from musl.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 833e8cdd42a59df471f493e906efa3501adcd142 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=833e8cdd42a59df471f493e9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 29 17:06:27 2021 +0200 msvcrt: Import roundf implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 25 ++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 429d97ebfdc..1ff743f0328 100755 --- a/configure +++ b/configure @@ -19656,7 +19656,6 @@ for ac_func in \ rint \ rintf \ round \ - roundf \ tgamma \ tgammaf \ trunc \ diff --git a/configure.ac b/configure.ac index e9dde0f9781..8ce76f1d645 100644 --- a/configure.ac +++ b/configure.ac @@ -2699,7 +2699,6 @@ AC_CHECK_FUNCS(\ rint \ rintf \ round \ - roundf \ tgamma \ tgammaf \ trunc \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 5a0c0874ee5..586f8950e0a 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4329,10 +4329,33 @@ double CDECL round(double x) /********************************************************************* * roundf (MSVCR120.@) + * + * Copied from musl: src/math/roundf.c */ float CDECL roundf(float x) { - return unix_funcs->roundf(x); + static const float toint = 1 / FLT_EPSILON; + + unsigned int ix = *(unsigned int*)&x; + int e = ix >> 23 & 0xff; + float y; + + if (e >= 0x7f + 23) + return x; + if (ix >> 31) + x = -x; + if (e < 0x7f - 1) + return 0 * *(float*)&ix; + y = fp_barrierf(x + toint) - toint - x; + if (y > 0.5f) + y = y + x - 1; + else if (y <= -0.5f) + y = y + x + 1; + else + y = y + x; + if (ix >> 31) + y = -y; + return y; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index d62110c0006..456cb3de574 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -765,18 +765,6 @@ static double CDECL unix_round(double x) #endif } -/********************************************************************* - * roundf - */ -static float CDECL unix_roundf(float x) -{ -#ifdef HAVE_ROUNDF - return roundf(x); -#else - return unix_round(x); -#endif -} - /********************************************************************* * lround */ @@ -1013,7 +1001,6 @@ static const struct unix_funcs funcs = unix_rint, unix_rintf, unix_round, - unix_roundf, unix_sin, unix_sinf, unix_sinh, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 5f1f79d5e4b..2841a28f478 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -95,7 +95,6 @@ struct unix_funcs double (CDECL *rint)(double x); float (CDECL *rintf)(float x); double (CDECL *round)(double x); - float (CDECL *roundf)(float x); double (CDECL *sin)(double x); float (CDECL *sinf)(float x); double (CDECL *sinh)(double x); diff --git a/include/config.h.in b/include/config.h.in index 11f29fcf8bc..749b79e1092 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -705,9 +705,6 @@ /* Define to 1 if you have the `round' function. */ #undef HAVE_ROUND -/* Define to 1 if you have the `roundf' function. */ -#undef HAVE_ROUNDF - /* Define to 1 if you have the <sasl/sasl.h> header file. */ #undef HAVE_SASL_SASL_H
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
87
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
Results per page:
10
25
50
100
200