git @ Cat's Eye Technologies Maentwrog / aa7df77
NetBSD: fix "warning: array subscript has type char" warnings. Chris Pressey 8 years ago
4 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
3535 while (!feof(stdin))
3636 {
3737 fgets(in, 255, stdin);
38 if (isalpha(in[0])&&in[1]=='=')
38 if (isalpha((int)in[0])&&in[1]=='=')
3939 values[in[0]-'a']=(in[2]-'0');
4040 else
4141 printf("%d\n", caparse(in, values));
5555
5656 for (;((sp) && (sp != ')'));pos++)
5757 {
58 if (isalpha(sp))
58 if (isalpha((int)sp))
5959 {
6060 state = doper(state, oper, negate ? !values[sp-'a'] : values[sp-'a']);
6161 negate = 0;
134134
135135 if(debug) printf("%s ", s);
136136
137 if (isdigit(s[0]) || ((s[0] == '-') && (isdigit(s[1]))))
137 if (isdigit((int)s[0]) || (s[0] == '-' && isdigit((int)s[1])))
138138 push(atoi(s));
139139 else if (s[0] == '=')
140140 setvari(s + 1, pop());
141 else if ((s[0] == '*') && (isalpha(s[1])))
141 else if ((s[0] == '*') && (isalpha((int)s[1])))
142142 addvari(s + 1);
143143 else if (s[0] == '@')
144144 {
184184 for (;;)
185185 {
186186 gg = g;
187 while (!isspace(gg[0])&&gg[0])
187 while (!isspace((int)gg[0])&&gg[0])
188188 gg++;
189189 if (!gg[0])
190190 break;
194194
195195 gg[0] = ' ';
196196 g = gg;
197 while (isspace(g[0])&&g[0])
197 while (isspace((int)g[0])&&g[0])
198198 g++;
199199 }
200200
8686 strcpy (token, "");
8787 token[1] = (char) 0;
8888
89 while (isspace (prog[t]))
89 while (isspace ((int)prog[t]))
9090 t++;
9191 if (prog[t] == '$')
9292 strcpy (token, "$");
9797 }
9898 else
9999 {
100 if (isalpha (prog[t]))
100 if (isalpha ((int)prog[t]))
101101 {
102102 toktype = T_VARIABLE;
103103 while (!(isdelimeter (prog[t])))
106106 token[strlen (token)] = prog[t++];
107107 }
108108 }
109 else if (isdigit (prog[t]))
109 else if ((int)isdigit (prog[t]))
110110 {
111111 toktype = T_CONSTANT;
112112 while (!(isdelimeter (prog[t])))
192192 int
193193 findvar (char *s)
194194 {
195 return vars[(int) toupper (s[0]) - (int) 'A'];
195 return vars[(int) toupper ((int)s[0]) - (int) 'A'];
196196 }
197197
198198 int
120120 struct word *w;
121121 struct vari *v;
122122
123 if (isdigit(s[0]) || ((s[0] == '-') && (isdigit(s[1]))))
123 if (isdigit((int)s[0]) || ((s[0] == '-') && (isdigit((int)s[1]))))
124124 push(atof(s));
125125 else if (s[0] == '=')
126126 setvari(s + 1, pop());
127 else if ((s[0] == '*') && (isalpha(s[1])))
127 else if ((s[0] == '*') && ((int)isalpha(s[1])))
128128 addvari(s + 1);
129129 else if ((w = lookup(s)))
130130 dofunc(w);