aboutsummaryrefslogtreecommitdiff
path: root/gas/xmalloc.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1992-12-03 23:54:54 +0000
committerKen Raeburn <raeburn@cygnus>1992-12-03 23:54:54 +0000
commit7f2cb2702a7e2451b7096bfef416dfab61cf79d9 (patch)
tree30be7914e6a8181991619e01ddb4c3732b77eaaf /gas/xmalloc.c
parentc5dd66a13aa2fd6ab9e98089e171dd74534f5f85 (diff)
downloadgdb-7f2cb2702a7e2451b7096bfef416dfab61cf79d9.zip
gdb-7f2cb2702a7e2451b7096bfef416dfab61cf79d9.tar.gz
gdb-7f2cb2702a7e2451b7096bfef416dfab61cf79d9.tar.bz2
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.
Diffstat (limited to 'gas/xmalloc.c')
-rw-r--r--gas/xmalloc.c31
1 files changed, 15 insertions, 16 deletions
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 <stdio.h>
-
-#if __STDC__ == 1
-#include <stdlib.h>
-#else
-#ifdef USG
-#include <malloc.h>
-#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 */