Make it compile with g++.
diff --git a/tran.c b/tran.c
index ee5facb..79964cd 100644
--- a/tran.c
+++ b/tran.c
@@ -166,8 +166,8 @@
Array *ap;
Cell **tp;
- ap = malloc(sizeof(*ap));
- tp = calloc(n, sizeof(*tp));
+ ap = (Array *) malloc(sizeof(*ap));
+ tp = (Cell **) calloc(n, sizeof(*tp));
if (ap == NULL || tp == NULL)
FATAL("out of space in makesymtab");
ap->nelem = 0;
@@ -237,7 +237,7 @@
(void*)p, NN(p->nval), NN(p->sval), p->fval, p->tval);
return(p);
}
- p = malloc(sizeof(*p));
+ p = (Cell *) malloc(sizeof(*p));
if (p == NULL)
FATAL("out of space for symbol table at %s", n);
p->nval = tostring(n);
@@ -272,7 +272,7 @@
Cell *cp, *op, **np;
nsz = GROWTAB * tp->size;
- np = calloc(nsz, sizeof(*np));
+ np = (Cell **) calloc(nsz, sizeof(*np));
if (np == NULL) /* can't do it, but can keep running. */
return; /* someone else will run out later. */
for (i = 0; i < tp->size; i++) {
@@ -519,7 +519,7 @@
{
char *p;
- p = malloc(n);
+ p = (char *) malloc(n);
if (p == NULL)
FATAL("out of space in tostring on %s", s);
strcpy(p, s);
@@ -533,13 +533,13 @@
char *sa = getsval(a);
char *sb = getsval(b);
size_t l = strlen(sa) + strlen(sb) + 1;
- p = malloc(l);
+ p = (char *) malloc(l);
if (p == NULL)
FATAL("out of space concatenating %s and %s", sa, sb);
snprintf(p, l, "%s%s", sa, sb);
l++; // add room for ' '
- char *newbuf = malloc(l);
+ char *newbuf = (char *) malloc(l);
if (newbuf == NULL)
FATAL("out of space concatenating %s and %s", sa, sb);
// See string() in lex.c; a string "xx" is stored in the symbol
@@ -558,7 +558,7 @@
const uschar *s = (const uschar *) is;
uschar *buf, *bp;
- if ((buf = malloc(strlen(is)+3)) == NULL)
+ if ((buf = (uschar *) malloc(strlen(is)+3)) == NULL)
FATAL( "out of space in qstring(%s)", s);
for (bp = buf; (c = *s) != delim; s++) {
if (c == '\n')