| 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 | intmax_t | - | ||||||||||||
| 11 | xnumtoimax (const char *n_str, int base, intmax_t min, intmax_t max, | - | ||||||||||||
| 12 | const char *suffixes, const char *err, int err_exit) | - | ||||||||||||
| 13 | { | - | ||||||||||||
| 14 | strtol_error s_err; | - | ||||||||||||
| 15 | - | |||||||||||||
| 16 | intmax_t tnum; | - | ||||||||||||
| 17 | s_err = xstrtoimax (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 | else if (tnum <
| 0-3 | ||||||||||||
| 36 | (-0x7fffffff - 1)
| 0-3 | ||||||||||||
| 37 | /2
| 0-3 | ||||||||||||
| 38 | - | |||||||||||||
| 39 | (* never executed: __errno_location ()) (*__errno_location ()) = 75 ;never executed: (*__errno_location ()) = 75 ; | 0 | ||||||||||||
| 40 | = never executed: (*__errno_location ()) = 75 ; | 0 | ||||||||||||
| 41 | 75 never executed: (*__errno_location ()) = 75 ; | 0 | ||||||||||||
| 42 | ; never executed: (*__errno_location ()) = 75 ; | 0 | ||||||||||||
| 43 | - | |||||||||||||
| 44 | else | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | (* 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 | ||||||||||||
| 47 | = executed 12 times by 3 tests: (*__errno_location ()) = 34 ;Executed by:
| 12 | ||||||||||||
| 48 | 34 executed 12 times by 3 tests: (*__errno_location ()) = 34 ;Executed by:
| 12 | ||||||||||||
| 49 | ; executed 12 times by 3 tests: (*__errno_location ()) = 34 ;Executed by:
| 12 | ||||||||||||
| 50 | } | - | ||||||||||||
| 51 | } executed 4727 times by 13 tests: end of blockExecuted by:
| 4727 | ||||||||||||
| 52 | else if (s_err == LONGINT_OVERFLOW
| 10-86 | ||||||||||||
| 53 | - | |||||||||||||
| 54 | (* 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 | ||||||||||||
| 55 | = executed 10 times by 4 tests: (*__errno_location ()) = 75 ;Executed by:
| 10 | ||||||||||||
| 56 | 75 executed 10 times by 4 tests: (*__errno_location ()) = 75 ;Executed by:
| 10 | ||||||||||||
| 57 | ; executed 10 times by 4 tests: (*__errno_location ()) = 75 ;Executed by:
| 10 | ||||||||||||
| 58 | else if (s_err == LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW
| 0-86 | ||||||||||||
| 59 | - | |||||||||||||
| 60 | (* never executed: __errno_location ()) (*__errno_location ()) = 0;never executed: (*__errno_location ()) = 0; | 0 | ||||||||||||
| 61 | = 0; never executed: (*__errno_location ()) = 0; | 0 | ||||||||||||
| 62 | - | |||||||||||||
| 63 | if (s_err != LONGINT_OK
| 110-4713 | ||||||||||||
| 64 | { | - | ||||||||||||
| 65 | - | |||||||||||||
| 66 | error (err_exit ? err_exit : | - | ||||||||||||
| 67 | 1 | - | ||||||||||||
| 68 | , | - | ||||||||||||
| 69 | (*__errno_location ()) | - | ||||||||||||
| 70 | == | - | ||||||||||||
| 71 | 22 | - | ||||||||||||
| 72 | ? 0 : | - | ||||||||||||
| 73 | (*__errno_location ()) | - | ||||||||||||
| 74 | , | - | ||||||||||||
| 75 | "%s: %s", err, quote (n_str)); | - | ||||||||||||
| 76 | } never executed: end of block | 0 | ||||||||||||
| 77 | - | |||||||||||||
| 78 | return executed 4713 times by 13 tests: tnum;return tnum;Executed by:
executed 4713 times by 13 tests: return tnum;Executed by:
| 4713 | ||||||||||||
| 79 | } | - | ||||||||||||
| 80 | - | |||||||||||||
| 81 | - | |||||||||||||
| 82 | - | |||||||||||||
| 83 | - | |||||||||||||
| 84 | - | |||||||||||||
| 85 | - | |||||||||||||
| 86 | intmax_t | - | ||||||||||||
| 87 | xdectoimax (const char *n_str, intmax_t min, intmax_t max, | - | ||||||||||||
| 88 | const char *suffixes, const char *err, int err_exit) | - | ||||||||||||
| 89 | { | - | ||||||||||||
| 90 | return executed 4808 times by 15 tests: xnumtoimax (n_str, 10, min, max, suffixes, err, err_exit);return xnumtoimax (n_str, 10, min, max, suffixes, err, err_exit);Executed by:
executed 4808 times by 15 tests: return xnumtoimax (n_str, 10, min, max, suffixes, err, err_exit);Executed by:
| 4808 | ||||||||||||
| 91 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |