summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Jeffrey Hutzelman <jhutz@cmu.edu>2013-03-18 00:19:59 -0400
committerGravatar Jeffrey Hutzelman <jhutz@cmu.edu>2013-03-18 01:59:01 -0400
commit0a1b1120ff30703ff6e661a7b7901380f0ce4192 (patch)
tree82448436422c1c4e4f3fc9b36c521614a4b0d885 /zwgc
parent16ed769a51c69ae99123d3e64d1f914bd20d7cb8 (diff)
Dewarn with -DDEBUG
It's sort of nice to be able to build with debugging.
Diffstat (limited to 'zwgc')
-rw-r--r--zwgc/mux.c5
-rw-r--r--zwgc/new_memory.c15
-rw-r--r--zwgc/new_memory.h8
-rw-r--r--zwgc/xselect.c2
-rw-r--r--zwgc/xshow.c2
5 files changed, 17 insertions, 15 deletions
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: