summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorChip Salzenberg <chip@atlantic.net>1996-11-24 02:01:01 +1200
committerChip Salzenberg <chip@atlantic.net>1996-11-26 20:48:00 +1200
commit6d82b38436d2a39ffb7413e68ad91495cd645fff (patch)
tree666df97c84f2d546664d4a82a1e227cb251081a8 /x2p
parentf6bd30faf48db4b47d88b58c4e98bba648d605f1 (diff)
downloadperl-6d82b38436d2a39ffb7413e68ad91495cd645fff.tar.gz
Fix type mismatches in x2p's safe{alloc,realloc,free}.
Diffstat (limited to 'x2p')
-rw-r--r--x2p/util.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/x2p/util.c b/x2p/util.c
index 6c817322f2..519fae5a8a 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)