Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/mbiter.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | - | |||||||||||||
7 | - | |||||||||||||
8 | - | |||||||||||||
9 | - | |||||||||||||
10 | - | |||||||||||||
11 | - | |||||||||||||
12 | - | |||||||||||||
13 | - | |||||||||||||
14 | - | |||||||||||||
15 | - | |||||||||||||
16 | struct mbiter_multi | - | ||||||||||||
17 | { | - | ||||||||||||
18 | const char *limit; | - | ||||||||||||
19 | - | |||||||||||||
20 | _Bool | - | ||||||||||||
21 | in_shift; | - | ||||||||||||
22 | mbstate_t state; | - | ||||||||||||
23 | - | |||||||||||||
24 | _Bool | - | ||||||||||||
25 | next_done; | - | ||||||||||||
26 | struct mbchar cur; | - | ||||||||||||
27 | - | |||||||||||||
28 | - | |||||||||||||
29 | - | |||||||||||||
30 | - | |||||||||||||
31 | - | |||||||||||||
32 | - | |||||||||||||
33 | }; | - | ||||||||||||
34 | - | |||||||||||||
35 | extern inline void | - | ||||||||||||
36 | mbiter_multi_next (struct mbiter_multi *iter) | - | ||||||||||||
37 | { | - | ||||||||||||
38 | if (iter->next_done
| 0 | ||||||||||||
39 | return; never executed: return; | 0 | ||||||||||||
40 | if (iter->in_shift
| 0 | ||||||||||||
41 | goto never executed: with_shift;goto with_shift; never executed: goto with_shift; | 0 | ||||||||||||
42 | - | |||||||||||||
43 | if (is_basic (*iter->cur.ptr)
| 0 | ||||||||||||
44 | { | - | ||||||||||||
45 | - | |||||||||||||
46 | - | |||||||||||||
47 | - | |||||||||||||
48 | iter->cur.bytes = 1; | - | ||||||||||||
49 | iter->cur.wc = *iter->cur.ptr; | - | ||||||||||||
50 | iter->cur.wc_valid = | - | ||||||||||||
51 | 1 | - | ||||||||||||
52 | ; | - | ||||||||||||
53 | } never executed: end of block | 0 | ||||||||||||
54 | else | - | ||||||||||||
55 | { | - | ||||||||||||
56 | - | |||||||||||||
57 | (( | - | ||||||||||||
58 | mbsinit (&iter->state) | - | ||||||||||||
59 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||
60 | "mbsinit (&iter->state)" | - | ||||||||||||
61 | , "lib/mbiter.h", 142, __PRETTY_FUNCTION__)) | - | ||||||||||||
62 | ; | - | ||||||||||||
63 | iter->in_shift = | - | ||||||||||||
64 | 1 | - | ||||||||||||
65 | ; | - | ||||||||||||
66 | with_shift: code before this statement never executed: with_shift: | 0 | ||||||||||||
67 | iter->cur.bytes = | - | ||||||||||||
68 | rpl_mbrtowc | - | ||||||||||||
69 | (&iter->cur.wc, iter->cur.ptr, | - | ||||||||||||
70 | iter->limit - iter->cur.ptr, &iter->state); | - | ||||||||||||
71 | if (iter->cur.bytes == (size_t) -1
| 0 | ||||||||||||
72 | { | - | ||||||||||||
73 | - | |||||||||||||
74 | iter->cur.bytes = 1; | - | ||||||||||||
75 | iter->cur.wc_valid = | - | ||||||||||||
76 | 0 | - | ||||||||||||
77 | ; | - | ||||||||||||
78 | - | |||||||||||||
79 | - | |||||||||||||
80 | } never executed: end of block | 0 | ||||||||||||
81 | else if (iter->cur.bytes == (size_t) -2
| 0 | ||||||||||||
82 | { | - | ||||||||||||
83 | - | |||||||||||||
84 | iter->cur.bytes = iter->limit - iter->cur.ptr; | - | ||||||||||||
85 | iter->cur.wc_valid = | - | ||||||||||||
86 | 0 | - | ||||||||||||
87 | ; | - | ||||||||||||
88 | - | |||||||||||||
89 | - | |||||||||||||
90 | } never executed: end of block | 0 | ||||||||||||
91 | else | - | ||||||||||||
92 | { | - | ||||||||||||
93 | if (iter->cur.bytes == 0
| 0 | ||||||||||||
94 | { | - | ||||||||||||
95 | - | |||||||||||||
96 | iter->cur.bytes = 1; | - | ||||||||||||
97 | - | |||||||||||||
98 | (( | - | ||||||||||||
99 | *iter->cur.ptr == '\0' | - | ||||||||||||
100 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||
101 | "*iter->cur.ptr == '\\0'" | - | ||||||||||||
102 | , "lib/mbiter.h", 169, __PRETTY_FUNCTION__)) | - | ||||||||||||
103 | ; | - | ||||||||||||
104 | - | |||||||||||||
105 | (( | - | ||||||||||||
106 | iter->cur.wc == 0 | - | ||||||||||||
107 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||
108 | "iter->cur.wc == 0" | - | ||||||||||||
109 | , "lib/mbiter.h", 170, __PRETTY_FUNCTION__)) | - | ||||||||||||
110 | ; | - | ||||||||||||
111 | } never executed: end of block | 0 | ||||||||||||
112 | iter->cur.wc_valid = | - | ||||||||||||
113 | 1 | - | ||||||||||||
114 | ; | - | ||||||||||||
115 | - | |||||||||||||
116 | - | |||||||||||||
117 | - | |||||||||||||
118 | if (mbsinit (&iter->state)
| 0 | ||||||||||||
119 | iter->in_shift = never executed: iter->in_shift = 0 ; | 0 | ||||||||||||
120 | 0 never executed: iter->in_shift = 0 ; | 0 | ||||||||||||
121 | ; never executed: iter->in_shift = 0 ; | 0 | ||||||||||||
122 | } never executed: end of block | 0 | ||||||||||||
123 | } | - | ||||||||||||
124 | iter->next_done = | - | ||||||||||||
125 | 1 | - | ||||||||||||
126 | ; | - | ||||||||||||
127 | } never executed: end of block | 0 | ||||||||||||
128 | - | |||||||||||||
129 | extern inline void | - | ||||||||||||
130 | mbiter_multi_reloc (struct mbiter_multi *iter, ptrdiff_t ptrdiff) | - | ||||||||||||
131 | { | - | ||||||||||||
132 | iter->cur.ptr += ptrdiff; | - | ||||||||||||
133 | iter->limit += ptrdiff; | - | ||||||||||||
134 | } never executed: end of block | 0 | ||||||||||||
135 | - | |||||||||||||
136 | extern inline void | - | ||||||||||||
137 | mbiter_multi_copy (struct mbiter_multi *new_iter, const struct mbiter_multi *old_iter) | - | ||||||||||||
138 | { | - | ||||||||||||
139 | new_iter->limit = old_iter->limit; | - | ||||||||||||
140 | if ((
| 0 | ||||||||||||
141 | memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); never executed: memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); | 0 | ||||||||||||
142 | else | - | ||||||||||||
143 | memset (&new_iter->state, 0, sizeof (mbstate_t)); never executed: memset (&new_iter->state, 0, sizeof (mbstate_t)); | 0 | ||||||||||||
144 | new_iter->next_done = old_iter->next_done; | - | ||||||||||||
145 | mb_copy (&new_iter->cur, &old_iter->cur); | - | ||||||||||||
146 | } never executed: end of block | 0 | ||||||||||||
147 | - | |||||||||||||
148 | - | |||||||||||||
149 | typedef struct mbiter_multi mbi_iterator_t; | - | ||||||||||||
150 | - | |||||||||||||
Switch to Source code | Preprocessed file |