From 7769bd490c44919fc733766982a5e6437ccff1f2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 17 Sep 2018 06:21:25 -0600 Subject: [PATCH] sched/signal/sig_nanosleep.c: Fix an error introduced with recent commit. Noted by Jussi Kivilinna. --- libs/libc/math/lib_log.c | 2 +- libs/libc/math/lib_logf.c | 2 +- sched/signal/sig_nanosleep.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/libc/math/lib_log.c b/libs/libc/math/lib_log.c index 59d7bff62b..c39e9e8022 100644 --- a/libs/libc/math/lib_log.c +++ b/libs/libc/math/lib_log.c @@ -77,7 +77,7 @@ double log(double x) { y_old = y; ney = exp(-y); - y -= 1 - x * ney; + y -= 1.0 - x * ney; if (y > 700.0) { diff --git a/libs/libc/math/lib_logf.c b/libs/libc/math/lib_logf.c index 1ae9579166..e813568bf3 100644 --- a/libs/libc/math/lib_logf.c +++ b/libs/libc/math/lib_logf.c @@ -74,7 +74,7 @@ float logf(float x) { y_old = y; ney = expf(-y); - y -= 1 - x * ney; + y -= 1.0F - x * ney; if (y > FLT_MAX_EXP_X) { diff --git a/sched/signal/sig_nanosleep.c b/sched/signal/sig_nanosleep.c index 319af24214..f68d2bd0d6 100644 --- a/sched/signal/sig_nanosleep.c +++ b/sched/signal/sig_nanosleep.c @@ -113,7 +113,7 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp, /* Sanity check */ - if (rqtp != NULL || rqtp->tv_nsec < 0 || rqtp->tv_nsec >= 1000000000) + if (rqtp == NULL || rqtp->tv_nsec < 0 || rqtp->tv_nsec >= 1000000000) { return -EINVAL; }