Mercurial > hg > early-roguelike
comparison srogue/pack.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 |
comparison
equal
deleted
inserted
replaced
| 216:b24545357d2e | 217:94a0d9dd5ce1 |
|---|---|
| 22 * add_pack: | 22 * add_pack: |
| 23 * Pick up an object and add it to the pack. If the argument | 23 * Pick up an object and add it to the pack. If the argument |
| 24 * is non-null use it as the linked_list pointer instead of | 24 * is non-null use it as the linked_list pointer instead of |
| 25 * getting it off the ground. | 25 * getting it off the ground. |
| 26 */ | 26 */ |
| 27 add_pack(item, silent) | 27 bool |
| 28 struct linked_list *item; | 28 add_pack(struct linked_list *item, bool silent) |
| 29 bool silent; | |
| 30 { | 29 { |
| 31 reg struct linked_list *ip, *lp; | 30 reg struct linked_list *ip, *lp; |
| 32 reg struct object *obj, *op = NULL; | 31 reg struct object *obj, *op = NULL; |
| 33 bool from_floor; | 32 bool from_floor; |
| 34 char delchar; | 33 char delchar; |
| 189 | 188 |
| 190 /* | 189 /* |
| 191 * inventory: | 190 * inventory: |
| 192 * Show what items are in a specific list | 191 * Show what items are in a specific list |
| 193 */ | 192 */ |
| 194 inventory(list, type) | 193 bool |
| 195 struct linked_list *list; | 194 inventory(struct linked_list *list, int type) |
| 196 int type; | |
| 197 { | 195 { |
| 198 reg struct linked_list *pc; | 196 reg struct linked_list *pc; |
| 199 reg struct object *obj; | 197 reg struct object *obj; |
| 200 reg char ch; | 198 reg char ch; |
| 201 reg int cnt; | 199 reg int cnt; |
| 227 | 225 |
| 228 /* | 226 /* |
| 229 * pick_up: | 227 * pick_up: |
| 230 * Add something to characters pack. | 228 * Add something to characters pack. |
| 231 */ | 229 */ |
| 232 pick_up(ch) | 230 void |
| 233 char ch; | 231 pick_up(char ch) |
| 234 { | 232 { |
| 235 nochange = FALSE; | 233 nochange = FALSE; |
| 236 switch(ch) { | 234 switch(ch) { |
| 237 case GOLD: | 235 case GOLD: |
| 238 money(); | 236 money(); |
| 252 | 250 |
| 253 /* | 251 /* |
| 254 * picky_inven: | 252 * picky_inven: |
| 255 * Allow player to inventory a single item | 253 * Allow player to inventory a single item |
| 256 */ | 254 */ |
| 257 picky_inven() | 255 void |
| 256 picky_inven(void) | |
| 258 { | 257 { |
| 259 reg struct linked_list *item; | 258 reg struct linked_list *item; |
| 260 reg char ch, mch; | 259 reg char ch, mch; |
| 261 | 260 |
| 262 if (pack == NULL) | 261 if (pack == NULL) |
| 286 /* | 285 /* |
| 287 * get_item: | 286 * get_item: |
| 288 * pick something out of a pack for a purpose | 287 * pick something out of a pack for a purpose |
| 289 */ | 288 */ |
| 290 struct linked_list * | 289 struct linked_list * |
| 291 get_item(purpose, type) | 290 get_item(char *purpose, int type) |
| 292 char *purpose; | |
| 293 int type; | |
| 294 { | 291 { |
| 295 reg struct linked_list *obj, *pit, *savepit = NULL; | 292 reg struct linked_list *obj, *pit, *savepit = NULL; |
| 296 struct object *pob; | 293 struct object *pob; |
| 297 int ch, och, anr, cnt; | 294 int ch, och, anr, cnt; |
| 298 | 295 |
| 406 /* | 403 /* |
| 407 * pack_char: | 404 * pack_char: |
| 408 * Get the character of a particular item in the pack | 405 * Get the character of a particular item in the pack |
| 409 */ | 406 */ |
| 410 char | 407 char |
| 411 pack_char(obj) | 408 pack_char(struct object *obj) |
| 412 struct object *obj; | |
| 413 { | 409 { |
| 414 reg struct linked_list *item; | 410 reg struct linked_list *item; |
| 415 reg char c; | 411 reg char c; |
| 416 | 412 |
| 417 c = 'a'; | 413 c = 'a'; |
| 425 | 421 |
| 426 /* | 422 /* |
| 427 * idenpack: | 423 * idenpack: |
| 428 * Identify all the items in the pack | 424 * Identify all the items in the pack |
| 429 */ | 425 */ |
| 430 idenpack() | 426 void |
| 427 idenpack(void) | |
| 431 { | 428 { |
| 432 reg struct linked_list *pc; | 429 reg struct linked_list *pc; |
| 433 | 430 |
| 434 for (pc = pack ; pc != NULL ; pc = next(pc)) | 431 for (pc = pack ; pc != NULL ; pc = next(pc)) |
| 435 whatis(pc); | 432 whatis(pc); |
| 438 | 435 |
| 439 /* | 436 /* |
| 440 * del_pack: | 437 * del_pack: |
| 441 * Take something out of the hero's pack | 438 * Take something out of the hero's pack |
| 442 */ | 439 */ |
| 443 del_pack(what) | 440 void |
| 444 struct linked_list *what; | 441 del_pack(struct linked_list *what) |
| 445 { | 442 { |
| 446 reg struct object *op; | 443 reg struct object *op; |
| 447 | 444 |
| 448 op = OBJPTR(what); | 445 op = OBJPTR(what); |
| 449 cur_null(op); /* check for current stuff */ | 446 cur_null(op); /* check for current stuff */ |
| 459 | 456 |
| 460 /* | 457 /* |
| 461 * cur_null: | 458 * cur_null: |
| 462 * This updates cur_weapon etc for dropping things | 459 * This updates cur_weapon etc for dropping things |
| 463 */ | 460 */ |
| 464 cur_null(op) | 461 void |
| 465 struct object *op; | 462 cur_null(struct object *op) |
| 466 { | 463 { |
| 467 if (op == cur_weapon) | 464 if (op == cur_weapon) |
| 468 cur_weapon = NULL; | 465 cur_weapon = NULL; |
| 469 else if (op == cur_armor) | 466 else if (op == cur_armor) |
| 470 cur_armor = NULL; | 467 cur_armor = NULL; |
