Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/timespec.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | - | |||||||
9 | - | |||||||
10 | enum { TIMESPEC_RESOLUTION = 1000000000 }; | - | ||||||
11 | enum { LOG10_TIMESPEC_RESOLUTION = 9 }; | - | ||||||
12 | - | |||||||
13 | - | |||||||
14 | - | |||||||
15 | inline struct timespec | - | ||||||
16 | make_timespec (time_t s, long int ns) | - | ||||||
17 | { | - | ||||||
18 | struct timespec r; | - | ||||||
19 | r.tv_sec = s; | - | ||||||
20 | r.tv_nsec = ns; | - | ||||||
21 | return executed 602 times by 3 tests: r;return r; Executed by:
executed 602 times by 3 tests: return r; Executed by:
| 602 | ||||||
22 | } | - | ||||||
23 | inline int __attribute__ ((__pure__)) | - | ||||||
24 | timespec_cmp (struct timespec a, struct timespec b) | - | ||||||
25 | { | - | ||||||
26 | if (a.tv_sec < b.tv_sec
| 3972-425601 | ||||||
27 | return executed 3972 times by 3 tests: -1;return -1; Executed by:
executed 3972 times by 3 tests: return -1; Executed by:
| 3972 | ||||||
28 | if (a.tv_sec > b.tv_sec
| 197403-228198 | ||||||
29 | return executed 197403 times by 3 tests: 1;return 1; Executed by:
executed 197403 times by 3 tests: return 1; Executed by:
| 197403 | ||||||
30 | - | |||||||
31 | - | |||||||
32 | - | |||||||
33 | ((-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION) ? (void) 0 : __builtin_unreachable ()); | - | ||||||
34 | ((-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION) ? (void) 0 : __builtin_unreachable ()); | - | ||||||
35 | - | |||||||
36 | return executed 228198 times by 4 tests: a.tv_nsec - b.tv_nsec;return a.tv_nsec - b.tv_nsec; Executed by:
executed 228198 times by 4 tests: return a.tv_nsec - b.tv_nsec; Executed by:
| 228198 | ||||||
37 | } | - | ||||||
38 | - | |||||||
39 | - | |||||||
40 | - | |||||||
41 | inline int __attribute__ ((__pure__)) | - | ||||||
42 | timespec_sign (struct timespec a) | - | ||||||
43 | { | - | ||||||
44 | return never executed: a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; never executed: return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; | 0 | ||||||
45 | } | - | ||||||
46 | - | |||||||
47 | struct timespec timespec_add (struct timespec, struct timespec) | - | ||||||
48 | __attribute__ ((__const__)); | - | ||||||
49 | struct timespec timespec_sub (struct timespec, struct timespec) | - | ||||||
50 | __attribute__ ((__const__)); | - | ||||||
51 | struct timespec dtotimespec (double) | - | ||||||
52 | __attribute__ ((__const__)); | - | ||||||
53 | - | |||||||
54 | - | |||||||
55 | inline double | - | ||||||
56 | timespectod (struct timespec a) | - | ||||||
57 | { | - | ||||||
58 | return never executed: a.tv_sec + a.tv_nsec / 1e9;return a.tv_sec + a.tv_nsec / 1e9; never executed: return a.tv_sec + a.tv_nsec / 1e9; | 0 | ||||||
59 | } | - | ||||||
60 | - | |||||||
61 | void gettime (struct timespec *); | - | ||||||
62 | int settime (struct timespec const *); | - | ||||||
63 | - | |||||||
64 | - | |||||||
65 | - | |||||||
66 | - | |||||||
67 | - | |||||||
68 | - | |||||||
Switch to Source code | Preprocessed file |