summaryrefslogtreecommitdiff
path: root/lib/timespec-sub.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-05-18 09:04:57 +0800
committerPo Lu <luangruo@yahoo.com>2023-05-18 09:04:57 +0800
commit074c0268fd32d6527e124cff386bb6b15cf90017 (patch)
tree62111c3c70d46a738f15514e988a707409ca45f4 /lib/timespec-sub.c
parentdb48eff8cf4a88393c0209f663ca194ee37fa747 (diff)
parent5ef169ed701fa4f850fdca5563cdd468207d5d4f (diff)
downloademacs-feature/android.tar.gz
Merge remote-tracking branch 'origin/master' into feature/androidfeature/android
Diffstat (limited to 'lib/timespec-sub.c')
-rw-r--r--lib/timespec-sub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c
index 822c2831089..f8052400410 100644
--- a/lib/timespec-sub.c
+++ b/lib/timespec-sub.c
@@ -24,6 +24,7 @@
#include <config.h>
#include "timespec.h"
+#include <stdckdint.h>
#include "intprops.h"
struct timespec
@@ -38,7 +39,7 @@ timespec_sub (struct timespec a, struct timespec b)
{
rns = ns + TIMESPEC_HZ;
time_t bs1;
- if (!INT_ADD_WRAPV (bs, 1, &bs1))
+ if (!ckd_add (&bs1, bs, 1))
bs = bs1;
else if (- TYPE_SIGNED (time_t) < rs)
rs--;
@@ -46,7 +47,7 @@ timespec_sub (struct timespec a, struct timespec b)
goto low_overflow;
}
- if (INT_SUBTRACT_WRAPV (rs, bs, &rs))
+ if (ckd_sub (&rs, rs, bs))
{
if (0 < bs)
{