Mercurial > hg > early-roguelike
diff arogue5/pack.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 | 0ed67132cf10 |
children |
line wrap: on
line diff
--- a/arogue5/pack.c Sun Jan 31 13:45:07 2016 -0500 +++ b/arogue5/pack.c Sun Feb 07 14:39:21 2016 -0500 @@ -18,15 +18,15 @@ char outstring[512]; /* ridiculously long string for use with msg */ +bool is_type (struct object *obj, int type); + /* * add_pack: * Pick up an object and add it to the pack. If the argument is non-null * use it as the linked_list pointer instead of gettting it off the ground. */ bool -add_pack(item, silent, packret) -register struct linked_list *item, **packret; -bool silent; +add_pack(struct linked_list *item, bool silent, struct linked_list **packret) { register struct linked_list *ip, *lp = NULL, *ap; register struct object *obj, *op = NULL; @@ -305,9 +305,8 @@ * inventory: * list what is in the pack */ -inventory(list, type) -register struct linked_list *list; -register int type; +bool +inventory(struct linked_list *list, int type) { register struct object *obj; register char ch; @@ -390,8 +389,8 @@ * pick_up: * Add something to characters pack. */ -pick_up(ch) -char ch; +void +pick_up(char ch) { switch (ch) { default: @@ -416,7 +415,7 @@ * Allow player to inventory a single item */ void -picky_inven() +picky_inven(void) { register struct linked_list *item; register char ch, mch; @@ -471,12 +470,10 @@ /* * get_item: * pick something out of a pack for a purpose + * purpose: NULL if we should be silent (no prompts) * */ struct linked_list * -get_item(list, purpose, type) -reg struct linked_list *list; -char *purpose; /* NULL if we should be silent (no prompts) */ -int type; +get_item(struct linked_list *list, char *purpose, int type) { reg struct linked_list *item; reg struct object *obj; @@ -610,9 +607,8 @@ } } -pack_char(list, obj) -register struct object *obj; -struct linked_list *list; +char +pack_char(struct linked_list *list, struct object *obj) { register struct linked_list *item; register char c; @@ -634,8 +630,8 @@ * cur_null: * This updates cur_weapon etc for dropping things */ -cur_null(op) -reg struct object *op; +void +cur_null(struct object *op) { if (op == cur_weapon) cur_weapon = NULL; else if (op == cur_armor) cur_armor = NULL; @@ -659,7 +655,8 @@ * idenpack: * Identify all the items in the pack */ -idenpack() +void +idenpack(void) { reg struct linked_list *pc; @@ -667,9 +664,8 @@ whatis(pc); } -is_type (obj, type) -register struct object *obj; -register int type; +bool +is_type (struct object *obj, int type) { register bool current; @@ -804,8 +800,8 @@ return(FALSE); } -del_pack(item) -register struct linked_list *item; +void +del_pack(struct linked_list *item) { register struct object *obj; @@ -827,9 +823,8 @@ * it to him. */ -carry_obj(mp, chance) -register struct thing *mp; -int chance; +void +carry_obj(struct thing *mp, int chance) { reg struct linked_list *item; reg struct object *obj; @@ -851,74 +846,74 @@ * avoid it */ if (on(*mp, CARRYDAGGER)) { - item = spec_item(RELIC, MUSTY_DAGGER, NULL, NULL); + item = spec_item(RELIC, MUSTY_DAGGER, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYCLOAK)) { - item = spec_item(RELIC, EMORI_CLOAK, NULL, NULL); + item = spec_item(RELIC, EMORI_CLOAK, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYANKH)) { - item = spec_item(RELIC, HEIL_ANKH, NULL, NULL); + item = spec_item(RELIC, HEIL_ANKH, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYSTAFF)) { - item = spec_item(RELIC, MING_STAFF, NULL, NULL); + item = spec_item(RELIC, MING_STAFF, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYWAND)) { - item = spec_item(RELIC, ORCUS_WAND, NULL, NULL); + item = spec_item(RELIC, ORCUS_WAND, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYROD)) { - item = spec_item(RELIC, ASMO_ROD, NULL, NULL); + item = spec_item(RELIC, ASMO_ROD, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYAMULET)) { - item = spec_item(RELIC, YENDOR_AMULET, NULL, NULL); + item = spec_item(RELIC, YENDOR_AMULET, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYMANDOLIN)) { - item = spec_item(RELIC, BRIAN_MANDOLIN, NULL, NULL); + item = spec_item(RELIC, BRIAN_MANDOLIN, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYMSTAR)) { - item = spec_item(RELIC, HRUGGEK_MSTAR, NULL, NULL); + item = spec_item(RELIC, HRUGGEK_MSTAR, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYFLAIL)) { - item = spec_item(RELIC, YEENOGHU_FLAIL, NULL, NULL); + item = spec_item(RELIC, YEENOGHU_FLAIL, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); } if (on(*mp, CARRYHORN)) { - item = spec_item(RELIC, GERYON_HORN, NULL, NULL); + item = spec_item(RELIC, GERYON_HORN, 0, 0); obj = OBJPTR(item); obj->o_pos = mp->t_pos; attach(mp->t_pack, item); @@ -927,7 +922,7 @@ * If it carries gold, give it some */ if (on(*mp, CARRYGOLD) && rnd(100) < chance) { - item = spec_item(GOLD, NULL, NULL, NULL); + item = spec_item(GOLD, 0, 0, 0); obj = OBJPTR(item); obj->o_count = GOLDCALC + GOLDCALC; obj->o_pos = mp->t_pos; @@ -938,7 +933,7 @@ * If it carries food, give it some */ if (on(*mp, CARRYFOOD) && rnd(100) < chance) { - item = spec_item(FOOD, NULL, NULL, NULL); + item = spec_item(FOOD, 0, 0, 0); obj = OBJPTR(item); obj->o_weight = things[TYP_FOOD].mi_wght; obj->o_pos = mp->t_pos; @@ -1041,8 +1036,8 @@ * he wants (* means everything). */ -grab(y, x) -register y, x; +int +grab(int y, int x) { register struct linked_list *next_item, *item; register struct object *obj;