[svn] Fixed test malloc. trunk
authoricculus
Thu, 27 Mar 2008 23:06:57 -0400
branchtrunk
changeset 50 427f32b5eeff
parent 49 780cd8790dff
child 51 b3978661fd6b
[svn] Fixed test malloc.
testparse.c
--- a/testparse.c	Thu Mar 27 22:59:38 2008 -0400
+++ b/testparse.c	Thu Mar 27 23:06:57 2008 -0400
@@ -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 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