Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/cycle-check.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||
11 | static | - | ||||||||||||||||||||||||||||||
12 | _Bool | - | ||||||||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||||||||
14 | is_zero_or_power_of_two (uintmax_t i) | - | ||||||||||||||||||||||||||||||
15 | { | - | ||||||||||||||||||||||||||||||
16 | return executed 100755 times by 6 tests: (i & (i - 1)) == 0;return (i & (i - 1)) == 0; Executed by:
executed 100755 times by 6 tests: return (i & (i - 1)) == 0; Executed by:
| 100755 | ||||||||||||||||||||||||||||||
17 | } | - | ||||||||||||||||||||||||||||||
18 | - | |||||||||||||||||||||||||||||||
19 | void | - | ||||||||||||||||||||||||||||||
20 | cycle_check_init (struct cycle_check_state *state) | - | ||||||||||||||||||||||||||||||
21 | { | - | ||||||||||||||||||||||||||||||
22 | state->chdir_counter = 0; | - | ||||||||||||||||||||||||||||||
23 | state->magic = 9827862; | - | ||||||||||||||||||||||||||||||
24 | } executed 14208 times by 6 tests: end of block Executed by:
| 14208 | ||||||||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||||||||
26 | _Bool | - | ||||||||||||||||||||||||||||||
27 | - | |||||||||||||||||||||||||||||||
28 | cycle_check (struct cycle_check_state *state, struct stat const *sb) | - | ||||||||||||||||||||||||||||||
29 | { | - | ||||||||||||||||||||||||||||||
30 | - | |||||||||||||||||||||||||||||||
31 | (( | - | ||||||||||||||||||||||||||||||
32 | state->magic == 9827862 | - | ||||||||||||||||||||||||||||||
33 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||||||||||||||||||||
34 | "state->magic == 9827862" | - | ||||||||||||||||||||||||||||||
35 | , "lib/cycle-check.c", 60, __PRETTY_FUNCTION__)) | - | ||||||||||||||||||||||||||||||
36 | ; | - | ||||||||||||||||||||||||||||||
37 | - | |||||||||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||||||||
41 | if (state->chdir_counter
| 0-95864 | ||||||||||||||||||||||||||||||
42 | return never executed: return 1 ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||
43 | 1 never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||
44 | ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||||||||
47 | - | |||||||||||||||||||||||||||||||
48 | if (is_zero_or_power_of_two (++(state->chdir_counter))
| 5269-95486 | ||||||||||||||||||||||||||||||
49 | { | - | ||||||||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||||||||
52 | - | |||||||||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||||||||
54 | - | |||||||||||||||||||||||||||||||
55 | if (state->chdir_counter == 0
| 0-5269 | ||||||||||||||||||||||||||||||
56 | return never executed: return 1 ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||
57 | 1 never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||
58 | ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||||||||
60 | state->dev_ino.st_dev = sb->st_dev; | - | ||||||||||||||||||||||||||||||
61 | state->dev_ino.st_ino = sb->st_ino; | - | ||||||||||||||||||||||||||||||
62 | } executed 5269 times by 6 tests: end of block Executed by:
| 5269 | ||||||||||||||||||||||||||||||
63 | - | |||||||||||||||||||||||||||||||
64 | return executed 100755 times by 6 tests: return 0 ; Executed by:
executed 100755 times by 6 tests: return 0 ; Executed by:
| 100755 | ||||||||||||||||||||||||||||||
65 | 0 executed 100755 times by 6 tests: return 0 ; Executed by:
| 100755 | ||||||||||||||||||||||||||||||
66 | ; executed 100755 times by 6 tests: return 0 ; Executed by:
| 100755 | ||||||||||||||||||||||||||||||
67 | } | - | ||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |