Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gl/lib/strnumcmp-in.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | static inline int __attribute__ ((__pure__)) | - | ||||||||||||||||||||||||
4 | fraccompare (char const *a, char const *b, char decimal_point) | - | ||||||||||||||||||||||||
5 | { | - | ||||||||||||||||||||||||
6 | if (*
| 10-354219 | ||||||||||||||||||||||||
7 | { | - | ||||||||||||||||||||||||
8 | while (*++
| 315868-354201 | ||||||||||||||||||||||||
9 | if (! ((unsigned int) (*a) - '0' <= 9)
| 0-315868 | ||||||||||||||||||||||||
10 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
11 | if (((
| 14-354176 | ||||||||||||||||||||||||
12 | return executed 354162 times by 1 test: *a - *b;return *a - *b; Executed by:
executed 354162 times by 1 test: return *a - *b; Executed by:
| 354162 | ||||||||||||||||||||||||
13 | if (((
| 14-25 | ||||||||||||||||||||||||
14 | goto executed 14 times by 1 test: a_trailing_nonzero;goto a_trailing_nonzero; Executed by:
executed 14 times by 1 test: goto a_trailing_nonzero; Executed by:
| 14 | ||||||||||||||||||||||||
15 | if (((
| 12-13 | ||||||||||||||||||||||||
16 | goto executed 13 times by 1 test: b_trailing_nonzero;goto b_trailing_nonzero; Executed by:
executed 13 times by 1 test: goto b_trailing_nonzero; Executed by:
| 13 | ||||||||||||||||||||||||
17 | return executed 12 times by 1 test: 0;return 0; Executed by:
executed 12 times by 1 test: return 0; Executed by:
| 12 | ||||||||||||||||||||||||
18 | } | - | ||||||||||||||||||||||||
19 | else if (*
| 10-18 | ||||||||||||||||||||||||
20 | { | - | ||||||||||||||||||||||||
21 | a_trailing_nonzero: | - | ||||||||||||||||||||||||
22 | while (*
| 18-32 | ||||||||||||||||||||||||
23 | a++; executed 18 times by 1 test: a++; Executed by:
| 18 | ||||||||||||||||||||||||
24 | return executed 32 times by 1 test: ((unsigned int) (*a) - '0' <= 9);return ((unsigned int) (*a) - '0' <= 9); Executed by:
executed 32 times by 1 test: return ((unsigned int) (*a) - '0' <= 9); Executed by:
| 32 | ||||||||||||||||||||||||
25 | } | - | ||||||||||||||||||||||||
26 | else if (*
| 0-10 | ||||||||||||||||||||||||
27 | { | - | ||||||||||||||||||||||||
28 | b_trailing_nonzero: | - | ||||||||||||||||||||||||
29 | while (*
| 14-23 | ||||||||||||||||||||||||
30 | b++; executed 14 times by 1 test: b++; Executed by:
| 14 | ||||||||||||||||||||||||
31 | return executed 23 times by 1 test: - ((unsigned int) (*b) - '0' <= 9);return - ((unsigned int) (*b) - '0' <= 9); Executed by:
executed 23 times by 1 test: return - ((unsigned int) (*b) - '0' <= 9); Executed by:
| 23 | ||||||||||||||||||||||||
32 | } | - | ||||||||||||||||||||||||
33 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
34 | } | - | ||||||||||||||||||||||||
35 | static inline int __attribute__ ((__pure__)) | - | ||||||||||||||||||||||||
36 | numcompare (char const *a, char const *b, | - | ||||||||||||||||||||||||
37 | int decimal_point, int thousands_sep) | - | ||||||||||||||||||||||||
38 | { | - | ||||||||||||||||||||||||
39 | unsigned char tmpa = *a; | - | ||||||||||||||||||||||||
40 | unsigned char tmpb = *b; | - | ||||||||||||||||||||||||
41 | int tmp; | - | ||||||||||||||||||||||||
42 | size_t log_a; | - | ||||||||||||||||||||||||
43 | size_t log_b; | - | ||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||
45 | if (tmpa == '-'
| 259010-297842 | ||||||||||||||||||||||||
46 | { | - | ||||||||||||||||||||||||
47 | do | - | ||||||||||||||||||||||||
48 | tmpa = *++a; executed 285926 times by 3 tests: tmpa = *++a; Executed by:
| 285926 | ||||||||||||||||||||||||
49 | while (tmpa == '0'
| 0-259010 | ||||||||||||||||||||||||
50 | if (tmpb != '-'
| 16413-242597 | ||||||||||||||||||||||||
51 | { | - | ||||||||||||||||||||||||
52 | if (tmpa == decimal_point
| 4477-11936 | ||||||||||||||||||||||||
53 | do | - | ||||||||||||||||||||||||
54 | tmpa = *++a; executed 5366 times by 1 test: tmpa = *++a; Executed by:
| 5366 | ||||||||||||||||||||||||
55 | while (tmpa == '0'
| 889-4477 | ||||||||||||||||||||||||
56 | if (((
| 4-16409 | ||||||||||||||||||||||||
57 | return executed 16409 times by 3 tests: -1;return -1; Executed by:
executed 16409 times by 3 tests: return -1; Executed by:
| 16409 | ||||||||||||||||||||||||
58 | while (tmpb == '0'
| 0-4 | ||||||||||||||||||||||||
59 | tmpb = *++b; never executed: tmpb = *++b; | 0 | ||||||||||||||||||||||||
60 | if (tmpb == decimal_point
| 0-4 | ||||||||||||||||||||||||
61 | do | - | ||||||||||||||||||||||||
62 | tmpb = *++b; never executed: tmpb = *++b; | 0 | ||||||||||||||||||||||||
63 | while (tmpb == '0'
| 0 | ||||||||||||||||||||||||
64 | return executed 4 times by 1 test: - ((unsigned int) (tmpb) - '0' <= 9);return - ((unsigned int) (tmpb) - '0' <= 9); Executed by:
executed 4 times by 1 test: return - ((unsigned int) (tmpb) - '0' <= 9); Executed by:
| 4 | ||||||||||||||||||||||||
65 | } | - | ||||||||||||||||||||||||
66 | do | - | ||||||||||||||||||||||||
67 | tmpb = *++b; executed 264666 times by 2 tests: tmpb = *++b; Executed by:
| 264666 | ||||||||||||||||||||||||
68 | while (tmpb == '0'
| 0-242597 | ||||||||||||||||||||||||
69 | - | |||||||||||||||||||||||||
70 | while (tmpa == tmpb
| 65541-336920 | ||||||||||||||||||||||||
71 | { | - | ||||||||||||||||||||||||
72 | do | - | ||||||||||||||||||||||||
73 | tmpa = *++a; executed 159864 times by 1 test: tmpa = *++a; Executed by:
| 159864 | ||||||||||||||||||||||||
74 | while (tmpa == thousands_sep
| 0-159864 | ||||||||||||||||||||||||
75 | do | - | ||||||||||||||||||||||||
76 | tmpb = *++b; executed 159864 times by 1 test: tmpb = *++b; Executed by:
| 159864 | ||||||||||||||||||||||||
77 | while (tmpb == thousands_sep
| 0-159864 | ||||||||||||||||||||||||
78 | } executed 159864 times by 1 test: end of block Executed by:
| 159864 | ||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||
80 | if ((tmpa == decimal_point
| 4813-181871 | ||||||||||||||||||||||||
81 | || (tmpb == decimal_point
| 6-61087 | ||||||||||||||||||||||||
82 | return executed 177064 times by 1 test: fraccompare (b, a, decimal_point);return fraccompare (b, a, decimal_point); Executed by:
executed 177064 times by 1 test: return fraccompare (b, a, decimal_point); Executed by:
| 177064 | ||||||||||||||||||||||||
83 | - | |||||||||||||||||||||||||
84 | tmp = tmpb - tmpa; | - | ||||||||||||||||||||||||
85 | - | |||||||||||||||||||||||||
86 | for (log_a = 0; ((
| 63542-65533 | ||||||||||||||||||||||||
87 | do | - | ||||||||||||||||||||||||
88 | tmpa = *++a; executed 63542 times by 2 tests: tmpa = *++a; Executed by:
| 63542 | ||||||||||||||||||||||||
89 | while (tmpa == thousands_sep
| 0-63542 | ||||||||||||||||||||||||
90 | - | |||||||||||||||||||||||||
91 | for (log_b = 0; ((
| 64296-65533 | ||||||||||||||||||||||||
92 | do | - | ||||||||||||||||||||||||
93 | tmpb = *++b; executed 64296 times by 2 tests: tmpb = *++b; Executed by:
| 64296 | ||||||||||||||||||||||||
94 | while (tmpb == thousands_sep
| 0-64296 | ||||||||||||||||||||||||
95 | - | |||||||||||||||||||||||||
96 | if (log_a != log_b
| 9515-56018 | ||||||||||||||||||||||||
97 | return executed 9515 times by 1 test: log_a < log_b ? 1 : -1;return log_a < log_b ? 1 : -1; Executed by:
executed 9515 times by 1 test: return log_a < log_b ? 1 : -1; Executed by:
| 9515 | ||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||
99 | if (!log_a
| 2-56016 | ||||||||||||||||||||||||
100 | return executed 2 times by 1 test: 0;return 0; Executed by:
executed 2 times by 1 test: return 0; Executed by:
| 2 | ||||||||||||||||||||||||
101 | - | |||||||||||||||||||||||||
102 | return executed 56016 times by 2 tests: tmp;return tmp; Executed by:
executed 56016 times by 2 tests: return tmp; Executed by:
| 56016 | ||||||||||||||||||||||||
103 | } | - | ||||||||||||||||||||||||
104 | else if (tmpb == '-'
| 21127-276715 | ||||||||||||||||||||||||
105 | { | - | ||||||||||||||||||||||||
106 | do | - | ||||||||||||||||||||||||
107 | tmpb = *++b; executed 26080 times by 2 tests: tmpb = *++b; Executed by:
| 26080 | ||||||||||||||||||||||||
108 | while (tmpb == '0'
| 0-21127 | ||||||||||||||||||||||||
109 | if (tmpb == decimal_point
| 4952-16175 | ||||||||||||||||||||||||
110 | do | - | ||||||||||||||||||||||||
111 | tmpb = *++b; executed 5840 times by 1 test: tmpb = *++b; Executed by:
| 5840 | ||||||||||||||||||||||||
112 | while (tmpb == '0'
| 888-4952 | ||||||||||||||||||||||||
113 | if (((
| 5-21122 | ||||||||||||||||||||||||
114 | return executed 21122 times by 2 tests: 1;return 1; Executed by:
executed 21122 times by 2 tests: return 1; Executed by:
| 21122 | ||||||||||||||||||||||||
115 | while (tmpa == '0'
| 0-5 | ||||||||||||||||||||||||
116 | tmpa = *++a; never executed: tmpa = *++a; | 0 | ||||||||||||||||||||||||
117 | if (tmpa == decimal_point
| 0-5 | ||||||||||||||||||||||||
118 | do | - | ||||||||||||||||||||||||
119 | tmpa = *++a; never executed: tmpa = *++a; | 0 | ||||||||||||||||||||||||
120 | while (tmpa == '0'
| 0 | ||||||||||||||||||||||||
121 | return executed 5 times by 1 test: ((unsigned int) (tmpa) - '0' <= 9);return ((unsigned int) (tmpa) - '0' <= 9); Executed by:
executed 5 times by 1 test: return ((unsigned int) (tmpa) - '0' <= 9); Executed by:
| 5 | ||||||||||||||||||||||||
122 | } | - | ||||||||||||||||||||||||
123 | else | - | ||||||||||||||||||||||||
124 | { | - | ||||||||||||||||||||||||
125 | while (tmpa == '0'
| 0-276715 | ||||||||||||||||||||||||
126 | tmpa = *++a; executed 22692 times by 2 tests: tmpa = *++a; Executed by:
| 22692 | ||||||||||||||||||||||||
127 | while (tmpb == '0'
| 0-276715 | ||||||||||||||||||||||||
128 | tmpb = *++b; executed 23382 times by 2 tests: tmpb = *++b; Executed by:
| 23382 | ||||||||||||||||||||||||
129 | - | |||||||||||||||||||||||||
130 | while (tmpa == tmpb
| 85382-406877 | ||||||||||||||||||||||||
131 | { | - | ||||||||||||||||||||||||
132 | do | - | ||||||||||||||||||||||||
133 | tmpa = *++a; executed 215544 times by 3 tests: tmpa = *++a; Executed by:
| 215544 | ||||||||||||||||||||||||
134 | while (tmpa == thousands_sep
| 0-215544 | ||||||||||||||||||||||||
135 | do | - | ||||||||||||||||||||||||
136 | tmpb = *++b; executed 215544 times by 3 tests: tmpb = *++b; Executed by:
| 215544 | ||||||||||||||||||||||||
137 | while (tmpb == thousands_sep
| 0-215544 | ||||||||||||||||||||||||
138 | } executed 215544 times by 3 tests: end of block Executed by:
| 215544 | ||||||||||||||||||||||||
139 | - | |||||||||||||||||||||||||
140 | if ((tmpa == decimal_point
| 4475-181632 | ||||||||||||||||||||||||
141 | || (tmpb == decimal_point
| 8-94813 | ||||||||||||||||||||||||
142 | return executed 177165 times by 1 test: fraccompare (a, b, decimal_point);return fraccompare (a, b, decimal_point); Executed by:
executed 177165 times by 1 test: return fraccompare (a, b, decimal_point); Executed by:
| 177165 | ||||||||||||||||||||||||
143 | - | |||||||||||||||||||||||||
144 | tmp = tmpa - tmpb; | - | ||||||||||||||||||||||||
145 | - | |||||||||||||||||||||||||
146 | for (log_a = 0; ((
| 88283-99550 | ||||||||||||||||||||||||
147 | do | - | ||||||||||||||||||||||||
148 | tmpa = *++a; executed 88283 times by 3 tests: tmpa = *++a; Executed by:
| 88283 | ||||||||||||||||||||||||
149 | while (tmpa == thousands_sep
| 0-88283 | ||||||||||||||||||||||||
150 | - | |||||||||||||||||||||||||
151 | for (log_b = 0; ((
| 88223-99550 | ||||||||||||||||||||||||
152 | do | - | ||||||||||||||||||||||||
153 | tmpb = *++b; executed 88223 times by 3 tests: tmpb = *++b; Executed by:
| 88223 | ||||||||||||||||||||||||
154 | while (tmpb == thousands_sep
| 0-88223 | ||||||||||||||||||||||||
155 | - | |||||||||||||||||||||||||
156 | if (log_a != log_b
| 11162-88388 | ||||||||||||||||||||||||
157 | return executed 11162 times by 3 tests: log_a < log_b ? -1 : 1;return log_a < log_b ? -1 : 1; Executed by:
executed 11162 times by 3 tests: return log_a < log_b ? -1 : 1; Executed by:
| 11162 | ||||||||||||||||||||||||
158 | - | |||||||||||||||||||||||||
159 | if (!log_a
| 14188-74200 | ||||||||||||||||||||||||
160 | return executed 14188 times by 2 tests: 0;return 0; Executed by:
executed 14188 times by 2 tests: return 0; Executed by:
| 14188 | ||||||||||||||||||||||||
161 | - | |||||||||||||||||||||||||
162 | return executed 74200 times by 3 tests: tmp;return tmp; Executed by:
executed 74200 times by 3 tests: return tmp; Executed by:
| 74200 | ||||||||||||||||||||||||
163 | } | - | ||||||||||||||||||||||||
164 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |