Improve Makefile. Clean up warnings in rdp.c.
Chris Pressey
8 years ago
0 | CC?=gcc | |
1 | CFLAGS=-ansi -pedantic -O | |
0 | # GNU Makefile for maentwrog. | |
2 | 1 | |
3 | 2 | PROGS=bin/maentw bin/caparse bin/rpn bin/rdp |
3 | CC?=gcc | |
4 | ||
5 | WARNS= -W -Wall -Wstrict-prototypes -Wmissing-prototypes \ | |
6 | -Wpointer-arith -Wno-uninitialized -Wreturn-type -Wcast-qual \ | |
7 | -Wwrite-strings -Wswitch -Wcast-align -Wchar-subscripts \ | |
8 | -Winline -Wnested-externs -Wredundant-decls | |
9 | ||
10 | ifdef ANSI | |
11 | CFLAGS+= -ansi -pedantic | |
12 | else | |
13 | CFLAGS+= -std=c99 -D_POSIX_C_SOURCE=200112L | |
14 | endif | |
15 | ||
16 | CFLAGS+= ${WARNS} ${EXTRA_CFLAGS} | |
17 | ||
18 | ifdef DEBUG | |
19 | CFLAGS+= -g | |
20 | endif | |
4 | 21 | |
5 | 22 | all: $(PROGS) |
6 | 23 |
40 | 40 | int level5 (int result); |
41 | 41 | int level6 (int result); |
42 | 42 | int primitive (int result); |
43 | ||
44 | int isdelimeter (char); | |
45 | void gettoken (void); | |
46 | void putback (void); | |
47 | void serror (int); | |
48 | int arith (char, int, int); | |
49 | int findvar (char *); | |
50 | int getexp (int); | |
43 | 51 | |
44 | 52 | /*-------------------------------------------------------------------------*/ |
45 | 53 | |
75 | 83 | void |
76 | 84 | gettoken () |
77 | 85 | { |
78 | char temp[T_LENGTH]; | |
79 | ||
80 | 86 | strcpy (token, ""); |
81 | 87 | token[1] = (char) 0; |
82 | 88 | |
180 | 186 | case '^': |
181 | 187 | return (argument ^ operand); /* binary XOR */ |
182 | 188 | } |
189 | exit(1); | |
183 | 190 | } |
184 | 191 | |
185 | 192 | int |
263 | 270 | level5 (int result) |
264 | 271 | { |
265 | 272 | char op; |
266 | int hold = 0; | |
267 | 273 | |
268 | 274 | op = ' '; |
269 | 275 | if ((toktype == T_DELIMITER) && ((token[0] == '+') || (token[0] == '-'))) |
311 | 317 | int |
312 | 318 | main (int argc, char **argv) |
313 | 319 | { |
320 | argc = argc; | |
314 | 321 | { |
315 | 322 | int c; |
316 | 323 | for (c = 0; c <= 25; c++) |