From 7f2cb2702a7e2451b7096bfef416dfab61cf79d9 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 3 Dec 1992 23:54:54 +0000 Subject: Some cleanup. Deleted some unused code. Fixed some declarations to use PARAMS macro. Fixed up configure.in for new targets. Some whitespace/comment fixes. Merged config/ChangeLog. --- gas/xmalloc.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'gas/xmalloc.c') diff --git a/gas/xmalloc.c b/gas/xmalloc.c index d5378d5..5a03d0d 100644 --- a/gas/xmalloc.c +++ b/gas/xmalloc.c @@ -40,17 +40,8 @@ malloc() */ -#include - -#if __STDC__ == 1 -#include -#else -#ifdef USG -#include -#else -char *malloc (); -#endif /* USG */ -#endif /* not __STDC__ */ + +#include "as.h" #define error as_fatal @@ -59,13 +50,21 @@ xmalloc (n) long n; { char *retval; - void error (); - if ((retval = malloc ((unsigned) n)) == NULL) - { - error ("virtual memory exceeded"); - } + retval = malloc ((unsigned) n); + if (retval == NULL) + error ("virtual memory exceeded"); return (retval); } +char * +xrealloc (ptr, n) + register char *ptr; + long n; +{ + ptr = realloc (ptr, (unsigned) n); + if (ptr == 0) + error ("virtual memory exceeded"); + return (ptr); +} /* end of xmalloc.c */ -- cgit v1.1