From 0a1b1120ff30703ff6e661a7b7901380f0ce4192 Mon Sep 17 00:00:00 2001 From: Jeffrey Hutzelman Date: Mon, 18 Mar 2013 00:19:59 -0400 Subject: Dewarn with -DDEBUG It's sort of nice to be able to build with debugging. --- zwgc/mux.c | 5 +++-- zwgc/new_memory.c | 15 ++++++++------- zwgc/new_memory.h | 8 ++++---- zwgc/xselect.c | 2 +- zwgc/xshow.c | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) (limited to 'zwgc') diff --git a/zwgc/mux.c b/zwgc/mux.c index 55d5e3e..a7b2210 100644 --- a/zwgc/mux.c +++ b/zwgc/mux.c @@ -210,8 +210,9 @@ mux_loop(void) #ifdef DEBUG if (zwgc_debug) fprintf(stderr, - "mux_loop...activity on fd %d, calling %x(%x)\n", - i,input_handler[i],input_handler_arg[i]); + "mux_loop...activity on fd %d, calling %lx(%lx)\n", + i, (unsigned long)input_handler[i], + (unsigned long)input_handler_arg[i]); #endif input_handler[i](input_handler_arg[i]); } diff --git a/zwgc/new_memory.c b/zwgc/new_memory.c index 30adfd1..7ceab2d 100644 --- a/zwgc/new_memory.c +++ b/zwgc/new_memory.c @@ -61,7 +61,7 @@ int current_line = -1; * string_Copy("foo"). */ -char *memory__malloc(size) +void *memory__malloc(size) unsigned size; { char *result; @@ -84,11 +84,11 @@ char *memory__malloc(size) return(result); } -char *memory__realloc(ptr, size) - char *ptr; +void *memory__realloc(aptr, size) + void *aptr; unsigned size; { - char *result; + char *result, *ptr = aptr; assert(ptr); @@ -108,7 +108,7 @@ char *memory__realloc(ptr, size) return(result+memory__size_of_header); } -char *memory__calloc(nelem, elsize) +void *memory__calloc(nelem, elsize) unsigned nelem; unsigned elsize; { @@ -131,9 +131,10 @@ char *memory__calloc(nelem, elsize) return(result); } -void memory__free(ptr) - char *ptr; +void memory__free(aptr) + void *aptr; { + char *ptr = aptr; assert(ptr); #ifdef DEBUG_MEMORY diff --git a/zwgc/new_memory.h b/zwgc/new_memory.h index f10ac9c..31235fb 100644 --- a/zwgc/new_memory.h +++ b/zwgc/new_memory.h @@ -17,10 +17,10 @@ #ifndef memory_MODULE #define memory_MODULE -extern char *memory__malloc(); /* PRIVATE */ -extern char *memory__realloc(); /* PRIVATE */ -extern char *memory__calloc(); /* PRIVATE */ -extern void memory__free(); /* PRIVATE */ +extern void *memory__malloc(unsigned); /* PRIVATE */ +extern void *memory__realloc(void *, unsigned); /* PRIVATE */ +extern void *memory__calloc(unsigned, unsigned); /* PRIVATE */ +extern void memory__free(void *); /* PRIVATE */ #ifdef DEBUG_MEMORY diff --git a/zwgc/xselect.c b/zwgc/xselect.c index 89f594d..45ac997 100644 --- a/zwgc/xselect.c +++ b/zwgc/xselect.c @@ -127,7 +127,7 @@ xselSetProperties(Display *dpy, spec (or if this program is buggy), but it could happen */ #ifdef DEBUG fprintf(stderr, - "SelectionRequest event received for unowned selection: requestor wid=0x%x", w); + "SelectionRequest event received for unowned selection: requestor wid=0x%lx", (unsigned long)w); #endif ChangeProp(XA_STRING,8,"",0); } diff --git a/zwgc/xshow.c b/zwgc/xshow.c index 3e1b2ce..afe1037 100644 --- a/zwgc/xshow.c +++ b/zwgc/xshow.c @@ -621,7 +621,7 @@ x_get_input(Display *dpy) { XEvent event; - dprintf1("Entering x_get_input(%x).\n",dpy); + dprintf1("Entering x_get_input(%lx).\n",(unsigned long)dpy); /* * Kludge to get around lossage in XPending: -- cgit v1.2.3