OSDN Git Service

* mingwex/math/signbit.c (__signbit): Make return value
authordannysmith <dannysmith>
Tue, 3 May 2005 08:39:15 +0000 (08:39 +0000)
committerdannysmith <dannysmith>
Tue, 3 May 2005 08:39:15 +0000 (08:39 +0000)
consistent with GCC's __builtin_signbit.
* mingwex/math/signbitf.c (__signbitf):  Likewise.
* mingwex/math/signbitf.c (__signbitl):  Likewise.
* include/math.h (__signbit, __signbitf, __signbitl): Likewise
for inlines.

winsup/mingw/ChangeLog
winsup/mingw/include/math.h
winsup/mingw/mingwex/math/signbit.c
winsup/mingw/mingwex/math/signbitf.c
winsup/mingw/mingwex/math/signbitl.c

index f9b7088..97272e8 100644 (file)
@@ -1,3 +1,12 @@
+2005-05-03  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * mingwex/math/signbit.c (__signbit):  Make return value
+       consistent with GCC's __builtin_signbit.
+       * mingwex/math/signbitf.c (__signbitf):  Likewise.
+       * mingwex/math/signbitf.c (__signbitl):  Likewise.
+       * include/math.h (__signbit, __signbitf, __signbitl): Likewise
+       for inlines.
+
 2005-05-02  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as
index 29bf27c..585723b 100644 (file)
@@ -373,19 +373,19 @@ __CRT_INLINE int __cdecl __isnanl (long double _x)
 __CRT_INLINE int __cdecl __signbit (double x) {
   unsigned short stw;
   __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
-  return stw & 0x0200;
+  return (stw & 0x0200) != 0;
 }
 
 __CRT_INLINE int __cdecl __signbitf (float x) {
   unsigned short stw;
   __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
-  return stw & 0x0200;
+  return (stw & 0x0200) != 0;
 }
 
 __CRT_INLINE int __cdecl __signbitl (long double x) {
   unsigned short stw;
   __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
-  return stw & 0x0200;
+  return (stw & 0x0200) != 0;
 }
 
 #define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x)      \
index 7f86c86..997ddf8 100644 (file)
@@ -5,7 +5,7 @@ int __signbit (double x) {
   __asm__ ("fxam; fstsw %%ax;"
           : "=a" (sw)
           : "t" (x) );
-  return sw & __FP_SIGNBIT;
+  return (sw & __FP_SIGNBIT) != 0;
 }
 
 #undef signbit
index 5bbf675..1c96b9f 100644 (file)
@@ -5,6 +5,6 @@ int __signbitf (float x) {
   __asm__ ("fxam; fstsw %%ax;"
           : "=a" (sw)
           : "t" (x) );
-  return sw & __FP_SIGNBIT;
+  return (sw & __FP_SIGNBIT) != 0;
 }
 int __attribute__ ((alias ("__signbitf"))) signbitf (float);
index 78f9903..8b7bca5 100644 (file)
@@ -5,7 +5,7 @@ int __signbitl (long double x) {
   __asm__ ("fxam; fstsw %%ax;"
           : "=a" (sw)
           : "t" (x) );
-  return sw & __FP_SIGNBIT;
+  return (sw & __FP_SIGNBIT) != 0;
 }
 
 int __attribute__ ((alias ("__signbitl"))) signbitl (long double);