From e92cc011a4a87695d0fa6549e67a4da0f222b5d1 Mon Sep 17 00:00:00 2001 From: icculus Date: Thu, 27 Mar 2008 23:06:57 -0400 Subject: [PATCH] [svn] Fixed test malloc. --HG-- branch : trunk --- testparse.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/testparse.c b/testparse.c index 07a3d0ec..62162fb2 100644 --- a/testparse.c +++ b/testparse.c @@ -3,7 +3,7 @@ #include "mojoshader.h" -#if DEBUG_MALLOC +#if MOJOSHADER_DEBUG_MALLOC static void *Malloc(int len) { void *ptr = malloc(len + sizeof (int)); @@ -17,9 +17,8 @@ static void *Malloc(int len) static void Free(void *_ptr) { - int *ptr = (((int *) ptr) - 1); - int *store = (int *) ptr; - int len = *store; + int *ptr = (((int *) _ptr) - 1); + int len = *ptr; printf("free() %d bytes (%p)\n", len, ptr); free(ptr); } // Free