OpenCoverage

set-fields.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/set-fields.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4struct field_range_pair *frp;-
5-
6-
7size_t n_frp;-
8-
9-
10static size_t n_frp_allocated;-
11static void-
12add_range_pair (uintmax_t lo, uintmax_t hi)-
13{-
14 if (n_frp == n_frp_allocated
n_frp == n_frp_allocatedDescription
TRUEevaluated 351 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 160 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
160-351
15 frp = ((void) (!!sizeof (struct { _Static_assert (sizeof *(frp) != 1, "verify_true (" "sizeof *(frp) != 1" ")"); int _gl_dummy; })), x2nrealloc (frp, &n_frp_allocated, sizeof *(frp)));
executed 351 times by 2 tests: frp = ((void) (!!sizeof (struct { _Static_assert (sizeof *(frp) != 1, "verify_true (" "sizeof *(frp) != 1" ")"); int _gl_dummy; })), x2nrealloc (frp, &n_frp_allocated, sizeof *(frp)));
Executed by:
  • cut
  • numfmt
351
16 frp[n_frp].lo = lo;-
17 frp[n_frp].hi = hi;-
18 ++n_frp;-
19}
executed 511 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
511
20-
21-
22-
23-
24static int-
25compare_ranges (const void *a, const void *b)-
26{-
27 int a_start = ((const struct field_range_pair *) a)->lo;-
28 int b_start = ((const struct field_range_pair *) b)->lo;-
29 return
executed 175 times by 2 tests: return a_start < b_start ? -1 : a_start > b_start;
Executed by:
  • cut
  • numfmt
a_start < b_start ? -1 : a_start > b_start;
executed 175 times by 2 tests: return a_start < b_start ? -1 : a_start > b_start;
Executed by:
  • cut
  • numfmt
175
30}-
31-
32-
33-
34-
35static void-
36complement_rp (void)-
37{-
38 struct field_range_pair *c = frp;-
39 size_t n = n_frp;-
40-
41 frp = -
42 ((void *)0)-
43 ;-
44 n_frp = 0;-
45 n_frp_allocated = 0;-
46-
47 if (c[0].lo > 1
c[0].lo > 1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • cut
FALSEnever evaluated
)
0-3
48 add_range_pair (1, c[0].lo - 1);
executed 3 times by 1 test: add_range_pair (1, c[0].lo - 1);
Executed by:
  • cut
3
49-
50 for (size_t i = 1; i < n
i < nDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • cut
; ++i)
0-3
51 {-
52 if (c[i-1].hi + 1 == c[i].lo
c[i-1].hi + 1 == c[i].loDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
53 continue;
never executed: continue;
0
54-
55 add_range_pair (c[i-1].hi + 1, c[i].lo - 1);-
56 }
never executed: end of block
0
57-
58 if (c[n-1].hi <
c[n-1].hi < (1...73709551615UL)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • cut
0-3
59 (18446744073709551615UL)
c[n-1].hi < (1...73709551615UL)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • cut
0-3
60 )-
61 add_range_pair (c[n-1].hi + 1,
never executed: add_range_pair (c[n-1].hi + 1, (18446744073709551615UL) );
0
62 (18446744073709551615UL)
never executed: add_range_pair (c[n-1].hi + 1, (18446744073709551615UL) );
0
63 );
never executed: add_range_pair (c[n-1].hi + 1, (18446744073709551615UL) );
0
64-
65 free (c);-
66}
executed 3 times by 1 test: end of block
Executed by:
  • cut
3
67void-
68set_fields (const char *fieldstr, unsigned int options)-
69{-
70 uintmax_t initial = 1;-
71 uintmax_t value = 0;-
72 -
73 _Bool -
74 lhs_specified = -
75 0-
76 ;-
77 -
78 _Bool -
79 rhs_specified = -
80 0-
81 ;-
82 -
83 _Bool -
84 dash_found = -
85 0-
86 ;-
87-
88 -
89 _Bool -
90 in_digits = -
91 0-
92 ;-
93-
94-
95-
96-
97 if ((
(options & SETFLD_ALLOW_DASH)Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 330 times by 1 test
Evaluated by:
  • cut
options & SETFLD_ALLOW_DASH)
(options & SETFLD_ALLOW_DASH)Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 330 times by 1 test
Evaluated by:
  • cut
&& (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-330
98 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
99 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
100 ) && __builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
101 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
102 ) && (__s1_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
103 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
104 ), __s2_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
105 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
106 ), (!((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
107 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
108 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
109 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
110 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
111 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
112 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
113 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
114 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
115 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
116 ,
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
117 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
118 ) : (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
119 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
120 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
121 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
122 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
123 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
124 ) == 1) && (__s1_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
125 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
126 ), __s1_len < 4) ? (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
127 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
128 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
129 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
130 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
131 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
132 ) == 1) ? __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
133 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
134 ,
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
135 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
136 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
137 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
138 ); int __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
139 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
140 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
141 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
142 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
143 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
144 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( fieldstr ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
145 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
never executed: __result = (((const unsigned char *) (const char *) ( fieldstr ))[3] - __s2[3]);
0-50
146 ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
never executed: __result = (((const unsigned char *) (const char *) ( fieldstr ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
147 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
148 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
149 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
150 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
151 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
152 ) == 1) && (__s2_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
153 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
154 ), __s2_len < 4) ? (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
155 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
156 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
157 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
158 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
159 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
160 ) == 1) ? __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
161 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
162 ,
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
163 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
164 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
165 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
166 ); int __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
167 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
168 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • numfmt
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 42 times by 1 test
Evaluated by:
  • numfmt
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-52
169 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
170 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • numfmt
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
171 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
172 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
173 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
0-50
174 ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
}
never executed: end of block
} __result; }))) : __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
0-50
175 fieldstr
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
176 ,
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
177 "-"
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
178 )))); })
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
2-50
179 == 0)
( __extension_...)))); }) == 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 50 times by 1 test
Evaluated by:
  • numfmt
)
2-50
180 {-
181 value = 1;-
182 lhs_specified = -
183 1-
184 ;-
185 dash_found = -
186 1-
187 ;-
188 fieldstr++;-
189 }
executed 2 times by 1 test: end of block
Executed by:
  • numfmt
