]> granicus.if.org Git - nethack/commitdiff
function call through pointer
authorPatR <rankin@nethack.org>
Mon, 4 Feb 2019 23:01:36 +0000 (15:01 -0800)
committerPatR <rankin@nethack.org>
Mon, 4 Feb 2019 23:01:36 +0000 (15:01 -0800)
There be others of these.  Don't for ANSI C for something this simple.

src/do_name.c

index 2cfd935a49e47c2fa7204507515de15c6c29d9f7..c4605b4790e552f00513db0f9699d0b4b1e85b47 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 do_name.c       $NHDT-Date: 1546987367 2019/01/08 22:42:47 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.140 $ */
+/* NetHack 3.6 do_name.c       $NHDT-Date: 1549321230 2019/02/04 23:00:30 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.143 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Pasi Kallinen, 2018. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -382,7 +382,7 @@ int x, y, gloc;
                     || IS_UNEXPLORED_LOC(x, y - 1)));
     case GLOC_VALID:
         if (getpos_getvalid)
-            return (getpos_getvalid(x,y));
+            return (*getpos_getvalid)(x,y);
         /*FALLTHRU*/
     case GLOC_INTERESTING:
         return gather_locs_interesting(x,y, GLOC_DOOR)
@@ -551,7 +551,7 @@ int cx, cy;
         custompline(SUPPRESS_HISTORY,
                     "%s%s%s%s%s", firstmatch, *tmpbuf ? " " : "", tmpbuf,
                     (iflags.autodescribe
-                     && getpos_getvalid && !getpos_getvalid(cx, cy))
+                     && getpos_getvalid && !(*getpos_getvalid)(cx, cy))
                       ? " (illegal)" : "",
                     (iflags.getloc_travelmode && !is_valid_travelpt(cx, cy))
                       ? " (no travel path)" : "");