Hello,
In csh(1) the functions Malloc(), Calloc() & Reallocarray()
are always called via the macros (which don't really do anything).
This patch renames the functions and deletes the macros.
Does this look OK?
- Michael
Index: csh.h
===================================================================
RCS file: /cvs/src/bin/csh/csh.h,v
retrieving revision 1.30
diff -u -p -u -r1.30 csh.h
--- csh.h 30 Aug 2017 06:42:21 -0000 1.30
+++ csh.h 17 Sep 2018 15:45:21 -0000
@@ -69,10 +69,6 @@ typedef void *ioctl_t; /* Third arg of
#include "char.h"
#include "error.h"
-#define xmalloc(i) Malloc(i)
-#define xreallocarray(p, i, j) Reallocarray(p, i, j)
-#define xcalloc(n, s) Calloc(n, s)
-
#include <stdio.h>
FILE *cshin, *cshout, *csherr;
Index: extern.h
===================================================================
RCS file: /cvs/src/bin/csh/extern.h,v
retrieving revision 1.27
diff -u -p -u -r1.27 extern.h
--- extern.h 15 Sep 2018 12:15:32 -0000 1.27
+++ extern.h 17 Sep 2018 15:45:21 -0000
@@ -281,9 +281,9 @@ void psecs(long);
/*
* alloc.c
*/
-void * Malloc(size_t);
-void * Reallocarray(void *, size_t, size_t);
-void * Calloc(size_t, size_t);
+void * xmalloc(size_t);
+void * xreallocarray(void *, size_t, size_t);
+void * xcalloc(size_t, size_t);
/*
* str.c:
Index: alloc.c
===================================================================
RCS file: /cvs/src/bin/csh/alloc.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 alloc.c
--- alloc.c 26 Dec 2015 13:48:38 -0000 1.17
+++ alloc.c 17 Sep 2018 15:45:21 -0000
@@ -39,7 +39,7 @@
#include "extern.h"
void *
-Malloc(size_t n)
+xmalloc(size_t n)
{
void *ptr;
@@ -51,7 +51,7 @@ Malloc(size_t n)
}
void *
-Reallocarray(void * p, size_t c, size_t n)
+xreallocarray(void * p, size_t c, size_t n)
{
void *ptr;
@@ -63,7 +63,7 @@ Reallocarray(void * p, size_t c, size_t
}
void *
-Calloc(size_t s, size_t n)
+xcalloc(size_t s, size_t n)
{
void *ptr;