[chocolate-doom] 29/42: Add the ability to specify unsupported fields

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:06:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.1.0
in repository chocolate-doom.

commit 992ccb3ac0a29a152ad9633c6447809753df138f
Author: Simon Howard <fraggle at gmail.com>
Date:   Sat Oct 8 20:14:24 2005 +0000

    Add the ability to specify unsupported fields
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 173
---
 src/deh_mapping.c | 12 +++++++++++-
 src/deh_mapping.h |  9 ++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/deh_mapping.c b/src/deh_mapping.c
index fa19f8e..e79d2ea 100644
--- a/src/deh_mapping.c
+++ b/src/deh_mapping.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: deh_mapping.c 155 2005-10-03 10:25:37Z fraggle $
+// $Id: deh_mapping.c 173 2005-10-08 20:14:24Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -21,6 +21,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.2  2005/10/08 20:14:24  fraggle
+// Add the ability to specify unsupported fields
+//
 // Revision 1.1  2005/10/03 10:25:37  fraggle
 // Add mapping code to map out structures and switch thing/frame code to use
 // this.
@@ -57,6 +60,13 @@ boolean DEH_SetMapping(deh_mapping_t *mapping,
         {
             void *location;
 
+            if (entry->location == NULL)
+            {
+                fprintf(stderr, "DEH_SetMapping: Field '%s' is unsupported.\n",
+                        name);
+                return false;
+            }
+
             location = structptr + (entry->location - mapping->base);
 
      //       printf("Setting %p::%s to %i (%i bytes)\n",
diff --git a/src/deh_mapping.h b/src/deh_mapping.h
index d390bbb..b025b67 100644
--- a/src/deh_mapping.h
+++ b/src/deh_mapping.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: deh_mapping.h 155 2005-10-03 10:25:37Z fraggle $
+// $Id: deh_mapping.h 173 2005-10-08 20:14:24Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -21,6 +21,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.2  2005/10/08 20:14:24  fraggle
+// Add the ability to specify unsupported fields
+//
 // Revision 1.1  2005/10/03 10:25:37  fraggle
 // Add mapping code to map out structures and switch thing/frame code to use
 // this.
@@ -49,6 +52,9 @@
 #define DEH_MAPPING(deh_name, fieldname)                      \
              {deh_name, &deh_mapping_base.fieldname,          \
                  sizeof(deh_mapping_base.fieldname)},
+
+#define DEH_UNSUPPORTED_MAPPING(deh_name)                     \
+             {deh_name, NULL, -1}
             
 #define DEH_END_MAPPING                                       \
              {NULL}                                           \
@@ -69,6 +75,7 @@ struct deh_mapping_entry_s
     char *name;
 
     // location relative to the base in the deh_mapping_t struct
+    // If this is NULL, it is an unsupported mapping
 
     void *location;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list