some lint cleanup

This commit is contained in:
PatR
2015-03-17 18:47:39 +02:00
committed by Pasi Kallinen
parent d4467fc594
commit 7912a566e5
4 changed files with 25 additions and 28 deletions
+8 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 do_name.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 do_name.c $NHDT-Date: 1426558927 2015/03/17 02:22:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.53 $ */
/* NetHack 3.5 do_name.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.49 $ */ /* NetHack 3.5 do_name.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.49 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -56,8 +56,8 @@ const char *goal;
} }
int int
getpos(cc, force, goal) getpos(ccp, force, goal)
coord *cc; coord *ccp;
boolean force; boolean force;
const char *goal; const char *goal;
{ {
@@ -75,8 +75,8 @@ const char *goal;
pline("(For instructions type a ?)"); pline("(For instructions type a ?)");
msg_given = TRUE; msg_given = TRUE;
} }
cx = cc->x; cx = ccp->x;
cy = cc->y; cy = ccp->y;
#ifdef CLIPPING #ifdef CLIPPING
cliparound(cx, cy); cliparound(cx, cy);
#endif #endif
@@ -97,6 +97,7 @@ const char *goal;
int sym = 0; int sym = 0;
char tmpbuf[BUFSZ]; char tmpbuf[BUFSZ];
const char *firstmatch = NULL; const char *firstmatch = NULL;
cc.x = cx; cc.x = cx;
cc.y = cy; cc.y = cy;
if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) {
@@ -250,8 +251,8 @@ const char *goal;
lock_mouse_cursor(FALSE); lock_mouse_cursor(FALSE);
#endif #endif
if (msg_given) clear_nhwindow(WIN_MESSAGE); if (msg_given) clear_nhwindow(WIN_MESSAGE);
cc->x = cx; ccp->x = cx;
cc->y = cy; ccp->y = cy;
return result; return result;
} }
+4 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 pickup.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.130 $ */ /* NetHack 3.5 pickup.c $NHDT-Date: 1426558927 2015/03/17 02:22:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.131 $ */
/* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1515,7 +1515,7 @@ doloot() /* loot a container on the floor or loot saddle from mon. */
lootcont: lootcont:
if (container_at(cc.x, cc.y, FALSE)) { if (container_at(cc.x, cc.y, FALSE)) {
boolean any = FALSE; boolean anyfound = FALSE;
int num_conts = 0; int num_conts = 0;
if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0;
@@ -1563,14 +1563,14 @@ lootcont:
cobj, doname, ansimpleoname, "a container")); cobj, doname, ansimpleoname, "a container"));
if (c == 'q') return (timepassed); if (c == 'q') return (timepassed);
if (c == 'n') continue; if (c == 'n') continue;
any = TRUE; anyfound = TRUE;
timepassed |= do_loot_cont(&cobj); timepassed |= do_loot_cont(&cobj);
/* might have triggered chest trap or magic bag explosion */ /* might have triggered chest trap or magic bag explosion */
if (multi < 0 || !cobj) return 1; if (multi < 0 || !cobj) return 1;
} }
} }
if (any) c = 'y'; if (anyfound) c = 'y';
} }
} else if (IS_GRAVE(levl[cc.x][cc.y].typ)) { } else if (IS_GRAVE(levl[cc.x][cc.y].typ)) {
You("need to dig up the grave to effectively loot it..."); You("need to dig up the grave to effectively loot it...");
+11 -9
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 role.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 role.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */
/* NetHack 3.5 role.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.18 $ */ /* NetHack 3.5 role.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.18 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1333,14 +1333,16 @@ plnamesuffix()
int i; int i;
#ifdef GENERIC_USERNAMES #ifdef GENERIC_USERNAMES
/* some generic user names will be ignored in favor of prompting */ {
i = (int)strlen(plname); /* some generic user names will be ignored in favor of prompting */
eptr = GENERIC_USERNAMES; const char *uptr = GENERIC_USERNAMES;
sptr = strstri(eptr, plname);
if (sptr i = (int)strlen(plname);
&& (sptr == eptr || sptr[-1] == ' ') if ((sptr = strstri(uptr, plname)) != 0
&& (sptr[i] == ' ' || sptr[i] == '\0')) && (sptr == uptr || sptr[-1] == ' ')
*plname = '\0'; /* call askname() */ && (sptr[i] == ' ' || sptr[i] == '\0'))
*plname = '\0'; /* call askname() */
}
#endif #endif
do { do {
+2 -8
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 trap.c $NHDT-Date: 1425318721 2015/03/02 17:52:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ /* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */
/* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -3016,7 +3016,6 @@ xchar x, y;
{ {
int chance; int chance;
struct obj *otmp, *ncobj; struct obj *otmp, *ncobj;
int retval = 0;
int in_sight = !Blind && couldsee(x, y); /* Don't care if it's lit */ int in_sight = !Blind && couldsee(x, y); /* Don't care if it's lit */
int dindx; int dindx;
@@ -3158,7 +3157,7 @@ struct obj *obj;
const char *ostr; const char *ostr;
boolean force; boolean force;
{ {
boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; boolean exploded = FALSE;
if (snuff_lit(obj)) if (snuff_lit(obj))
return ER_DAMAGED; return ER_DAMAGED;
@@ -3214,11 +3213,6 @@ boolean force;
(one ? "Another" : "More"), (one ? "Another" : "More"),
bufp, vtense(bufp, "explode")); bufp, vtense(bufp, "explode"));
exploded = TRUE; exploded = TRUE;
/* let caller know that obj has gone away
[when obj is part of a list, delobj()'s
obj_extract_self() takes care of this;
for loose_obj, obj should always equal
*objp and otmp should always be null] */
setnotworn(obj); setnotworn(obj);
delobj(obj); delobj(obj);
if (update) if (update)