From e9a66d6ba4d0edd2d2d12cd0271aaecc43b6067d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 26 May 2014 16:12:05 -0700 Subject: Remove unused uRealloc & uRecalloc functions Signed-off-by: Alan Coopersmith --- utils.c | 29 ----------------------------- utils.h | 8 -------- 2 files changed, 37 deletions(-) diff --git a/utils.c b/utils.c index aa2d8ad..70887c7 100644 --- a/utils.c +++ b/utils.c @@ -52,35 +52,6 @@ uCalloc(unsigned n, unsigned size) /***====================================================================***/ -Opaque -uRealloc(Opaque old, unsigned newSize) -{ - if (old == NULL) - return ((Opaque) malloc(newSize)); - else - return ((Opaque) realloc((char *) old, newSize)); -} - -/***====================================================================***/ - -Opaque -uRecalloc(Opaque old, unsigned nOld, unsigned nNew, unsigned itemSize) -{ - char *rtrn; - - if (old == NULL) - rtrn = (char *) calloc(nNew, itemSize); - else { - rtrn = (char *) realloc((char *) old, nNew * itemSize); - if ((rtrn) && (nNew > nOld)) { - bzero(&rtrn[nOld * itemSize], (nNew - nOld) * itemSize); - } - } - return (Opaque) rtrn; -} - -/***====================================================================***/ - void uFree(Opaque ptr) { diff --git a/utils.h b/utils.h index 4bf5825..26cb29a 100644 --- a/utils.h +++ b/utils.h @@ -79,18 +79,10 @@ typedef int Comparison; extern Opaque uAlloc(unsigned /* size */); extern Opaque uCalloc(unsigned /* n */ , unsigned /* size */); -extern Opaque uRealloc(Opaque /* old */ , - unsigned /* newSize */); -extern Opaque uRecalloc(Opaque /* old */ , - unsigned /* nOld */ , - unsigned /* nNew */ , - unsigned /* newSize */); extern void uFree(Opaque /* ptr */); #define uTypedAlloc(t) ((t *)uAlloc((unsigned)sizeof(t))) #define uTypedCalloc(n,t) ((t *)uCalloc((unsigned)n,(unsigned)sizeof(t))) -#define uTypedRealloc(pO,n,t) ((t *)uRealloc((Opaque)pO,((unsigned)n)*sizeof(t))) -#define uTypedRecalloc(pO,o,n,t) ((t *)uRecalloc((Opaque)pO,((unsigned)o),((unsigned)n),sizeof(t))) #if (defined mdHasAlloca) && (mdHasAlloca) #define uTmpAlloc(n) ((Opaque)alloca((unsigned)n)) #define uTmpFree(p) -- cgit v1.2.3