Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/mbuiter.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 | - | |||||||||||||
17 | struct mbuiter_multi | - | ||||||||||||
18 | { | - | ||||||||||||
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 | inline void | - | ||||||||||||
36 | mbuiter_multi_next (struct mbuiter_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/mbuiter.h", 150, __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 | strnlen1 (iter->cur.ptr, | - | ||||||||||||
71 | (__ctype_get_mb_cur_max ()) | - | ||||||||||||
72 | ), | - | ||||||||||||
73 | &iter->state); | - | ||||||||||||
74 | if (iter->cur.bytes == (size_t) -1
| 0 | ||||||||||||
75 | { | - | ||||||||||||
76 | - | |||||||||||||
77 | iter->cur.bytes = 1; | - | ||||||||||||
78 | iter->cur.wc_valid = | - | ||||||||||||
79 | 0 | - | ||||||||||||
80 | ; | - | ||||||||||||
81 | - | |||||||||||||
82 | - | |||||||||||||
83 | } never executed: end of block | 0 | ||||||||||||
84 | else if (iter->cur.bytes == (size_t) -2
| 0 | ||||||||||||
85 | { | - | ||||||||||||
86 | - | |||||||||||||
87 | iter->cur.bytes = strlen (iter->cur.ptr); | - | ||||||||||||
88 | iter->cur.wc_valid = | - | ||||||||||||
89 | 0 | - | ||||||||||||
90 | ; | - | ||||||||||||
91 | - | |||||||||||||
92 | - | |||||||||||||
93 | } never executed: end of block | 0 | ||||||||||||
94 | else | - | ||||||||||||
95 | { | - | ||||||||||||
96 | if (iter->cur.bytes == 0
| 0 | ||||||||||||
97 | { | - | ||||||||||||
98 | - | |||||||||||||
99 | iter->cur.bytes = 1; | - | ||||||||||||
100 | - | |||||||||||||
101 | (( | - | ||||||||||||
102 | *iter->cur.ptr == '\0' | - | ||||||||||||
103 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||
104 | "*iter->cur.ptr == '\\0'" | - | ||||||||||||
105 | , "lib/mbuiter.h", 178, __PRETTY_FUNCTION__)) | - | ||||||||||||
106 | ; | - | ||||||||||||
107 | - | |||||||||||||
108 | (( | - | ||||||||||||
109 | iter->cur.wc == 0 | - | ||||||||||||
110 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||
111 | "iter->cur.wc == 0" | - | ||||||||||||
112 | , "lib/mbuiter.h", 179, __PRETTY_FUNCTION__)) | - | ||||||||||||
113 | ; | - | ||||||||||||
114 | } never executed: end of block | 0 | ||||||||||||
115 | iter->cur.wc_valid = | - | ||||||||||||
116 | 1 | - | ||||||||||||
117 | ; | - | ||||||||||||
118 | - | |||||||||||||
119 | - | |||||||||||||
120 | - | |||||||||||||
121 | if (mbsinit (&iter->state)
| 0 | ||||||||||||
122 | iter->in_shift = never executed: iter->in_shift = 0 ; | 0 | ||||||||||||
123 | 0 never executed: iter->in_shift = 0 ; | 0 | ||||||||||||
124 | ; never executed: iter->in_shift = 0 ; | 0 | ||||||||||||
125 | } never executed: end of block | 0 | ||||||||||||
126 | } | - | ||||||||||||
127 | iter->next_done = | - | ||||||||||||
128 | 1 | - | ||||||||||||
129 | ; | - | ||||||||||||
130 | } never executed: end of block | 0 | ||||||||||||
131 | - | |||||||||||||
132 | inline void | - | ||||||||||||
133 | mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff) | - | ||||||||||||
134 | { | - | ||||||||||||
135 | iter->cur.ptr += ptrdiff; | - | ||||||||||||
136 | } never executed: end of block | 0 | ||||||||||||
137 | - | |||||||||||||
138 | inline void | - | ||||||||||||
139 | mbuiter_multi_copy (struct mbuiter_multi *new_iter, const struct mbuiter_multi *old_iter) | - | ||||||||||||
140 | { | - | ||||||||||||
141 | if ((
| 0 | ||||||||||||
142 | memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); never executed: memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); | 0 | ||||||||||||
143 | else | - | ||||||||||||
144 | memset (&new_iter->state, 0, sizeof (mbstate_t)); never executed: memset (&new_iter->state, 0, sizeof (mbstate_t)); | 0 | ||||||||||||
145 | new_iter->next_done = old_iter->next_done; | - | ||||||||||||
146 | mb_copy (&new_iter->cur, &old_iter->cur); | - | ||||||||||||
147 | } never executed: end of block | 0 | ||||||||||||
148 | - | |||||||||||||
149 | - | |||||||||||||
150 | typedef struct mbuiter_multi mbui_iterator_t; | - | ||||||||||||
151 | - | |||||||||||||
Switch to Source code | Preprocessed file |