NetBSD: fix "warning: array subscript has type char" warnings.
Chris Pressey
8 years ago
35 | 35 | while (!feof(stdin)) |
36 | 36 | { |
37 | 37 | fgets(in, 255, stdin); |
38 | if (isalpha(in[0])&&in[1]=='=') | |
38 | if (isalpha((int)in[0])&&in[1]=='=') | |
39 | 39 | values[in[0]-'a']=(in[2]-'0'); |
40 | 40 | else |
41 | 41 | printf("%d\n", caparse(in, values)); |
55 | 55 | |
56 | 56 | for (;((sp) && (sp != ')'));pos++) |
57 | 57 | { |
58 | if (isalpha(sp)) | |
58 | if (isalpha((int)sp)) | |
59 | 59 | { |
60 | 60 | state = doper(state, oper, negate ? !values[sp-'a'] : values[sp-'a']); |
61 | 61 | negate = 0; |
134 | 134 | |
135 | 135 | if(debug) printf("%s ", s); |
136 | 136 | |
137 | if (isdigit(s[0]) || ((s[0] == '-') && (isdigit(s[1])))) | |
137 | if (isdigit((int)s[0]) || (s[0] == '-' && isdigit((int)s[1]))) | |
138 | 138 | push(atoi(s)); |
139 | 139 | else if (s[0] == '=') |
140 | 140 | setvari(s + 1, pop()); |
141 | else if ((s[0] == '*') && (isalpha(s[1]))) | |
141 | else if ((s[0] == '*') && (isalpha((int)s[1]))) | |
142 | 142 | addvari(s + 1); |
143 | 143 | else if (s[0] == '@') |
144 | 144 | { |
184 | 184 | for (;;) |
185 | 185 | { |
186 | 186 | gg = g; |
187 | while (!isspace(gg[0])&&gg[0]) | |
187 | while (!isspace((int)gg[0])&&gg[0]) | |
188 | 188 | gg++; |
189 | 189 | if (!gg[0]) |
190 | 190 | break; |
194 | 194 | |
195 | 195 | gg[0] = ' '; |
196 | 196 | g = gg; |
197 | while (isspace(g[0])&&g[0]) | |
197 | while (isspace((int)g[0])&&g[0]) | |
198 | 198 | g++; |
199 | 199 | } |
200 | 200 |
86 | 86 | strcpy (token, ""); |
87 | 87 | token[1] = (char) 0; |
88 | 88 | |
89 | while (isspace (prog[t])) | |
89 | while (isspace ((int)prog[t])) | |
90 | 90 | t++; |
91 | 91 | if (prog[t] == '$') |
92 | 92 | strcpy (token, "$"); |
97 | 97 | } |
98 | 98 | else |
99 | 99 | { |
100 | if (isalpha (prog[t])) | |
100 | if (isalpha ((int)prog[t])) | |
101 | 101 | { |
102 | 102 | toktype = T_VARIABLE; |
103 | 103 | while (!(isdelimeter (prog[t]))) |
106 | 106 | token[strlen (token)] = prog[t++]; |
107 | 107 | } |
108 | 108 | } |
109 | else if (isdigit (prog[t])) | |
109 | else if ((int)isdigit (prog[t])) | |
110 | 110 | { |
111 | 111 | toktype = T_CONSTANT; |
112 | 112 | while (!(isdelimeter (prog[t]))) |
192 | 192 | int |
193 | 193 | findvar (char *s) |
194 | 194 | { |
195 | return vars[(int) toupper (s[0]) - (int) 'A']; | |
195 | return vars[(int) toupper ((int)s[0]) - (int) 'A']; | |
196 | 196 | } |
197 | 197 | |
198 | 198 | int |
120 | 120 | struct word *w; |
121 | 121 | struct vari *v; |
122 | 122 | |
123 | if (isdigit(s[0]) || ((s[0] == '-') && (isdigit(s[1])))) | |
123 | if (isdigit((int)s[0]) || ((s[0] == '-') && (isdigit((int)s[1])))) | |
124 | 124 | push(atof(s)); |
125 | 125 | else if (s[0] == '=') |
126 | 126 | setvari(s + 1, pop()); |
127 | else if ((s[0] == '*') && (isalpha(s[1]))) | |
127 | else if ((s[0] == '*') && ((int)isalpha(s[1]))) | |
128 | 128 | addvari(s + 1); |
129 | 129 | else if ((w = lookup(s))) |
130 | 130 | dofunc(w); |