summaryrefslogtreecommitdiff
path: root/tests/nap.h
diff options
context:
space:
mode:
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;