]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - zone.h
DP code cleanup, stage one - all headers that can be protected by ifdef
[xonotic/darkplaces.git] / zone.h
diff --git a/zone.h b/zone.h
index 79b81e5f94744e7c50c4172276ced8cbd44001ec..d50265fbdc263feda5777f82e122d54db901e843 100644 (file)
--- a/zone.h
+++ b/zone.h
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #ifndef ZONE_H
 #define ZONE_H
+
 #define POOLNAMESIZE 128
 // give malloc padding so we can't waste most of a page at the end
 #define MEMCLUMPSIZE (65536 - 1536)
@@ -28,8 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define MEMBITS (MEMCLUMPSIZE / MEMUNIT)
 #define MEMBITINTS (MEMBITS / 32)
 
-#define MEMHEADER_SENTINEL 0xABADCAFE
-#define MEMCLUMP_SENTINEL 0xDEADF00D
+#define MEMHEADER_SENTINEL1 0xDEADF00D
+#define MEMHEADER_SENTINEL2 0xDF
+#define MEMCLUMP_SENTINEL 0xABADCAFE
 
 typedef struct memheader_s
 {
@@ -44,16 +46,16 @@ typedef struct memheader_s
        // file name and line where Mem_Alloc was called
        char *filename;
        int fileline;
-       // should always be MEMHEADER_SENTINEL
+       // should always be MEMHEADER_SENTINEL1
        int sentinel1;
-       // immediately followed by data, which is followed by another MEMHEADER_SENTINEL
+       // immediately followed by data, which is followed by a MEMHEADER_SENTINEL2 byte
 }
 memheader_t;
 
 typedef struct memclump_s
 {
        // contents of the clump
-       byte block[MEMCLUMPSIZE];
+       qbyte block[MEMCLUMPSIZE];
        // should always be MEMCLUMP_SENTINEL
        int sentinel1;
        // if a bit is on, it means that the MEMUNIT bytes it represents are
@@ -115,4 +117,6 @@ void Memory_Init_Commands (void);
 extern mempool_t *zonemempool;
 #define Z_Malloc(size) Mem_Alloc(zonemempool,size)
 #define Z_Free(data) Mem_Free(data)
+
 #endif
+