Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gl/lib/xdectoint.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | - | |||||||||||||
7 | - | |||||||||||||
8 | - | |||||||||||||
9 | - | |||||||||||||
10 | uintmax_t | - | ||||||||||||
11 | xnumtoumax (const char *n_str, int base, uintmax_t min, uintmax_t max, | - | ||||||||||||
12 | const char *suffixes, const char *err, int err_exit) | - | ||||||||||||
13 | { | - | ||||||||||||
14 | strtol_error s_err; | - | ||||||||||||
15 | - | |||||||||||||
16 | uintmax_t tnum; | - | ||||||||||||
17 | s_err = xstrtoumax (n_str, | - | ||||||||||||
18 | ((void *)0) | - | ||||||||||||
19 | , base, &tnum, suffixes); | - | ||||||||||||
20 | - | |||||||||||||
21 | if (s_err == LONGINT_OK
| 96-4727 | ||||||||||||
22 | { | - | ||||||||||||
23 | if (tnum < min
| 5-4718 | ||||||||||||
24 | { | - | ||||||||||||
25 | s_err = LONGINT_OVERFLOW; | - | ||||||||||||
26 | - | |||||||||||||
27 | - | |||||||||||||
28 | if (tnum > 0x7fffffff/2
| 2-12 | ||||||||||||
29 | - | |||||||||||||
30 | (* executed 2 times by 2 tests: __errno_location ()) (*__errno_location ()) = 75 ; Executed by:
executed 2 times by 2 tests: (*__errno_location ()) = 75 ; Executed by:
| 2 | ||||||||||||
31 | = executed 2 times by 2 tests: (*__errno_location ()) = 75 ; Executed by:
| 2 | ||||||||||||
32 | 75 executed 2 times by 2 tests: (*__errno_location ()) = 75 ; Executed by:
| 2 | ||||||||||||
33 | ; executed 2 times by 2 tests: (*__errno_location ()) = 75 ; Executed by:
| 2 | ||||||||||||
34 | - | |||||||||||||
35 | - | |||||||||||||
36 | - | |||||||||||||
37 | - | |||||||||||||
38 | else | - | ||||||||||||
39 | - | |||||||||||||
40 | (* executed 12 times by 3 tests: __errno_location ()) (*__errno_location ()) = 34 ; Executed by:
executed 12 times by 3 tests: (*__errno_location ()) = 34 ; Executed by:
| 12 | ||||||||||||
41 | = executed 12 times by 3 tests: (*__errno_location ()) = 34 ; Executed by:
| 12 | ||||||||||||
42 | 34 executed 12 times by 3 tests: (*__errno_location ()) = 34 ; Executed by:
| 12 | ||||||||||||
43 | ; executed 12 times by 3 tests: (*__errno_location ()) = 34 ; Executed by:
| 12 | ||||||||||||
44 | } | - | ||||||||||||
45 | } executed 4727 times by 13 tests: end of block Executed by:
| 4727 | ||||||||||||
46 | else if (s_err == LONGINT_OVERFLOW
| 10-86 | ||||||||||||
47 | - | |||||||||||||
48 | (* executed 10 times by 4 tests: __errno_location ()) (*__errno_location ()) = 75 ; Executed by:
executed 10 times by 4 tests: (*__errno_location ()) = 75 ; Executed by:
| 10 | ||||||||||||
49 | = executed 10 times by 4 tests: (*__errno_location ()) = 75 ; Executed by:
| 10 | ||||||||||||
50 | 75 executed 10 times by 4 tests: (*__errno_location ()) = 75 ; Executed by:
| 10 | ||||||||||||
51 | ; executed 10 times by 4 tests: (*__errno_location ()) = 75 ; Executed by:
| 10 | ||||||||||||
52 | else if (s_err == LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW
| 0-86 | ||||||||||||
53 | - | |||||||||||||
54 | (* never executed: __errno_location ()) (*__errno_location ()) = 0; never executed: (*__errno_location ()) = 0; | 0 | ||||||||||||
55 | = 0; never executed: (*__errno_location ()) = 0; | 0 | ||||||||||||
56 | - | |||||||||||||
57 | if (s_err != LONGINT_OK
| 110-4713 | ||||||||||||
58 | { | - | ||||||||||||
59 | - | |||||||||||||
60 | error (err_exit ? err_exit : | - | ||||||||||||
61 | 1 | - | ||||||||||||
62 | , | - | ||||||||||||
63 | (*__errno_location ()) | - | ||||||||||||
64 | == | - | ||||||||||||
65 | 22 | - | ||||||||||||
66 | ? 0 : | - | ||||||||||||
67 | (*__errno_location ()) | - | ||||||||||||
68 | , | - | ||||||||||||
69 | "%s: %s", err, quote (n_str)); | - | ||||||||||||
70 | } never executed: end of block | 0 | ||||||||||||
71 | - | |||||||||||||
72 | return executed 4713 times by 13 tests: tnum;return tnum; Executed by:
executed 4713 times by 13 tests: return tnum; Executed by:
| 4713 | ||||||||||||
73 | } | - | ||||||||||||
74 | - | |||||||||||||
75 | - | |||||||||||||
76 | - | |||||||||||||
77 | - | |||||||||||||
78 | - | |||||||||||||
79 | - | |||||||||||||
80 | uintmax_t | - | ||||||||||||
81 | xdectoumax (const char *n_str, uintmax_t min, uintmax_t max, | - | ||||||||||||
82 | const char *suffixes, const char *err, int err_exit) | - | ||||||||||||
83 | { | - | ||||||||||||
84 | return executed 4808 times by 15 tests: xnumtoumax (n_str, 10, min, max, suffixes, err, err_exit);return xnumtoumax (n_str, 10, min, max, suffixes, err, err_exit); Executed by:
executed 4808 times by 15 tests: return xnumtoumax (n_str, 10, min, max, suffixes, err, err_exit); Executed by:
| 4808 | ||||||||||||
85 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |