Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | #include <config.h> | - |
24 | | - |
25 | #include "timespec.h" | - |
26 | | - |
27 | #include "intprops.h" | - |
28 | | - |
29 | struct timespec | - |
30 | dtotimespec (double sec) | - |
31 | { | - |
32 | if (! (TYPE_MINIMUM (time_t) < sec))TRUE | never evaluated | FALSE | evaluated 602 times by 3 tests |
| 0-602 |
33 | return make_timespec (TYPE_MINIMUM (time_t), 0); never executed: return make_timespec (((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))), 0); | 0 |
34 | else if (! (sec < 1.0 + TYPE_MAXIMUM (time_t)))TRUE | evaluated 4 times by 2 tests | FALSE | evaluated 598 times by 3 tests |
| 4-598 |
35 | return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1);executed 4 times by 2 tests: return make_timespec (((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))), TIMESPEC_RESOLUTION - 1); | 4 |
36 | else | - |
37 | { | - |
38 | time_t s = sec; | - |
39 | double frac = TIMESPEC_RESOLUTION * (sec - s); | - |
40 | long ns = frac; | - |
41 | ns += ns < frac; | - |
42 | s += ns / TIMESPEC_RESOLUTION; | - |
43 | ns %= TIMESPEC_RESOLUTION; | - |
44 | | - |
45 | if (ns < 0)TRUE | never evaluated | FALSE | evaluated 598 times by 3 tests |
| 0-598 |
46 | { | - |
47 | s--; | - |
48 | ns += TIMESPEC_RESOLUTION; | - |
49 | } never executed: end of block | 0 |
50 | | - |
51 | return make_timespec (s, ns);executed 598 times by 3 tests: return make_timespec (s, ns); | 598 |
52 | } | - |
53 | } | - |
| | |