--- ray/src/common/ealloc.c 2003/04/23 00:52:33 2.4 +++ ray/src/common/ealloc.c 2003/11/14 17:22:06 2.8 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ealloc.c,v 2.4 2003/04/23 00:52:33 greg Exp $"; +static const char RCSid[] = "$Id: ealloc.c,v 2.8 2003/11/14 17:22:06 schorsch Exp $"; #endif /* * ealloc.c - memory routines which call quit on error. @@ -11,10 +11,10 @@ static const char RCSid[] = "$Id: ealloc.c,v 2.4 2003/ #include #include +#include "rterror.h" -char * -emalloc(n) /* return pointer to n uninitialized bytes */ -unsigned int n; +extern char * /* return pointer to n uninitialized bytes */ +emalloc(unsigned int n) { register char *cp; @@ -26,13 +26,12 @@ unsigned int n; eputs("Out of memory in emalloc\n"); quit(1); + return NULL; /* pro forma return */ } -char * -ecalloc(ne, es) /* return pointer to initialized memory */ -register unsigned int ne; -unsigned int es; +extern char * /* return pointer to initialized memory */ +ecalloc(register unsigned int ne, unsigned int es) { register char *cp; @@ -51,10 +50,8 @@ unsigned int es; } -char * -erealloc(cp, n) /* reallocate cp to size n */ -register char *cp; -unsigned int n; +extern char * /* reallocate cp to size n */ +erealloc(register char *cp, unsigned int n) { if (n == 0) { if (cp != NULL) @@ -72,12 +69,12 @@ unsigned int n; eputs("Out of memory in erealloc\n"); quit(1); + return NULL; /* pro forma return */ } -void -efree(cp) /* free memory allocated by above */ -char *cp; +extern void /* free memory allocated by above */ +efree(char *cp) { free((void *)cp); }