]> granicus.if.org Git - nethack/commitdiff
some lint cleanup
authorPatR <rankin@nethack.org>
Tue, 17 Mar 2015 02:22:49 +0000 (19:22 -0700)
committerPasi Kallinen <paxed@alt.org>
Tue, 17 Mar 2015 16:47:39 +0000 (18:47 +0200)
src/do_name.c
src/pickup.c
src/role.c
src/trap.c

index f1960b6ffc937949331b9efe768fb682bf1a458b..37daffbc491696b391f8f5b3b900a3db72154b46 100644 (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 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -56,8 +56,8 @@ const char *goal;
 }
 
 int
-getpos(cc, force, goal)
-coord *cc;
+getpos(ccp, force, goal)
+coord *ccp;
 boolean force;
 const char *goal;
 {
@@ -75,8 +75,8 @@ const char *goal;
        pline("(For instructions type a ?)");
        msg_given = TRUE;
     }
-    cx = cc->x;
-    cy = cc->y;
+    cx = ccp->x;
+    cy = ccp->y;
 #ifdef CLIPPING
     cliparound(cx, cy);
 #endif
@@ -97,6 +97,7 @@ const char *goal;
            int sym = 0;
            char tmpbuf[BUFSZ];
            const char *firstmatch = NULL;
+
            cc.x = cx;
            cc.y = cy;
            if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) {
@@ -250,8 +251,8 @@ const char *goal;
     lock_mouse_cursor(FALSE);
 #endif
     if (msg_given) clear_nhwindow(WIN_MESSAGE);
-    cc->x = cx;
-    cc->y = cy;
+    ccp->x = cx;
+    ccp->y = cy;
     return result;
 }
 
index 7b3096c5983198feda3acd454f0df1a22e55ed03..3eba9874fa7467a180ca9e37e970ccc324bba0e2 100644 (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 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* 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:
 
     if (container_at(cc.x, cc.y, FALSE)) {
-       boolean any = FALSE;
+       boolean anyfound = FALSE;
        int num_conts = 0;
 
        if (!able_to_loot(cc.x, cc.y, TRUE)) return 0;
@@ -1563,14 +1563,14 @@ lootcont:
                                      cobj, doname, ansimpleoname, "a container"));
                    if (c == 'q') return (timepassed);
                    if (c == 'n') continue;
-                   any = TRUE;
+                   anyfound = TRUE;
 
                    timepassed |= do_loot_cont(&cobj);
                    /* might have triggered chest trap or magic bag explosion */
                    if (multi < 0 || !cobj) return 1;
                }
            }
-           if (any) c = 'y';
+           if (anyfound) c = 'y';
        }
     } else if (IS_GRAVE(levl[cc.x][cc.y].typ)) {
        You("need to dig up the grave to effectively loot it...");
index 9e09d448aef0adfb1b47b302f89f69fc9639ed33..bf4d66de7c131b9ee1865ac7cae64bd99e0aa822 100644 (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 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1333,14 +1333,16 @@ plnamesuffix()
     int i;
 
 #ifdef GENERIC_USERNAMES
-    /* some generic user names will be ignored in favor of prompting */
-    i = (int)strlen(plname);
-    eptr = GENERIC_USERNAMES;
-    sptr = strstri(eptr, plname);
-    if (sptr
-       && (sptr == eptr || sptr[-1] == ' ')
-       && (sptr[i] == ' ' || sptr[i] == '\0'))
-       *plname = '\0'; /* call askname() */
+    {
+       /* some generic user names will be ignored in favor of prompting */
+       const char *uptr = GENERIC_USERNAMES;
+
+       i = (int)strlen(plname);
+       if ((sptr = strstri(uptr, plname)) != 0
+           && (sptr == uptr || sptr[-1] == ' ')
+           && (sptr[i] == ' ' || sptr[i] == '\0'))
+           *plname = '\0'; /* call askname() */
+    }
 #endif
 
     do {
index 911aafdc5762bb1ae600608ccf5a4e4ad5037de3..36c1ee632c78c0922a70fed64cd36e89dacd902e 100644 (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 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -3016,7 +3016,6 @@ xchar x, y;
 {
     int chance;
     struct obj *otmp, *ncobj;
-    int retval = 0;
     int in_sight = !Blind && couldsee(x, y);   /* Don't care if it's lit */
     int dindx;
 
@@ -3158,7 +3157,7 @@ struct obj *obj;
 const char *ostr;
 boolean force;
 {
-       boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE;
+       boolean exploded = FALSE;
 
         if (snuff_lit(obj))
             return ER_DAMAGED;
@@ -3214,11 +3213,6 @@ boolean force;
                                             (one ? "Another" : "More"),
                                 bufp, vtense(bufp, "explode"));
                         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);
                         delobj(obj);
                         if (update)