This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Update signbit functions to work on targets where integers are only 16-bits.


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d958183ba446d8c0bf55cdb5479b54a347b3439a

commit d958183ba446d8c0bf55cdb5479b54a347b3439a
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed May 13 09:34:37 2015 +0100

    Update signbit functions to work on targets where integers are only 16-bits.
    
    	* libm/common/s_signbit.c (__signbitf): Fix for 16-bit targets.
    	(__signbitd): Likewise.

Diff:
---
 newlib/ChangeLog               | 5 +++++
 newlib/libm/common/s_signbit.c | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index e40d26b..d36decd 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-13  Nick Clifton  <nickc@redhat.com>
+
+	* libm/common/s_signbit.c (__signbitf): Fix for 16-bit targets.
+	(__signbitd): Likewise.
+
 2015-05-02  Corinna Vinschen  <vinschen@redhat.com>
 
 	* libc/include/sys/time.h: Include sys/select.h on Cygwin.  Explain why.
diff --git a/newlib/libm/common/s_signbit.c b/newlib/libm/common/s_signbit.c
index 746ab46..6ea714d 100644
--- a/newlib/libm/common/s_signbit.c
+++ b/newlib/libm/common/s_signbit.c
@@ -41,19 +41,19 @@ int __signbitd (double x);
 int
 __signbitf (float x)
 {
-  unsigned int w;
+  __uint32_t w;
 
   GET_FLOAT_WORD(w,x);
 
-  return (w & 0x80000000);
+  return (w & 0x80000000) != 0;
 }
 
 int
 __signbitd (double x)
 {
-  unsigned int msw;
+  __uint32_t msw;
 
   GET_HIGH_WORD(msw, x);
 
-  return (msw & 0x80000000);
+  return (msw & 0x80000000) != 0;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]