X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Futil.c;h=519fae5a8ab4c37ca70d9b337172d5c1606cf930;hb=1fd81fbbe87d964ad1f7dbdce41e36f3781dcf82;hp=6c817322f20ff6895484e0e5e8f9b17aa26a1b57;hpb=55497cffdd24c959994f9a8ddd56db8ce85e1c5b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/util.c b/x2p/util.c index 6c81732..519fae5 100644 --- a/x2p/util.c +++ b/x2p/util.c @@ -27,10 +27,10 @@ Malloc_t safemalloc(size) MEM_SIZE size; { - char *ptr; - Malloc_t malloc(); + Malloc_t ptr; - ptr = (char *) malloc(size?size:1); /* malloc(0) is NASTY on our system */ + /* malloc(0) is NASTY on some systems */ + ptr = malloc(size ? size : 1); #ifdef DEBUGGING if (debug & 128) fprintf(stderr,"0x%x: (%05d) malloc %d bytes\n",ptr,an++,size); @@ -48,14 +48,13 @@ MEM_SIZE size; Malloc_t saferealloc(where,size) -char *where; +Malloc_t where; MEM_SIZE size; { - char *ptr; - Malloc_t realloc(); + Malloc_t ptr; - ptr = (char *) - realloc(where,size?size:1); /* realloc(0) is NASTY on our system */ + /* realloc(0) is NASTY on some systems */ + ptr = realloc(where, size ? size : 1); #ifdef DEBUGGING if (debug & 128) { fprintf(stderr,"0x%x: (%05d) rfree\n",where,an++); @@ -73,9 +72,9 @@ MEM_SIZE size; /* safe version of free */ -void +Free_t safefree(where) -char *where; +Malloc_t where; { #ifdef DEBUGGING if (debug & 128)