]> granicus.if.org Git - nethack/commitdiff
new context_info struct in compat checks (trunk only)
authornethack.allison <nethack.allison>
Mon, 2 Feb 2004 01:30:31 +0000 (01:30 +0000)
committernethack.allison <nethack.allison>
Mon, 2 Feb 2004 01:30:31 +0000 (01:30 +0000)
Add the context_info struct to the version compatibility checks.
This increments EDITLEVEL rendering prior save/bones files useless.

include/global.h
include/patchlevel.h
src/version.c
sys/share/dgn_yacc.c
util/dgn_comp.y
util/makedefs.c

index 87277cb99df0200542965f347e7769fd1bd7521e..f84ea0e423e5736fcd479e0c448ad799d65ea35e 100644 (file)
@@ -301,7 +301,8 @@ struct version_info {
        unsigned long   incarnation;    /* actual version number */
        unsigned long   feature_set;    /* bitmask of config settings */
        unsigned long   entity_count;   /* # of monsters and objects */
-       unsigned long   struct_sizes;   /* size of key structs */
+       unsigned long   struct_sizes1;  /* size of key structs */
+       unsigned long   struct_sizes2;  /* size of more key structs */
 };
 
 
index a49049d7c4dca22b1e14c2614d0a48f132b6e69d..93222eda355ebe8f4484e489ebdfe7a8bbef93d8 100644 (file)
@@ -13,7 +13,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      8
+#define EDITLEVEL      9
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2004"
index 50243c0bd4d44c8d89c3d17e736e2a7dc77aac30..1e9a3a5fca6725d6f991416d09a40773aae366da 100644 (file)
@@ -89,7 +89,8 @@ boolean complain;
                          (VERSION_FEATURES & ~IGNORED_FEATURES) ||
 #endif
                   version_data->entity_count != VERSION_SANITY1 ||
-                  version_data->struct_sizes != VERSION_SANITY2) {
+                  version_data->struct_sizes1 != VERSION_SANITY2 ||
+                  version_data->struct_sizes2 != VERSION_SANITY3) {
            if (complain)
                pline("Configuration incompatibility for file \"%s\".",
                      filename);
@@ -131,7 +132,7 @@ int fd;
 {
        const static struct version_info version_data = {
                        VERSION_NUMBER, VERSION_FEATURES,
-                       VERSION_SANITY1, VERSION_SANITY2
+                       VERSION_SANITY1, VERSION_SANITY2, VERSION_SANITY3
        };
 
        bufoff(fd);
index fe5657b440a4fe8e3e01f0024803ae6af776f061..35951078404f7d5336dc18ab8d410d115c405f72 100644 (file)
@@ -544,7 +544,7 @@ output_dgn()
                    cb = 0, nb = 0;
        static struct version_info version_data = {
                        VERSION_NUMBER, VERSION_FEATURES,
-                       VERSION_SANITY1, VERSION_SANITY2
+                       VERSION_SANITY1, VERSION_SANITY2, VERSION_SANITY3
        };
 
        if(++n_dgns <= 0) {
index 9b355cb263399580edde99ce3b98adc56e959dea..2ae1c272d995f10c921e7abb9f40b6530938dc93 100644 (file)
@@ -643,7 +643,7 @@ output_dgn()
                    cb = 0, nb = 0;
        static struct version_info version_data = {
                        VERSION_NUMBER, VERSION_FEATURES,
-                       VERSION_SANITY1, VERSION_SANITY2
+                       VERSION_SANITY1, VERSION_SANITY2, VERSION_SANITY3
        };
 
        if(++n_dgns <= 0) {
index 34a3c64aec0fef24c54d879cad40aaf71142a04b..7f10e2668e37d2d1ae219c2def61d7cfa588bc63 100644 (file)
@@ -16,6 +16,7 @@
 #include "obj.h"
 #include "monst.h"
 #include "you.h"
+#include "context.h"
 #include "flag.h"
 #include "dlb.h"
 
@@ -49,7 +50,7 @@
 #endif
 
 #if defined(UNIX) && !defined(LINT) && !defined(GCC_WARN)
-static const char      SCCS_Id[] = "@(#)makedefs.c\t3.4\t2002/02/03";
+static const char      SCCS_Id[] = "@(#)makedefs.c\t3.5\t2004/02/01";
 #endif
 
        /* names of files to be generated */
@@ -498,10 +499,17 @@ make_version()
        /*
         * Value used for compiler (word size/field alignment/padding) check.
         */
-       version.struct_sizes = (((unsigned long)sizeof (struct flag)  << 24) |
+       version.struct_sizes1 = (((unsigned long)sizeof (struct context_info)  << 24) |
                                ((unsigned long)sizeof (struct obj)   << 17) |
                                ((unsigned long)sizeof (struct monst) << 10) |
                                ((unsigned long)sizeof (struct you)));
+       version.struct_sizes2 = (((unsigned long)sizeof (struct flag)  << 10) |
+                               /* free bits in here */
+#ifdef SYSFLAGS
+                               ((unsigned long)sizeof (struct sysflag)));
+#else
+                               ((unsigned long)0L));
+#endif
        return;
 }
 
@@ -553,7 +561,7 @@ do_date()
                perror(filename);
                exit(EXIT_FAILURE);
        }
-       Fprintf(ofp,"/*\tSCCS Id: @(#)date.h\t3.4\t2002/02/03 */\n\n");
+       Fprintf(ofp,"/*\tSCCS Id: @(#)date.h\t3.5\t2004/02/01 */\n\n");
        Fprintf(ofp,Dont_Edit_Code);
 
 #ifdef KR1ED
@@ -584,7 +592,9 @@ do_date()
        Fprintf(ofp,"#define VERSION_SANITY1 0x%08lx%s\n",
                version.entity_count, ul_sfx);
        Fprintf(ofp,"#define VERSION_SANITY2 0x%08lx%s\n",
-               version.struct_sizes, ul_sfx);
+               version.struct_sizes1, ul_sfx);
+       Fprintf(ofp,"#define VERSION_SANITY3 0x%08lx%s\n",
+               version.struct_sizes2, ul_sfx);
        Fprintf(ofp,"\n");
        Fprintf(ofp,"#define VERSION_STRING \"%s\"\n", version_string(buf));
        Fprintf(ofp,"#define VERSION_ID \\\n \"%s\"\n",
@@ -1391,7 +1401,7 @@ do_permonst()
                perror(filename);
                exit(EXIT_FAILURE);
        }
-       Fprintf(ofp,"/*\tSCCS Id: @(#)pm.h\t3.4\t2002/02/03 */\n\n");
+       Fprintf(ofp,"/*\tSCCS Id: @(#)pm.h\t3.5\t2004/02/01 */\n\n");
        Fprintf(ofp,Dont_Edit_Code);
        Fprintf(ofp,"#ifndef PM_H\n#define PM_H\n");
 
@@ -1707,7 +1717,7 @@ do_objs()
                perror(filename);
                exit(EXIT_FAILURE);
        }
-       Fprintf(ofp,"/*\tSCCS Id: @(#)onames.h\t3.4\t2002/02/03 */\n\n");
+       Fprintf(ofp,"/*\tSCCS Id: @(#)onames.h\t3.5\t2004/02/01 */\n\n");
        Fprintf(ofp,Dont_Edit_Code);
        Fprintf(ofp,"#ifndef ONAMES_H\n#define ONAMES_H\n\n");