comparison rogue4/pack.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 e52a8a7ad4c5
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 money(int value);
18
17 /* 19 /*
18 * update_mdest: 20 * update_mdest:
19 * Called after picking up an object, before discarding it. 21 * Called after picking up an object, before discarding it.
20 * If this was the object of something's desire, that monster will 22 * If this was the object of something's desire, that monster will
21 * get mad and run at the hero 23 * get mad and run at the hero
22 */ 24 */
23 update_mdest(obj) 25 void
24 register THING *obj; 26 update_mdest(THING *obj)
25 { 27 {
26 register THING *mp; 28 register THING *mp;
27 29
28 for (mp = mlist; mp != NULL; mp = next(mp)) 30 for (mp = mlist; mp != NULL; mp = next(mp))
29 if (mp->t_dest == &obj->o_pos) 31 if (mp->t_dest == &obj->o_pos)
34 * add_pack: 36 * add_pack:
35 * Pick up an object and add it to the pack. If the argument is 37 * Pick up an object and add it to the pack. If the argument is
36 * non-null use it as the linked_list pointer instead of gettting 38 * non-null use it as the linked_list pointer instead of gettting
37 * it off the ground. 39 * it off the ground.
38 */ 40 */
39 add_pack(obj, silent) 41 void
40 register THING *obj; 42 add_pack(THING *obj, bool silent)
41 bool silent;
42 { 43 {
43 register THING *op, *lp = NULL; 44 register THING *op, *lp = NULL;
44 register bool exact, from_floor; 45 register bool exact, from_floor;
45 register char floor; 46 register char floor;
46 int discarded = 0; 47 int discarded = 0;
214 215
215 /* 216 /*
216 * inventory: 217 * inventory:
217 * List what is in the pack 218 * List what is in the pack
218 */ 219 */
219 inventory(list, type) 220 bool
220 THING *list; 221 inventory(THING *list, int type)
221 int type;
222 { 222 {
223 register char ch; 223 register char ch;
224 register int n_objs; 224 register int n_objs;
225 char inv_temp[MAXSTR]; 225 char inv_temp[MAXSTR];
226 226
251 251
252 /* 252 /*
253 * pick_up: 253 * pick_up:
254 * Add something to characters pack. 254 * Add something to characters pack.
255 */ 255 */
256 pick_up(ch) 256 void
257 char ch; 257 pick_up(char ch)
258 { 258 {
259 register THING *obj, *mp; 259 register THING *obj, *mp;
260 260
261 switch (ch) 261 switch (ch)
262 { 262 {
288 288
289 /* 289 /*
290 * picky_inven: 290 * picky_inven:
291 * Allow player to inventory a single item 291 * Allow player to inventory a single item
292 */ 292 */
293 picky_inven() 293 void
294 picky_inven(void)
294 { 295 {
295 register THING *obj; 296 register THING *obj;
296 register char ch, mch; 297 register char ch, mch;
297 298
298 if (pack == NULL) 299 if (pack == NULL)
323 /* 324 /*
324 * get_item: 325 * get_item:
325 * Pick something out of a pack for a purpose 326 * Pick something out of a pack for a purpose
326 */ 327 */
327 THING * 328 THING *
328 get_item(purpose, type) 329 get_item(char *purpose, int type)
329 char *purpose;
330 int type;
331 { 330 {
332 register THING *obj; 331 register THING *obj;
333 register char ch, och; 332 register char ch, och;
334 333
335 if (pack == NULL) 334 if (pack == NULL)
382 381
383 /* 382 /*
384 * pack_char: 383 * pack_char:
385 * Return which character would address a pack object 384 * Return which character would address a pack object
386 */ 385 */
387 pack_char(obj) 386 char
388 register THING *obj; 387 pack_char(THING *obj)
389 { 388 {
390 register THING *item; 389 register THING *item;
391 register char c; 390 register char c;
392 391
393 c = 'a'; 392 c = 'a';
401 400
402 /* 401 /*
403 * money: 402 * money:
404 * Add or subtract gold from the pack 403 * Add or subtract gold from the pack
405 */ 404 */
406 money(value) 405 void
407 register int value; 406 money(int value)
408 { 407 {
409 register char floor; 408 register char floor;
410 409
411 floor = (proom->r_flags & ISGONE) ? PASSAGE : FLOOR; 410 floor = (proom->r_flags & ISGONE) ? PASSAGE : FLOOR;
412 purse += value; 411 purse += value;