summaryrefslogtreecommitdiff
path: root/tests/nap.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-10-24 22:26:08 +0200
committerJörg Frings-Fürst <debian@jff.email>2022-10-24 22:26:08 +0200
commite97e0882ffc87a91e7818137196f1b74134566df (patch)
tree285662381eaa0514f988142bff0c8a9685c84dc0 /tests/nap.h
parentcc0876a2fa9e703b1064992ab535f3eed57e9c71 (diff)
parentcb4186bef1b44691db4221406d001a8d40c65b4b (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/nap.h')
-rw-r--r--tests/nap.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/nap.h b/tests/nap.h
index 2b3c1d2..37f8009 100644
--- a/tests/nap.h
+++ b/tests/nap.h
@@ -3,7 +3,7 @@
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -20,9 +20,8 @@
# define GLTEST_NAP_H
# include <limits.h>
-# include <stdbool.h>
-# include <intprops.h>
+# include <stdckdint.h>
/* Avoid a conflict with a function called nap() on UnixWare. */
# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__) /* OpenServer, UnixWare */
@@ -55,9 +54,9 @@ diff_timespec (struct timespec a, struct timespec b)
if (! (bs < as || (bs == as && bns < ans)))
return 0;
- if (INT_SUBTRACT_WRAPV (as, bs, &sdiff)
- || INT_MULTIPLY_WRAPV (sdiff, 1000000000, &sdiff)
- || INT_ADD_WRAPV (sdiff, ans - bns, &sdiff))
+ if (ckd_sub (&sdiff, as, bs)
+ || ckd_mul (&sdiff, sdiff, 1000000000)
+ || ckd_add (&sdiff, sdiff, ans - bns))
return INT_MAX;
return sdiff;