Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/lib/sh/uconvert.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
7 | static int multiplier[7] = { 1, 100000, 10000, 1000, 100, 10, 1 }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
14 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
15 | uconvert(s, ip, up) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
16 | char *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
17 | long *ip, *up; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
18 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
19 | int n, mult; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
20 | long ipart, upart; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
21 | char *p; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
23 | ipart = upart = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
24 | mult = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
26 | if (s
| 0-6 | ||||||||||||||||||||||||||||||||||||||||||||||||
27 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
28 | mult = (*
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
29 | p = s + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
30 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
31 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
32 | p = s; executed 6 times by 1 test: p = s; Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
34 | for ( ; p
| 0-11 | ||||||||||||||||||||||||||||||||||||||||||||||||
35 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
36 | if (*
| 0-6 | ||||||||||||||||||||||||||||||||||||||||||||||||
37 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
38 | if (((*
| 0-6 | ||||||||||||||||||||||||||||||||||||||||||||||||
39 | do { if (ip
executed 1 time by 1 test: ip = ipart * mult;*ip = ipart * mult; Executed by:
executed 1 time by 1 test: if (up*ip = ipart * mult; Executed by:
executed 1 time by 1 test: up = upart;*up = upart; Executed by:
executed 1 time by 1 test: return*up = upart; Executed by:
executed 1 time by 1 test: (0);return (0); Executed by:
executed 1 time by 1 test: }return (0); Executed by:
never executed: while (0);end of block | 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||
40 | ipart = (ipart * 10) + (*p - '0'); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
41 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
43 | if (p == 0
| 0-5 | ||||||||||||||||||||||||||||||||||||||||||||||||
44 | do { if (ip
executed 5 times by 1 test: ip = ipart * mult;*ip = ipart * mult; Executed by:
executed 5 times by 1 test: if (up*ip = ipart * mult; Executed by:
executed 5 times by 1 test: up = upart;*up = upart; Executed by:
executed 5 times by 1 test: return*up = upart; Executed by:
executed 5 times by 1 test: (1);return (1); Executed by:
executed 5 times by 1 test: }return (1); Executed by:
never executed: while (0);end of block | 0-5 | ||||||||||||||||||||||||||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
46 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
47 | p++; never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
48 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
50 | for (n = 0; n < 6
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
51 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
52 | if (((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
53 | do { if (ip
never executed: ip = ipart * mult;*ip = ipart * mult; never executed: if (up*ip = ipart * mult;
never executed: up = upart;*up = upart; never executed: return*up = upart; never executed: (0);return (0); never executed: }return (0); never executed: while (0);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
54 | upart = (upart * 10) + (p[n] - '0'); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
55 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
57 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
58 | upart *= multiplier[n]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
60 | if (n == 6
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
61 | upart++; never executed: upart++; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
62 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
63 | do { if (ip
never executed: ip = ipart * mult;*ip = ipart * mult; never executed: if (up*ip = ipart * mult;
never executed: up = upart;*up = upart; never executed: return*up = upart; never executed: (1);return (1); never executed: } while (0);return (1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
64 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |