From 03d181b65da62ed9ab843d8612cd9413ca6fa6c0 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 24 Aug 2009 11:59:43 +0000 Subject: Squash warnings svn path=/trunk/netsurf/; revision=9431 --- utils/memdebug.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/utils/memdebug.c b/utils/memdebug.c index 312d66992..c8e28dc32 100644 --- a/utils/memdebug.c +++ b/utils/memdebug.c @@ -141,7 +141,7 @@ void *memdebug_malloc(size_t wantedsize, int line, const char *source) } if(logfile && source) - fprintf(logfile, "MEM %s:%d malloc(%u) = %p\n", + fprintf(logfile, "MEM %s:%d malloc(%zu) = %p\n", source, line, wantedsize, mem ? mem->mem : 0); return (mem ? mem->mem : NULL); } @@ -171,7 +171,7 @@ void *memdebug_calloc(size_t wanted_elements, size_t wanted_size, } if(logfile && source) - fprintf(logfile, "MEM %s:%d calloc(%u,%u) = %p\n", + fprintf(logfile, "MEM %s:%d calloc(%zu,%zu) = %p\n", source, line, wanted_elements, wanted_size, mem ? mem->mem : 0); return (mem ? mem->mem : NULL); } @@ -193,7 +193,7 @@ char *memdebug_strdup(const char *str, int line, const char *source) memcpy(mem, str, len); if(logfile) - fprintf(logfile, "MEM %s:%d strdup(%p) (%u) = %p\n", + fprintf(logfile, "MEM %s:%d strdup(%p) (%zu) = %p\n", source, line, str, len, mem); return mem; @@ -220,7 +220,7 @@ char *memdebug_strndup(const char *str, size_t size, int line, const char *sourc } if(logfile) - fprintf(logfile, "MEM %s:%d strndup(%p, %d) (%u) = %p\n", + fprintf(logfile, "MEM %s:%d strndup(%p, %zd) (%zu) = %p\n", source, line, str, size, len, mem); return mem; @@ -240,7 +240,8 @@ void *memdebug_realloc(void *ptr, size_t wantedsize, return NULL; if(ptr) { - mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem)); + mem = (struct memdebug *)(void *) + ((char *)ptr - offsetof(struct memdebug, mem)); } if(logfile) { @@ -249,7 +250,7 @@ void *memdebug_realloc(void *ptr, size_t wantedsize, for (i = 0; mem && i != 8; i++) if (((char *) mem->mem)[mem->size + i] != GUARD) fprintf(logfile, "GUARD %u match failed!\n", i); - fprintf(logfile, "MEM %s:%d realloc(%p, %u) = ", + fprintf(logfile, "MEM %s:%d realloc(%p, %zu) = ", source, line, ptr, wantedsize); fflush(logfile); } @@ -279,7 +280,8 @@ void memdebug_free(void *ptr, int line, const char *source) assert(ptr != NULL); - mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem)); + mem = (struct memdebug *)(void *) + ((char *)ptr - offsetof(struct memdebug, mem)); if(logfile) { fprintf(logfile, "MEM %s:%d free(%p)\n", source, line, ptr); if (mem->magic != MAGIC) { -- cgit v1.2.3