Piotr Caban : msvcrt: Use __scalbn helper in ldexp implementation.

Alexandre Julliard julliard at winehq.org
Wed Jun 2 16:27:43 CDT 2021


Module: wine
Branch: master
Commit: 85da8da3d381b85e696e8df681bdf2a934d93cfc
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=85da8da3d381b85e696e8df681bdf2a934d93cfc

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jun  2 17:53:29 2021 +0200

msvcrt: Use __scalbn helper in ldexp implementation.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/math.c    | 4 +---
 dlls/msvcrt/unixlib.c | 9 ---------
 dlls/msvcrt/unixlib.h | 1 -
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 0bace98cd7d..3318f128159 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -3472,14 +3472,12 @@ int * CDECL __fpecode(void)
  */
 double CDECL ldexp(double num, int exp)
 {
-  double z = unix_funcs->ldexp(num,exp);
+  double z = __scalbn(num, exp);
 
   if (isfinite(num) && !isfinite(z))
     return math_error(_OVERFLOW, "ldexp", num, exp, z);
   if (num && isfinite(num) && !z)
     return math_error(_UNDERFLOW, "ldexp", num, exp, z);
-  if (z == 0 && signbit(z))
-    z = 0.0; /* Convert -0 -> +0 */
   return z;
 }
 
diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c
index d92203c1ab7..9afa0f41557 100644
--- a/dlls/msvcrt/unixlib.c
+++ b/dlls/msvcrt/unixlib.c
@@ -138,14 +138,6 @@ static float CDECL unix_hypotf(float x, float y)
     return hypotf( x, y );
 }
 
-/*********************************************************************
- *      ldexp
- */
-static double CDECL unix_ldexp(double num, int exp)
-{
-    return ldexp( num, exp );
-}
-
 /*********************************************************************
  *      lgamma
  */
@@ -306,7 +298,6 @@ static const struct unix_funcs funcs =
     unix_frexpf,
     unix_hypot,
     unix_hypotf,
-    unix_ldexp,
     unix_lgamma,
     unix_lgammaf,
     unix_log,
diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h
index a01ce285106..2faebbac82f 100644
--- a/dlls/msvcrt/unixlib.h
+++ b/dlls/msvcrt/unixlib.h
@@ -33,7 +33,6 @@ struct unix_funcs
     float           (CDECL *frexpf)(float x, int *exp);
     double          (CDECL *hypot)(double x, double y);
     float           (CDECL *hypotf)(float x, float y);
-    double          (CDECL *ldexp)(double x, int exp);
     double          (CDECL *lgamma)(double x);
     float           (CDECL *lgammaf)(float x);
     double          (CDECL *log)(double x);




More information about the wine-cvs mailing list