diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2022-10-24 22:25:29 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2022-10-24 22:25:29 +0200 |
commit | 26112352a774737e1ce5580c93654a26c1e82b39 (patch) | |
tree | d64e2f5b6e7aa92fa9a8ffb8ae5df75310532714 /tests/nap.h | |
parent | be8efac78d067c138ad8dda03df4336e73f94887 (diff) |
New upstream version 1.1upstream/1.1
Diffstat (limited to 'tests/nap.h')
-rw-r--r-- | tests/nap.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/nap.h b/tests/nap.h index 2b3c1d2f..37f8009c 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; |