[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 */
}
}
- [lmi-commits] [lmi] master 15b1aa35 11/22: Add license and copyright boilerplate, (continued)
- [lmi-commits] [lmi] master 15b1aa35 11/22: Add license and copyright boilerplate, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 4ec9da1f 12/22: Rename fdlibm sources, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master e8a859a3 06/22: Rename prototyping macro, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 078e9a1c 16/22: Ignore certain diagnostics, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 2d514bdc 09/22: Allow some common macros, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 1646f4c0 13/22: Rename fdlibm entry points, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 75dc2686 17/22: Write unambiguous braces, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 9e608afe 20/22: Remove debugging output for tests that now succeed, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 2563b0f6 07/22: Expunge prototypes for unreferenced functions, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master c6902b0d 19/22: Fix the defect just noted, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 6c12b4ea 22/22: Specify widths of some integers,
Greg Chicares <=