2
190-
191 while (-
192 1-
193 )-
194 {-
195 if (*
*fieldstr == '-'Description
TRUEevaluated 303 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 1391 times by 2 tests
Evaluated by:
  • cut
  • numfmt
fieldstr == '-'
*fieldstr == '-'Description
TRUEevaluated 303 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 1391 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
303-1391
196 {-
197 in_digits = -
198 0-
199 ;-
200-
201 if (dash_found
dash_foundDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 294 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
9-294
202 do { error (0, 0, ((options & SETFLD_ERRMSG_USE_POS) ?-
203 dcgettext (((void *)0), -
204 "invalid byte or character range"-
205 , 5) -
206 :-
207 dcgettext (((void *)0), -
208 "invalid field range"-
209 , 5)-
210 )); usage (-
211 1-
212 ); }
never executed: end of block
while (0)
0
213-
214 ;-
215-
216 dash_found = -
217 1-
218 ;-
219 fieldstr++;-
220-
221 if (lhs_specified
lhs_specifiedDescription
TRUEevaluated 259 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • cut
  • numfmt
&& !value
!valueDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
5-259
222 do { error (0, 0, ((options & SETFLD_ERRMSG_USE_POS) ?-
223 dcgettext (((void *)0), -
224 "byte/character positions are numbered from 1"-
225 , 5) -
226 :-
227 dcgettext (((void *)0), -
228 "fields are numbered from 1"-
229 , 5)-
230 )); usage (-
231 1-
232 ); }
never executed: end of block
while (0)
0
233-
234 ;-
235-
236 initial = (lhs_specified
lhs_specifiedDescription
TRUEevaluated 254 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • cut
  • numfmt
? value : 1);
35-254
237 value = 0;-
238 }
executed 289 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
289
239 else if (*
*fieldstr == ','Description
TRUEevaluated 171 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 1220 times by 2 tests
Evaluated by:
  • cut
  • numfmt
fieldstr == ','
*fieldstr == ','Description
TRUEevaluated 171 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 1220 times by 2 tests
Evaluated by:
  • cut
  • numfmt
171-1220
240 || -
241 ((*
((*__ctype_b_l...int) _ISblank)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 1219 times by 2 tests
Evaluated by:
  • cut
  • numfmt
__ctype_b_loc ())[(int) ((
((*__ctype_b_l...int) _ISblank)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 1219 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-1219
242 to_uchar (*fieldstr)
((*__ctype_b_l...int) _ISblank)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 1219 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-1219
243 ))] & (unsigned short int) _ISblank)
((*__ctype_b_l...int) _ISblank)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 1219 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-1219
244 || *
*fieldstr == '\0'Description
TRUEevaluated 363 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 856 times by 2 tests
Evaluated by:
  • cut
  • numfmt
fieldstr == '\0'
*fieldstr == '\0'Description
TRUEevaluated 363 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 856 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
363-856
245 {-
246 in_digits = -
247 0-
248 ;-
249-
250 if (dash_found
dash_foundDescription
TRUEevaluated 281 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
254-281
251 {-
252 dash_found = -
253 0-
254 ;-
255-
256 if (!lhs_specified
!lhs_specifiedDescription
TRUEevaluated 26 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 255 times by 2 tests
Evaluated by:
  • cut
  • numfmt
&& !rhs_specified
!rhs_specifiedDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
10-255
257 {-
258-
259 if (options & SETFLD_ALLOW_DASH
options & SETFLD_ALLOW_DASHDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • numfmt
FALSEevaluated 15 times by 1 test
Evaluated by:
  • cut
)
1-15
260 initial = 1;
executed 1 time by 1 test: initial = 1;
Executed by:
  • numfmt
1
261 else-
262 do { error (0, 0, (-
263 dcgettext (((void *)0), -
264 "invalid range with no endpoint: -"-
265 , 5)-
266 )); usage (-
267 1-
268 ); }
never executed: end of block
while (0);
0
269 }-
270-
271-
272-
273 if (!rhs_specified
!rhs_specifiedDescription
TRUEevaluated 126 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 140 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
126-140
274 {-
275-
276 add_range_pair (initial, -
277 (18446744073709551615UL)-
278 );-
279 }
executed 126 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
126
280 else-
281 {-
282-
283 if (value < initial
value < initialDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
4-136
284 do { error (0, 0, (-
285 dcgettext (((void *)0), -
286 "invalid decreasing range"-
287 , 5)-
288 )); usage (-
289 1-
290 ); }
never executed: end of block
while (0);
0
291-
292 add_range_pair (initial, value);-
293 }
executed 136 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
136
294 value = 0;-
295 }
executed 262 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
262
296 else-
297 {-
298-
299 if (value == 0
value == 0Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 246 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
8-246
300 do { error (0, 0, ((options & SETFLD_ERRMSG_USE_POS) ?-
301 dcgettext (((void *)0), -
302 "byte/character positions are numbered from 1"-
303 , 5) -
304 :-
305 dcgettext (((void *)0), -
306 "fields are numbered from 1"-
307 , 5)-
308 )); usage (-
309 1-
310 ); }
never executed: end of block
while (0)
0
311-
312 ;-
313-
314 add_range_pair (value, value);-
315 value = 0;-
316 }
executed 246 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
246
317-
318 if (*
*fieldstr == '\0'Description
TRUEevaluated 336 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 172 times by 2 tests
Evaluated by:
  • cut
  • numfmt
fieldstr == '\0'
*fieldstr == '\0'Description
TRUEevaluated 336 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 172 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
172-336
319 break;
executed 336 times by 2 tests: break;
Executed by:
  • cut
  • numfmt
336
320-
321 fieldstr++;-
322 lhs_specified = -
323 0-
324 ;-
325 rhs_specified = -
326 0-
327 ;-
328 }
executed 172 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
172
329 else if (((
((unsigned int...r) - '0' <= 9)Description
TRUEevaluated 854 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
unsigned int) (*fieldstr) - '0' <= 9)
((unsigned int...r) - '0' <= 9)Description
TRUEevaluated 854 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • numfmt
)
2-854
330 {-
331-
332-
333 static char const *num_start;-
334 if (!in_digits
!in_digitsDescription
TRUEevaluated 651 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 203 times by 2 tests
Evaluated by:
  • cut
  • numfmt
|| !num_start
!num_startDescription
TRUEnever evaluated
FALSEevaluated 203 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
0-651
335 num_start = fieldstr;
executed 651 times by 2 tests: num_start = fieldstr;
Executed by:
  • cut
  • numfmt
651
336 in_digits = -
337 1-
338 ;-
339-
340 if (dash_found
dash_foundDescription
TRUEevaluated 160 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 694 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
160-694
341 rhs_specified = 1;
executed 160 times by 2 tests: rhs_specified = 1;
Executed by:
  • cut
  • numfmt
160
342 else-
343 lhs_specified = 1;
executed 694 times by 2 tests: lhs_specified = 1;
Executed by:
  • cut
  • numfmt
694
344-
345-
346 if (!( (void) (&(value) == (uintmax_t *)
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-853
347 ((void *)0)
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-853
348 ), (void) (!!sizeof (struct { _Static_assert (! (! ((uintmax_t) 0 < (uintmax_t) -1)), "verify_true (" "! TYPE_SIGNED (uintmax_t)" ")"); int _gl_dummy; })), (void) (!!sizeof (struct { _Static_assert (sizeof (value) == sizeof (uintmax_t), "verify_true (" "sizeof (value) == sizeof (uintmax_t)" ")"); int _gl_dummy; })), (((
(uintmax_t) -1 / 10 < (value)Description
TRUEnever evaluated
FALSEevaluated 854 times by 2 tests
Evaluated by:
  • cut
  • numfmt
uintmax_t) -1 / 10 < (value)
(uintmax_t) -1 / 10 < (value)Description
TRUEnever evaluated
FALSEevaluated 854 times by 2 tests
Evaluated by:
  • cut
  • numfmt
|| (
(uintmax_t) ((...0')) < (value)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
uintmax_t) ((value) * 10 + (*fieldstr - '0')) < (value)
(uintmax_t) ((...0')) < (value)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
) ?
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
0-854
349 0
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-853
350 : (((value) = (value) * 10 + (*fieldstr - '0')),
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-853
351 1
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-853
352 )) )
!( (void) (&(v... '0')), 1 )) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • cut
FALSEevaluated 853 times by 2 tests
Evaluated by:
  • cut
  • numfmt
1-853
353 || value ==
value == (1844...73709551615UL)Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 851 times by 2 tests
Evaluated by:
  • cut
  • numfmt
2-851
354 (18446744073709551615UL)
value == (1844...73709551615UL)Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 851 times by 2 tests
Evaluated by:
  • cut
  • numfmt
2-851
355 )-
356 {-
357-
358-
359-
360 size_t len = -
361 __builtin_strspn (-
362 num_start-
363 , -
364 "0123456789"-
365 )-
366 ;-
367 char *bad_num = xstrndup (num_start, len);-
368 error (0, 0, (options & SETFLD_ERRMSG_USE_POS)-
369 ?-
370 dcgettext (((void *)0), -
371 "byte/character offset %s is too large"-
372 , 5)-
373 -
374 :-
375 dcgettext (((void *)0), -
376 "field number %s is too large"-
377 , 5)-
378 ,-
379 quote (bad_num));-
380 free (bad_num);-
381 usage (-
382 1-
383 );-
384 }
never executed: end of block
0
385-
386 fieldstr++;-
387 }
executed 851 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
851
388 else-
389 {-
390 error (0, 0, (options & SETFLD_ERRMSG_USE_POS)-
391 ?-
392 dcgettext (((void *)0), -
393 "invalid byte/character position %s"-
394 , 5)-
395 -
396 :-
397 dcgettext (((void *)0), -
398 "invalid field value %s"-
399 , 5)-
400 ,-
401 quote (fieldstr));-
402 usage (-
403 1-
404 );-
405 }
never executed: end of block
0
406 }-
407-
408 if (!n_frp
!n_frpDescription
TRUEnever evaluated
FALSEevaluated 336 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
0-336
409 do { error (0, 0, ((options&SETFLD_ERRMSG_USE_POS) ?-
410 dcgettext (((void *)0), -
411 "missing list of byte/character positions"-
412 , 5) -
413 :-
414 dcgettext (((void *)0), -
415 "missing list of fields"-
416 , 5)-
417 )); usage (-
418 1-
419 ); }
never executed: end of block
while (0)
0
420-
421 ;-
422-
423 qsort (frp, n_frp, sizeof (frp[0]), compare_ranges);-
424-
425-
426 for (size_t i = 0; i < n_frp
i < n_frpDescription
TRUEevaluated 423 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 336 times by 2 tests
Evaluated by:
  • cut
  • numfmt
; ++i)
336-423
427 {-
428 for (size_t j = i + 1; j < n_frp
j < n_frpDescription
TRUEevaluated 160 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 336 times by 2 tests
Evaluated by:
  • cut
  • numfmt
; ++j)
160-336
429 {-
430 if (frp[j].lo <= frp[i].hi
frp[j].lo <= frp[i].hiDescription
TRUEevaluated 73 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 87 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
73-87
431 {-
432 frp[i].hi = -
433 (((
(( frp[j].hi )>( frp[i].hi ))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • cut
  • numfmt
25-48
434 frp[j].hi
(( frp[j].hi )>( frp[i].hi ))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • cut
  • numfmt
25-48
435 )>(
(( frp[j].hi )>( frp[i].hi ))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • cut
  • numfmt
25-48
436 frp[i].hi
(( frp[j].hi )>( frp[i].hi ))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • cut
  • numfmt
25-48
437 ))
(( frp[j].hi )>( frp[i].hi ))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • cut
  • numfmt
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • cut
  • numfmt
?(
25-48
438 frp[j].hi-
439 ):(-
440 frp[i].hi-
441 ))-
442 ;-
443 memmove (frp + j, frp + j + 1, (n_frp - j - 1) * sizeof *frp);-
444 n_frp--;-
445 j--;-
446 }
executed 73 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
73
447 else-
448 break;
executed 87 times by 2 tests: break;
Executed by:
  • cut
  • numfmt
87
449 }-
450 }
executed 423 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
423
451-
452 if (options & SETFLD_COMPLEMENT
options & SETFLD_COMPLEMENTDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • cut
FALSEevaluated 333 times by 2 tests
Evaluated by:
  • cut
  • numfmt
)
3-333
453 complement_rp ();
executed 3 times by 1 test: complement_rp ();
Executed by:
  • cut
3
454-
455-
456-
457-
458 ++n_frp;-
459 frp = xrealloc (frp, n_frp * sizeof (struct field_range_pair));-
460 frp[n_frp - 1].lo = frp[n_frp - 1].hi = -
461 (18446744073709551615UL)-
462 ;-
463}
executed 336 times by 2 tests: end of block
Executed by:
  • cut
  • numfmt
336
464-
465void-
466reset_fields (void)-
467{-
468 n_frp = 0 ;-
469 n_frp_allocated = 0;-
470 free (frp);-
471 frp = -
472 ((void *)0)-
473 ;-
474}
never executed: end of block
0
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2