comparison rogue4/move.c @ 215:1b73a8641b37

rogue4: fix most GCC5 warnings. Converting all function definitions to ANSI style accounts for most of the change. This has exposed other problems, such as daemons not actually being their stated type, that will require more careful solutions.
author John "Elwin" Edwards
date Wed, 27 Jan 2016 19:41:05 -0500
parents 9535a08ddc39
children
comparison
equal deleted inserted replaced
214:e5a15b09ce1d 215:1b73a8641b37
12 12
13 #include <curses.h> 13 #include <curses.h>
14 #include <ctype.h> 14 #include <ctype.h>
15 #include "rogue.h" 15 #include "rogue.h"
16 16
17 void turnref(void);
18 char be_trapped(coord *tc);
19
17 /* 20 /*
18 * Used to hold the new hero position 21 * Used to hold the new hero position
19 */ 22 */
20 23
21 coord nh; 24 coord nh;
22 25
23 /* 26 /*
24 * do_run: 27 * do_run:
25 * Start the hero running 28 * Start the hero running
26 */ 29 */
27 do_run(ch) 30 void
28 char ch; 31 do_run(char ch)
29 { 32 {
30 running = TRUE; 33 running = TRUE;
31 after = FALSE; 34 after = FALSE;
32 runch = ch; 35 runch = ch;
33 } 36 }
35 /* 38 /*
36 * do_move: 39 * do_move:
37 * Check to see that a move is legal. If it is handle the 40 * Check to see that a move is legal. If it is handle the
38 * consequences (fighting, picking up, etc.) 41 * consequences (fighting, picking up, etc.)
39 */ 42 */
40 do_move(dy, dx) 43 void
41 int dy, dx; 44 do_move(int dy, int dx)
42 { 45 {
43 register char ch, fl; 46 register char ch, fl;
44 47
45 firstmove = FALSE; 48 firstmove = FALSE;
46 if (no_move) 49 if (no_move)
187 190
188 /* 191 /*
189 * turnref: 192 * turnref:
190 * Decide whether to refresh at a passage turning or not 193 * Decide whether to refresh at a passage turning or not
191 */ 194 */
192 turnref() 195 void
196 turnref(void)
193 { 197 {
194 register int index; 198 register int index;
195 199
196 index = INDEX(hero.y, hero.x); 200 index = INDEX(hero.y, hero.x);
197 if (!(_flags[index] & F_SEEN)) 201 if (!(_flags[index] & F_SEEN))
209 /* 213 /*
210 * door_open: 214 * door_open:
211 * Called to illuminate a room. If it is dark, remove anything 215 * Called to illuminate a room. If it is dark, remove anything
212 * that might move. 216 * that might move.
213 */ 217 */
214 door_open(rp) 218 void
215 struct room *rp; 219 door_open(struct room *rp)
216 { 220 {
217 register int j, k; 221 register int j, k;
218 register char ch; 222 register char ch;
219 register THING *item; 223 register THING *item;
220 224
236 240
237 /* 241 /*
238 * be_trapped: 242 * be_trapped:
239 * The guy stepped on a trap.... Make him pay. 243 * The guy stepped on a trap.... Make him pay.
240 */ 244 */
241 be_trapped(tc) 245 char
242 register coord *tc; 246 be_trapped(coord *tc)
243 { 247 {
244 register char tr; 248 register char tr;
245 register int index; 249 register int index;
246 250
247 count = running = FALSE; 251 count = running = FALSE;
314 /* 318 /*
315 * rndmove: 319 * rndmove:
316 * Move in a random direction if the monster/person is confused 320 * Move in a random direction if the monster/person is confused
317 */ 321 */
318 coord * 322 coord *
319 rndmove(who) 323 rndmove(THING *who)
320 THING *who;
321 { 324 {
322 register int x, y; 325 register int x, y;
323 register char ch; 326 register char ch;
324 register THING *obj; 327 register THING *obj;
325 static coord ret; /* what we will be returning */ 328 static coord ret; /* what we will be returning */