comparison arogue5/misc.c @ 218:56e748983fa8

Advanced Rogue 5: convert to ANSI function declarations. This still leaves over a thousand lines of warning messages, mostly related to the return types of daemons and fuses.
author John "Elwin" Edwards
date Sun, 07 Feb 2016 14:39:21 -0500
parents f2951c4e28d9
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
217:94a0d9dd5ce1 218:56e748983fa8
16 16
17 /* 17 /*
18 * See if a monster has some magic it can use. Use it and return TRUE if so. 18 * See if a monster has some magic it can use. Use it and return TRUE if so.
19 */ 19 */
20 bool 20 bool
21 m_use_item(monster, monst_pos, defend_pos) 21 m_use_item(struct thing *monster, coord *monst_pos, coord *defend_pos)
22 register struct thing *monster;
23 register coord *monst_pos, *defend_pos;
24 { 22 {
25 register struct linked_list *pitem; 23 register struct linked_list *pitem;
26 register struct object *obj; 24 register struct object *obj;
27 register coord *shoot_dir = can_shoot(monst_pos, defend_pos); 25 register coord *shoot_dir = can_shoot(monst_pos, defend_pos);
28 int dist=DISTANCE(monst_pos->y, monst_pos->x, defend_pos->y, defend_pos->x); 26 int dist=DISTANCE(monst_pos->y, monst_pos->x, defend_pos->y, defend_pos->x);
93 return(FALSE); 91 return(FALSE);
94 } 92 }
95 93
96 /* 94 /*
97 * add something to the contents of something else 95 * add something to the contents of something else
96 * bag: the holder of the items
97 * item: the item to put inside
98 */ 98 */
99 put_contents(bag, item) 99 void
100 register struct object *bag; /* the holder of the items */ 100 put_contents(struct object *bag, struct linked_list *item)
101 register struct linked_list *item; /* the item to put inside */
102 { 101 {
103 register struct linked_list *titem; 102 register struct linked_list *titem;
104 register struct object *tobj; 103 register struct object *tobj;
105 104
106 bag->o_ac++; 105 bag->o_ac++;
121 } 120 }
122 } 121 }
123 122
124 /* 123 /*
125 * remove something from something else 124 * remove something from something else
125 * bag: the holder of the items
126 */ 126 */
127 take_contents(bag, item) 127 void
128 register struct object *bag; /* the holder of the items */ 128 take_contents(struct object *bag, struct linked_list *item)
129 register struct linked_list *item;
130 { 129 {
131 130
132 if (bag->o_ac <= 0) { 131 if (bag->o_ac <= 0) {
133 msg("Nothing to take out"); 132 msg("Nothing to take out");
134 return; 133 return;
138 if (!add_pack(item, FALSE, NULL)) 137 if (!add_pack(item, FALSE, NULL))
139 put_contents(bag, item); 138 put_contents(bag, item);
140 } 139 }
141 140
142 141
143 do_bag(item) 142 void
144 register struct linked_list *item; 143 do_bag(struct linked_list *item)
145 { 144 {
146 145
147 register struct linked_list *titem = NULL; 146 register struct linked_list *titem = NULL;
148 register struct object *obj; 147 register struct object *obj;
149 bool doit = TRUE; 148 bool doit = TRUE;
231 touchwin(cw); 230 touchwin(cw);
232 } 231 }
233 } 232 }
234 } 233 }
235 234
236 do_panic() 235 void
236 do_panic(void)
237 { 237 {
238 register int x,y; 238 register int x,y;
239 register struct linked_list *mon; 239 register struct linked_list *mon;
240 register struct thing *th; 240 register struct thing *th;
241 241
270 270
271 /* 271 /*
272 * print miscellaneous magic bonuses 272 * print miscellaneous magic bonuses
273 */ 273 */
274 char * 274 char *
275 misc_name(obj) 275 misc_name(struct object *obj)
276 register struct object *obj;
277 { 276 {
278 static char buf[LINELEN]; 277 static char buf[LINELEN];
279 char buf1[LINELEN]; 278 char buf1[LINELEN];
280 279
281 buf[0] = '\0'; 280 buf[0] = '\0';
338 } 337 }
339 strcat (buf, buf1); 338 strcat (buf, buf1);
340 return buf; 339 return buf;
341 } 340 }
342 341
343 use_emori() 342 void
343 use_emori(void)
344 { 344 {
345 char selection; /* Cloak function */ 345 char selection; /* Cloak function */
346 int state = 0; /* Menu state */ 346 int state = 0; /* Menu state */
347 347
348 msg("What do you want to do? (* for a list): "); 348 msg("What do you want to do? (* for a list): ");
440 else appear(); 440 else appear();
441 } 441 }
442 } 442 }
443 } 443 }
444 444
445 use_mm(which) 445 void
446 int which; 446 use_mm(int which)
447 { 447 {
448 register struct object *obj = NULL; 448 register struct object *obj = NULL;
449 register struct linked_list *item = NULL; 449 register struct linked_list *item = NULL;
450 bool cursed, blessed, is_mm; 450 bool cursed, blessed, is_mm;
451 char buf[LINELEN]; 451 char buf[LINELEN];
494 case MM_JUG: 494 case MM_JUG:
495 if (obj->o_ac == JUG_EMPTY) { 495 if (obj->o_ac == JUG_EMPTY) {
496 msg("The jug is empty"); 496 msg("The jug is empty");
497 break; 497 break;
498 } 498 }
499 quaff (obj->o_ac, NULL, FALSE); 499 quaff (obj->o_ac, 0, FALSE);
500 obj->o_ac = JUG_EMPTY; 500 obj->o_ac = JUG_EMPTY;
501 fuse (alchemy, obj, ALCHEMYTIME, AFTER); 501 fuse (alchemy, obj, ALCHEMYTIME, AFTER);
502 if (!(obj->o_flags & ISKNOW)) 502 if (!(obj->o_flags & ISKNOW))
503 whatis(item); 503 whatis(item);
504 504