lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 6c12b4ea 22/22: Specify widths of some intege


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6c12b4ea 22/22: Specify widths of some integers
Date: Fri, 20 May 2022 22:43:43 -0400 (EDT)

branch: master
commit 6c12b4ea5cb7ee4d4ab2537594f900a11b2b4ec3
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Specify widths of some integers
    
    It is challenging to retrofit strong typing to old code; these changes
    follow glibc. Cf:
    
    
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/ieee754/dbl-64/s_expm1.c
    
    
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/ieee754/dbl-64/s_log1p.c
    
    and dependencies:
    
    
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/ieee754/dbl-64/s_expm1.c
    
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/ieee754/dbl-64/s_log1p.c
    
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/generic/math_private.h
    
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/generic/math-barriers.h
    https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=math/math-underflow.h
---
 fdlibm_expm1.c | 6 ++++--
 fdlibm_log1p.c | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/fdlibm_expm1.c b/fdlibm_expm1.c
index 5aa6c6ac..61c66d63 100644
--- a/fdlibm_expm1.c
+++ b/fdlibm_expm1.c
@@ -30,6 +30,8 @@
 // it's the simplest lmi header.
 #include "version.hpp"
 
+#include <stdint.h>
+
 #if defined __GNUC__
 #   pragma GCC diagnostic push
 #   pragma GCC diagnostic ignored "-Wfloat-conversion"
@@ -250,8 +252,8 @@ double fdlibm_expm1(double);
 #endif // !defined __STDC__
 {
     double y,hi,lo,c,t,e,hxs,hfx,r1;
-    int k,xsb;
-    unsigned hx;
+    int32_t k,xsb;
+    uint32_t hx;
 
     hx  = FDLIBM_HI(x);         /* high word of x */
     xsb = hx&0x80000000;        /* sign bit of x */
diff --git a/fdlibm_log1p.c b/fdlibm_log1p.c
index bb1ee8b0..3b3f48db 100644
--- a/fdlibm_log1p.c
+++ b/fdlibm_log1p.c
@@ -30,6 +30,8 @@
 // it's the simplest lmi header.
 #include "version.hpp"
 
+#include <stdint.h>
+
 #if defined __GNUC__
 #   pragma GCC diagnostic push
 #   pragma GCC diagnostic ignored "-Wstrict-aliasing"
@@ -218,7 +220,7 @@ double fdlibm_log1p(double);
 #endif // !defined __STDC__
 {
     double hfsq,f,c,s,z,R,u;
-    int k,hx,hu,ax;
+    int32_t k,hx,hu,ax;
 
     hx = FDLIBM_HI(x);        /* high word of x */
     ax = hx&0x7fffffff;
@@ -236,7 +238,7 @@ double fdlibm_log1p(double);
             else
                 return x - x*x*0.5;
         }
-        if(hx>0||hx<=((int)0xbfd2bec3)) {
+        if(hx>0||hx<=((int32_t)0xbfd2bec3)) {
             k=0;f=x;hu=1;                       /* -0.2929<x<0.41422 */
         }
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]