[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 75dc2686 17/22: Write unambiguous braces
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 75dc2686 17/22: Write unambiguous braces |
Date: |
Fri, 20 May 2022 22:43:42 -0400 (EDT) |
branch: master
commit 75dc2686f227c1de901e64dd81b57f1f9422d0ee
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Write unambiguous braces
Resolved issues identified by gcc's '-Wdangling-else'.
---
fdlibm_expm1.c | 3 ++-
fdlibm_log1p.c | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fdlibm_expm1.c b/fdlibm_expm1.c
index a193d55a..4b8be959 100644
--- a/fdlibm_expm1.c
+++ b/fdlibm_expm1.c
@@ -308,9 +308,10 @@ double fdlibm_expm1(double);
e = (x*(e-c)-c);
e -= hxs;
if(k== -1) return 0.5*(x-e)-0.5;
- if(k==1)
+ if(k==1) {
if(x < -0.25) return -2.0*(e-(x+0.5));
else return one+2.0*(x-e);
+ }
if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */
y = one-(e-x);
FDLIBM_HI(y) += (k<<20); /* add k to y's exponent */
diff --git a/fdlibm_log1p.c b/fdlibm_log1p.c
index e0c08084..47062032 100644
--- a/fdlibm_log1p.c
+++ b/fdlibm_log1p.c
@@ -267,8 +267,10 @@ double fdlibm_log1p(double);
}
hfsq=0.5*f*f;
if(hu==0) { /* |f| < 2**-20 */
- if(f==zero) if(k==0) return zero;
- else {c += k*ln2_lo; return k*ln2_hi+c;}
+ if(f==zero) {
+ if(k==0) return zero;
+ else {c += k*ln2_lo; return k*ln2_hi+c;}
+ }
R = hfsq*(1.0-0.66666666666666666*f);
if(k==0) return f-R; else
return k*ln2_hi-((R-(k*ln2_lo+c))-f);
- [lmi-commits] [lmi] master 5b1ef5bb 15/22: Add prototypes, (continued)
- [lmi-commits] [lmi] master 5b1ef5bb 15/22: Add prototypes, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master dd3abb11 18/22: Demonstrate a defect, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master af8d3ac0 21/22: Rationalize indentation of preprocessor directives, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 324e171e 02/22: Rectify whitespace, Greg Chicares, 2022/05/20
- [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 <=
- [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, 2022/05/20