]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - zone.c
fix crash with predicted player locations
[xonotic/darkplaces.git] / zone.c
diff --git a/zone.c b/zone.c
index 74bc06e1837e44f0b35e27bfaaa0afb0dca34ca0..688a958e194934ec24e1d96b8416a4c9ee0e3359 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -22,7 +22,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 
 #if MEMPARANOIA
+#ifdef _MSC_VER
+#include <vadefs.h>
+#else
 #include <stdint.h>
+#endif
 #define MEMHEADER_SENTINEL_FOR_ADDRESS(p) ((sentinel_seed ^ (unsigned int) (uintptr_t) (p)) + sentinel_seed)
 unsigned int sentinel_seed;
 #else
@@ -245,7 +249,7 @@ void _Mem_Free(void *data, const char *filename, int fileline)
 {
        if (data == NULL)
        {
-               Con_DPrintf("Mem_Free: data == NULL (called at %s:%i)", filename, fileline);
+               Con_DPrintf("Mem_Free: data == NULL (called at %s:%i)\n", filename, fileline);
                return;
        }
 
@@ -601,7 +605,7 @@ void Mem_PrintStats(void)
        {
                if ((pool->flags & POOLFLAG_TEMP) && pool->chain)
                {
-                       Con_Printf("Memory pool %p has sprung a leak totalling %lu bytes (%.3fMB)!  Listing contents...\n", pool, (unsigned long)pool->totalsize, pool->totalsize / 1048576.0);
+                       Con_Printf("Memory pool %p has sprung a leak totalling %lu bytes (%.3fMB)!  Listing contents...\n", (void *)pool, (unsigned long)pool->totalsize, pool->totalsize / 1048576.0);
                        for (mem = pool->chain;mem;mem = mem->next)
                                Con_Printf("%10lu bytes allocated at %s:%i\n", (unsigned long)mem->size, mem->filename, mem->fileline);
                }
@@ -670,7 +674,9 @@ Memory_Init
 */
 void Memory_Init (void)
 {
+#if MEMPARANOIA
        sentinel_seed = rand();
+#endif
        poolchain = NULL;
        tempmempool = Mem_AllocPool("Temporary Memory", POOLFLAG_TEMP, NULL);
        zonemempool = Mem_AllocPool("Zone", 0, NULL);