summaryrefslogtreecommitdiffstats
path: root/usr.sbin/zic/ialloc.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-08-05 20:28:48 +0000
committerwollman <wollman@FreeBSD.org>1995-08-05 20:28:48 +0000
commitc426abc4240ef56049117a4cc11d9db6a62c0db1 (patch)
treebf065879d0a993fdb6577c19e1877c2468185010 /usr.sbin/zic/ialloc.c
parent58f52714ede43ec8c1c272a5f379592e78845558 (diff)
downloadFreeBSD-src-c426abc4240ef56049117a4cc11d9db6a62c0db1.zip
FreeBSD-src-c426abc4240ef56049117a4cc11d9db6a62c0db1.tar.gz
Update timezone compiler and dumper to understand the new EC rules.
Diffstat (limited to 'usr.sbin/zic/ialloc.c')
-rw-r--r--usr.sbin/zic/ialloc.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/usr.sbin/zic/ialloc.c b/usr.sbin/zic/ialloc.c
index 7dc2f2b..5631947 100644
--- a/usr.sbin/zic/ialloc.c
+++ b/usr.sbin/zic/ialloc.c
@@ -1,6 +1,6 @@
#ifndef lint
#ifndef NOID
-static char elsieid[] = "@(#)ialloc.c 8.21";
+static char elsieid[] = "@(#)ialloc.c 8.28";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -8,35 +8,20 @@ static char elsieid[] = "@(#)ialloc.c 8.21";
#include "private.h"
-#ifdef MAL
-#define NULLMAL(x) ((x) == NULL || (x) == MAL)
-#endif /* defined MAL */
-#ifndef MAL
-#define NULLMAL(x) ((x) == NULL)
-#endif /* !defined MAL */
-
#define nonzero(n) (((n) == 0) ? 1 : (n))
char * icalloc P((int nelem, int elsize));
char * icatalloc P((char * old, const char * new));
char * icpyalloc P((const char * string));
char * imalloc P((int n));
-char * irealloc P((char * pointer, int size));
+void * irealloc P((void * pointer, int size));
void ifree P((char * pointer));
char *
imalloc(n)
const int n;
{
-#ifdef MAL
- register char * result;
-
- result = malloc((alloc_size_t) nonzero(n));
- return NULLMAL(result) ? NULL : result;
-#endif /* defined MAL */
-#ifndef MAL
- return malloc((alloc_size_t) nonzero(n));
-#endif /* !defined MAL */
+ return malloc((size_t) nonzero(n));
}
char *
@@ -46,17 +31,17 @@ int elsize;
{
if (nelem == 0 || elsize == 0)
nelem = elsize = 1;
- return calloc((alloc_size_t) nelem, (alloc_size_t) elsize);
+ return calloc((size_t) nelem, (size_t) elsize);
}
-char *
+void *
irealloc(pointer, size)
-char * const pointer;
+void * const pointer;
const int size;
{
- if (NULLMAL(pointer))
+ if (pointer == NULL)
return imalloc(size);
- return realloc((genericptr_t) pointer, (alloc_size_t) nonzero(size));
+ return realloc((void *) pointer, (size_t) nonzero(size));
}
char *
@@ -67,14 +52,14 @@ const char * const new;
register char * result;
register int oldsize, newsize;
- newsize = NULLMAL(new) ? 0 : strlen(new);
- if (NULLMAL(old))
+ newsize = (new == NULL) ? 0 : strlen(new);
+ if (old == NULL)
oldsize = 0;
else if (newsize == 0)
return old;
else oldsize = strlen(old);
if ((result = irealloc(old, oldsize + newsize + 1)) != NULL)
- if (!NULLMAL(new))
+ if (new != NULL)
(void) strcpy(result + oldsize, new);
return result;
}
@@ -90,7 +75,7 @@ void
ifree(p)
char * const p;
{
- if (!NULLMAL(p))
+ if (p != NULL)
(void) free(p);
}
@@ -98,6 +83,6 @@ void
icfree(p)
char * const p;
{
- if (!NULLMAL(p))
+ if (p != NULL)
(void) free(p);
}
OpenPOWER on IntegriCloud