]> granicus.if.org Git - nethack/commitdiff
autopickup exceptions
authornethack.rankin <nethack.rankin>
Sat, 15 Nov 2003 08:09:18 +0000 (08:09 +0000)
committernethack.rankin <nethack.rankin>
Sat, 15 Nov 2003 08:09:18 +0000 (08:09 +0000)
     External names longer than 31 characters trigger a compiler warning
for me about truncation, and that causes make to quit.  So shorten the
two long names.  Also, call the cleanup routine for the FREE_ALL_MEMORY
configuration.

include/extern.h
src/files.c
src/options.c
src/save.c

index f777c3bca70d0dfc19c5fb7ede8f60ae1fef8f87..5c8e3d0550224f15782e2f715d847c88b56a69aa 100644 (file)
@@ -1417,8 +1417,8 @@ E void FDECL(set_wc_option_mod_status, (unsigned long, int));
 E void FDECL(set_wc2_option_mod_status, (unsigned long, int));
 E void FDECL(set_option_mod_status, (const char *,int));
 #ifdef AUTOPICKUP_EXCEPTIONS
-E int FDECL(add_autopickup_exception_mapping, (const char *));
-E void NDECL(free_autopickup_exception_mappings);
+E int FDECL(add_autopickup_exception, (const char *));
+E void NDECL(free_autopickup_exceptions);
 #endif /* AUTOPICKUP_EXCEPTIONS */
 
 /* ### pager.c ### */
index e50e5f75e4fb8920979e93a5d4715f4a57c79cdd..5113cbb8696b1c74133d0852424ce92759aa57a2 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)files.c    3.4     2003/02/18      */
+/*     SCCS Id: @(#)files.c    3.4     2003/11/14      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1745,7 +1745,7 @@ char              *tmp_levels;
                        plnamesuffix(); /* set the character class */
 #ifdef AUTOPICKUP_EXCEPTIONS
        } else if (match_varname(buf, "AUTOPICKUP_EXCEPTION", 5)) {
-               add_autopickup_exception_mapping(bufp);
+               add_autopickup_exception(bufp);
 #endif
 #ifdef NOCWD_ASSUMPTIONS
        } else if (match_varname(buf, "HACKDIR", 4)) {
index 02f0f6ed02240dc5954fa290324a245e32272503..2bc1774a2554aae18cdf251226d870be3b16a8a2 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)options.c  3.4     2003/10/20      */
+/*     SCCS Id: @(#)options.c  3.4     2003/11/14      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -2841,7 +2841,7 @@ boolean setinitial,setfromfile;
                if (apebuf[0] == '\033') retval = FALSE;
                apebuf[0] = '"';
                Strcat(apebuf,"\"");
-               add_autopickup_exception_mapping(apebuf);
+               add_autopickup_exception(apebuf);
        } else if (opt_idx == 1) {
                tmpwin = create_nhwindow(NHW_TEXT);
                ape = iflags.autopickup_exceptions;
@@ -3170,7 +3170,7 @@ dotogglepickup()
 
 #ifdef AUTOPICKUP_EXCEPTIONS
 int
-add_autopickup_exception_mapping(mapping)
+add_autopickup_exception(mapping)
 const char *mapping;
 {
        struct autopickup_exception *newape, *ape;
@@ -3249,9 +3249,10 @@ count_ape_maps()
 }
 
 void
-free_autopickup_exception_mappings()
+free_autopickup_exceptions()
 {
        struct autopickup_exception *ape = iflags.autopickup_exceptions;
+
        while((ape = iflags.autopickup_exceptions) != 0) {
                free(ape->pattern);
                iflags.autopickup_exceptions = ape->next;
index d40d86455533dbec9ec9be890d8604ab2645c292..ea101a54f78e73d02e62f49f2e1b97104c1fb54a 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)save.c     3.4     2002/08/22      */
+/*     SCCS Id: @(#)save.c     3.4     2003/11/14      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1109,6 +1109,7 @@ freedynamicdata()
        if (iflags.wc_font_menu) free(iflags.wc_font_menu);
        if (iflags.wc_font_status) free(iflags.wc_font_status);
        if (iflags.wc_tile_file) free(iflags.wc_tile_file);
+       free_autopickup_exceptions();
 
 #endif /* FREE_ALL_MEMORY */
        return;