comparison srogue/passages.c @ 217:94a0d9dd5ce1

Super-Rogue: convert to ANSI-style function declarations. This fixes most of the build warnings.
author John "Elwin" Edwards
date Sun, 31 Jan 2016 13:45:07 -0500
parents 7f5f5f1ba09c
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
216:b24545357d2e 217:94a0d9dd5ce1
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * See the file LICENSE.TXT for full copyright and licensing information. 14 * See the file LICENSE.TXT for full copyright and licensing information.
15 */ 15 */
16 16
17 #include <stdlib.h>
17 #include "rogue.h" 18 #include "rogue.h"
18 #include "rogue.ext" 19 #include "rogue.ext"
19 20
21 void conn(int r1, int r2);
22 void door(struct room *rm, struct coord *cp);
23
20 /* 24 /*
21 * do_passages: 25 * do_passages:
22 * Draw all the passages on a level. 26 * Draw all the passages on a level.
23 */ 27 */
24 28
25 do_passages() 29 void
30 do_passages(void)
26 { 31 {
27 reg struct rdes *r1, *r2 = NULL; 32 reg struct rdes *r1, *r2 = NULL;
28 reg int i, j; 33 reg int i, j;
29 reg int roomcount; 34 reg int roomcount;
30 static struct rdes { 35 static struct rdes {
121 /* 126 /*
122 * conn: 127 * conn:
123 * Cconnect two rooms. 128 * Cconnect two rooms.
124 */ 129 */
125 130
126 conn(r1, r2) 131 void
127 int r1, r2; 132 conn(int r1, int r2)
128 { 133 {
129 reg struct room *rpf, *rpt = NULL; 134 reg struct room *rpf, *rpt = NULL;
130 reg char rmt, direc; 135 reg char rmt, direc;
131 reg int distance, turn_spot, turn_distance, rm; 136 reg int distance, turn_spot, turn_distance, rm;
132 struct coord curr, turn_delta, spos, epos; 137 struct coord curr, turn_delta, spos, epos;
253 /* 258 /*
254 * Add a door or possibly a secret door 259 * Add a door or possibly a secret door
255 * also enters the door in the exits array of the room. 260 * also enters the door in the exits array of the room.
256 */ 261 */
257 262
258 door(rm, cp) 263 void
259 struct room *rm; 264 door(struct room *rm, struct coord *cp)
260 struct coord *cp;
261 { 265 {
262 cmov(*cp); 266 cmov(*cp);
263 addch(rnd(10) < level - 1 && rnd(100) < 20 ? SECRETDOOR : DOOR); 267 addch(rnd(10) < level - 1 && rnd(100) < 20 ? SECRETDOOR : DOOR);
264 rm->r_exit[rm->r_nexits++] = *cp; 268 rm->r_exit[rm->r_nexits++] = *cp;
265 } 269 }
267 271
268 /* 272 /*
269 * add_pass: 273 * add_pass:
270 * add the passages to the current window (wizard command) 274 * add the passages to the current window (wizard command)
271 */ 275 */
272 add_pass() 276 void
277 add_pass(void)
273 { 278 {
274 reg int y, x, ch; 279 reg int y, x, ch;
275 280
276 for (y = 1; y < LINES - 3; y++) 281 for (y = 1; y < LINES - 3; y++)
277 for (x = 0; x < COLS; x++) 282 for (x = 0; x < COLS; x++)