diff --git a/sys/libc/calloc.c b/sys/libc/calloc.c index f9a4f044d..5e5677a2b 100644 --- a/sys/libc/calloc.c +++ b/sys/libc/calloc.c @@ -10,7 +10,7 @@ /* CALLOC -- Allocate memory for NELEM elements of size ELSIZE bytes per ** element. The space is initialized to all zeros. */ -char * +void * calloc ( unsigned int nelems, unsigned int elsize diff --git a/sys/libc/free.c b/sys/libc/free.c index 4edd18c07..668825530 100644 --- a/sys/libc/free.c +++ b/sys/libc/free.c @@ -12,7 +12,7 @@ */ void free ( - char *buf + void *buf ) { XINT x_ptr, x_dtype = TY_CHAR; diff --git a/sys/libc/malloc.c b/sys/libc/malloc.c index af5506cfa..b5124d7c8 100644 --- a/sys/libc/malloc.c +++ b/sys/libc/malloc.c @@ -9,7 +9,7 @@ /* MALLOC -- Allocate an uninitialized block of memory at least nbytes in size. */ -char * +void * malloc ( unsigned nbytes ) @@ -20,5 +20,5 @@ malloc ( iferr (MALLOC (&x_ptr, &x_nchars, &x_dtype)) return (NULL); else - return ((char *)&Memc[x_ptr]); + return ((void *)&Memc[x_ptr]); } diff --git a/sys/libc/realloc.c b/sys/libc/realloc.c index 672cc7770..35986ed7d 100644 --- a/sys/libc/realloc.c +++ b/sys/libc/realloc.c @@ -11,9 +11,9 @@ ** allocated buffer. If necessary the buffer is moved, preserving any ** data in the buffer. */ -char * +void * realloc ( - char *buf, + void *buf, unsigned newsize ) { @@ -24,5 +24,5 @@ realloc ( iferr (REALLOC (&x_ptr, &x_nchars, &x_dtype)) return (NULL); else - return ((char *)&Memc[x_ptr]); + return ((void *)&Memc[x_ptr]); } diff --git a/unix/hlib/libc/iraf_libc.h b/unix/hlib/libc/iraf_libc.h index 4e68f6b38..f760a1184 100644 --- a/unix/hlib/libc/iraf_libc.h +++ b/unix/hlib/libc/iraf_libc.h @@ -124,14 +124,14 @@ extern char *c_cnvtime (long clktime, char *outstr, int maxch); extern char *c_getuid (char *outstr, int maxch); extern char *c_salloc (unsigned nbytes); extern char *c_strpak (short *sppstr, char *cstr, int maxch); -extern char *calloc (unsigned int nelems, unsigned int elsize); +extern void *calloc (unsigned int nelems, unsigned int elsize); extern char *envget (char *var); extern char *fgets (char *buf, int maxch, struct _iobuf *fp); extern char *gets (char *buf); -extern char *malloc (unsigned nbytes); +extern void *malloc (unsigned nbytes); extern char *mktemp (char *template); extern char *freadline (char *prompt); -extern char *realloc (char *buf, unsigned newsize); +extern void *realloc (void *buf, unsigned newsize); extern char *sprintf (char *str, char *format, ...); extern double atof (char *str); @@ -285,7 +285,7 @@ extern void c_xwhen (int exception, funcptr_t new_handler, funcptr_t *old_handle extern void eprintf (char *format, ...); extern void fprintf (struct _iobuf *fp, char *format, ...); extern void fputs (char *str, struct _iobuf *fp); -extern void free (char *buf); +extern void free (void *buf); extern void perror (char *prefix); extern void printf (char *format, ...); extern void setbuf (struct _iobuf *fp, char *buf);