summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 66bf523..0a6cdbf 100644
--- a/misc.c
+++ b/misc.c
@@ -22,9 +22,11 @@ static void **pointers=NULL;
static long *insertlist=NULL; /* We can't embed this in the pointer list;
a pointer can have any value... */
+#ifdef _VDBG_GRAPHFILE
static char **files=NULL;
static long *file_bytes=NULL;
static int filecount=0;
+#endif
static int ptop=0;
static int palloced=0;
@@ -115,7 +117,7 @@ static void *_insert(void *ptr,long bytes,char *file,long line){
global_bytes+=(bytes-HEAD_ALIGN);
- return(ptr+HEAD_ALIGN);
+ return(void*)(((char *)ptr)+HEAD_ALIGN);
}
static void _ripremove(void *ptr){
@@ -188,7 +190,7 @@ void _VDBG_dump(void){
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
bytes+=HEAD_ALIGN;
if(ptr){
- ptr-=HEAD_ALIGN;
+ ptr=(void *)(((char *)ptr)-HEAD_ALIGN);
_ripremove(ptr);
ptr=realloc(ptr,bytes);
}else{
@@ -200,7 +202,7 @@ extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
extern void _VDBG_free(void *ptr,char *file,long line){
if(ptr){
- ptr-=HEAD_ALIGN;
+ ptr=(void *)(((char *)ptr)-HEAD_ALIGN);
_ripremove(ptr);
free(ptr);
}