switch source tree from k&r to c99
This commit is contained in:
70
src/wield.c
70
src/wield.c
@@ -52,10 +52,10 @@
|
||||
* No item may be in more than one of these slots.
|
||||
*/
|
||||
|
||||
static boolean FDECL(cant_wield_corpse, (struct obj *));
|
||||
static int FDECL(ready_weapon, (struct obj *));
|
||||
static int FDECL(ready_ok, (struct obj *));
|
||||
static int FDECL(wield_ok, (struct obj *));
|
||||
static boolean cant_wield_corpse(struct obj *);
|
||||
static int ready_weapon(struct obj *);
|
||||
static int ready_ok(struct obj *);
|
||||
static int wield_ok(struct obj *);
|
||||
|
||||
/* used by will_weld() */
|
||||
/* probably should be renamed */
|
||||
@@ -96,8 +96,7 @@ static const char
|
||||
* to print the appropriate messages.
|
||||
*/
|
||||
void
|
||||
setuwep(obj)
|
||||
register struct obj *obj;
|
||||
setuwep(struct obj *obj)
|
||||
{
|
||||
struct obj *olduwep = uwep;
|
||||
|
||||
@@ -130,8 +129,7 @@ register struct obj *obj;
|
||||
}
|
||||
|
||||
static boolean
|
||||
cant_wield_corpse(obj)
|
||||
struct obj *obj;
|
||||
cant_wield_corpse(struct obj *obj)
|
||||
{
|
||||
char kbuf[BUFSZ];
|
||||
|
||||
@@ -149,8 +147,7 @@ struct obj *obj;
|
||||
}
|
||||
|
||||
static int
|
||||
ready_weapon(wep)
|
||||
struct obj *wep;
|
||||
ready_weapon(struct obj *wep)
|
||||
{
|
||||
/* Separated function so swapping works easily */
|
||||
int res = 0;
|
||||
@@ -252,8 +249,7 @@ struct obj *wep;
|
||||
}
|
||||
|
||||
void
|
||||
setuqwep(obj)
|
||||
register struct obj *obj;
|
||||
setuqwep(struct obj *obj)
|
||||
{
|
||||
setworn(obj, W_QUIVER);
|
||||
/* no extra handling needed; this used to include a call to
|
||||
@@ -262,8 +258,7 @@ register struct obj *obj;
|
||||
}
|
||||
|
||||
void
|
||||
setuswapwep(obj)
|
||||
register struct obj *obj;
|
||||
setuswapwep(struct obj *obj)
|
||||
{
|
||||
setworn(obj, W_SWAPWEP);
|
||||
return;
|
||||
@@ -271,8 +266,7 @@ register struct obj *obj;
|
||||
|
||||
/* getobj callback for object to ready for throwing/shooting */
|
||||
static int
|
||||
ready_ok(obj)
|
||||
struct obj *obj;
|
||||
ready_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
return GETOBJ_SUGGEST;
|
||||
@@ -299,8 +293,7 @@ struct obj *obj;
|
||||
|
||||
/* getobj callback for object to wield */
|
||||
static int
|
||||
wield_ok(obj)
|
||||
struct obj *obj;
|
||||
wield_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
return GETOBJ_SUGGEST;
|
||||
@@ -316,7 +309,7 @@ struct obj *obj;
|
||||
}
|
||||
|
||||
int
|
||||
dowield()
|
||||
dowield(void)
|
||||
{
|
||||
char qbuf[QBUFSZ];
|
||||
struct obj *wep, *oldwep;
|
||||
@@ -426,7 +419,7 @@ dowield()
|
||||
}
|
||||
|
||||
int
|
||||
doswapweapon()
|
||||
doswapweapon(void)
|
||||
{
|
||||
register struct obj *oldwep, *oldswap;
|
||||
int result = 0;
|
||||
@@ -469,7 +462,7 @@ doswapweapon()
|
||||
}
|
||||
|
||||
int
|
||||
dowieldquiver()
|
||||
dowieldquiver(void)
|
||||
{
|
||||
char qbuf[QBUFSZ];
|
||||
struct obj *newquiver;
|
||||
@@ -628,9 +621,8 @@ dowieldquiver()
|
||||
|
||||
/* used for #rub and for applying pick-axe, whip, grappling hook or polearm */
|
||||
boolean
|
||||
wield_tool(obj, verb)
|
||||
struct obj *obj;
|
||||
const char *verb; /* "rub",&c */
|
||||
wield_tool(struct obj *obj,
|
||||
const char *verb) /* "rub",&c */
|
||||
{
|
||||
const char *what;
|
||||
boolean more_than_1;
|
||||
@@ -707,7 +699,7 @@ const char *verb; /* "rub",&c */
|
||||
}
|
||||
|
||||
int
|
||||
can_twoweapon()
|
||||
can_twoweapon(void)
|
||||
{
|
||||
struct obj *otmp;
|
||||
|
||||
@@ -753,7 +745,7 @@ can_twoweapon()
|
||||
}
|
||||
|
||||
void
|
||||
drop_uswapwep()
|
||||
drop_uswapwep(void)
|
||||
{
|
||||
char str[BUFSZ];
|
||||
struct obj *obj = uswapwep;
|
||||
@@ -765,14 +757,13 @@ drop_uswapwep()
|
||||
}
|
||||
|
||||
void
|
||||
set_twoweap(on_off)
|
||||
boolean on_off;
|
||||
set_twoweap(boolean on_off)
|
||||
{
|
||||
u.twoweap = on_off;
|
||||
}
|
||||
|
||||
int
|
||||
dotwoweapon()
|
||||
dotwoweapon(void)
|
||||
{
|
||||
/* You can always toggle it off */
|
||||
if (u.twoweap) {
|
||||
@@ -800,7 +791,7 @@ dotwoweapon()
|
||||
* 2. Making an item disappear for a bones pile.
|
||||
*/
|
||||
void
|
||||
uwepgone()
|
||||
uwepgone(void)
|
||||
{
|
||||
if (uwep) {
|
||||
if (artifact_light(uwep) && uwep->lamplit) {
|
||||
@@ -815,7 +806,7 @@ uwepgone()
|
||||
}
|
||||
|
||||
void
|
||||
uswapwepgone()
|
||||
uswapwepgone(void)
|
||||
{
|
||||
if (uswapwep) {
|
||||
setworn((struct obj *) 0, W_SWAPWEP);
|
||||
@@ -824,7 +815,7 @@ uswapwepgone()
|
||||
}
|
||||
|
||||
void
|
||||
uqwepgone()
|
||||
uqwepgone(void)
|
||||
{
|
||||
if (uquiver) {
|
||||
setworn((struct obj *) 0, W_QUIVER);
|
||||
@@ -833,7 +824,7 @@ uqwepgone()
|
||||
}
|
||||
|
||||
void
|
||||
untwoweapon()
|
||||
untwoweapon(void)
|
||||
{
|
||||
if (u.twoweap) {
|
||||
You("%s.", can_no_longer_twoweap);
|
||||
@@ -844,9 +835,7 @@ untwoweapon()
|
||||
}
|
||||
|
||||
int
|
||||
chwepon(otmp, amount)
|
||||
register struct obj *otmp;
|
||||
register int amount;
|
||||
chwepon(struct obj *otmp, int amount)
|
||||
{
|
||||
const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE);
|
||||
const char *xtime, *wepname = "";
|
||||
@@ -979,8 +968,7 @@ register int amount;
|
||||
}
|
||||
|
||||
int
|
||||
welded(obj)
|
||||
register struct obj *obj;
|
||||
welded(struct obj *obj)
|
||||
{
|
||||
if (obj && obj == uwep && will_weld(obj)) {
|
||||
set_bknown(obj, 1);
|
||||
@@ -990,8 +978,7 @@ register struct obj *obj;
|
||||
}
|
||||
|
||||
void
|
||||
weldmsg(obj)
|
||||
register struct obj *obj;
|
||||
weldmsg(struct obj *obj)
|
||||
{
|
||||
long savewornmask;
|
||||
|
||||
@@ -1004,8 +991,7 @@ register struct obj *obj;
|
||||
|
||||
/* test whether monster's wielded weapon is stuck to hand/paw/whatever */
|
||||
boolean
|
||||
mwelded(obj)
|
||||
struct obj *obj;
|
||||
mwelded(struct obj *obj)
|
||||
{
|
||||
/* caller is responsible for making sure this is a monster's item */
|
||||
if (obj && (obj->owornmask & W_WEP) && will_weld(obj))
|
||||
|
||||
Reference in New Issue
Block a user