From: PatR Date: Sat, 11 Apr 2015 01:31:11 +0000 (-0700) Subject: obj_nexto_xy lint X-Git-Tag: NetHack-3.6.0_RC01~414^2~41^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91fc8dc69cf254af8168b6f27af7b27b4847172a;p=nethack obj_nexto_xy lint --- diff --git a/include/extern.h b/include/extern.h index 9df1a8ece..7192bba42 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1426966688 2015/03/21 19:38:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.411 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1428715841 2015/04/11 01:30:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.454 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1228,7 +1228,7 @@ E long FDECL(peek_at_iced_corpse_age, (struct obj *)); E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P)); E void NDECL(obj_sanity_check); E struct obj* FDECL(obj_nexto, (struct obj*)); -E struct obj* FDECL(obj_nexto_xy, (int, int, int, int)); +E struct obj* FDECL(obj_nexto_xy, (int, int, int, unsigned)); E struct obj* FDECL(obj_absorb, (struct obj**, struct obj**)); E struct obj* FDECL(obj_meld, (struct obj**, struct obj**)); diff --git a/src/mkobj.c b/src/mkobj.c index 57c735ad3..0fd6ab589 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkobj.c $NHDT-Date: 1426470337 2015/03/16 01:45:37 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.77 $ */ +/* NetHack 3.5 mkobj.c $NHDT-Date: 1428715841 2015/04/11 01:30:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */ /* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2163,7 +2163,8 @@ obj_nexto(otmp) */ struct obj* obj_nexto_xy(otyp, x, y, oid) - int otyp, x, y, oid; +int otyp, x, y; +unsigned oid; { struct obj* otmp; int fx, fy, ex, ey; @@ -2187,13 +2188,12 @@ obj_nexto_xy(otyp, x, y, oid) for (fy = ey; abs(fy - ey) < 3; fy += dy) { /* 0, 0 was checked above */ if (fx != x || fy != y) { - if (otmp = sobj_at(otyp, fx, fy)) { + if ((otmp = sobj_at(otyp, fx, fy)) != 0) { return otmp; } } } } - return NULL; }