Commit cd5a827402f1a8d989964bbaf88b47cbe70ee106

Ran Benita 2012-06-06T10:44:22

utils: remove unused recalloc and related macros Their use is superseded by darray everywhere now. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/utils.c b/src/utils.c
index fcdc75d..57b4905 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -32,21 +32,6 @@
 
 #include "utils.h"
 
-void *
-recalloc(void *ptr, size_t old_size, size_t new_size)
-{
-    char *rtrn;
-
-    if (ptr == NULL)
-        return calloc(1, new_size);
-
-    rtrn = realloc(ptr, new_size);
-    if (rtrn && new_size > old_size)
-        memset(&rtrn[old_size], 0, new_size - old_size);
-
-    return rtrn;
-}
-
 static FILE *errorFile = NULL;
 static int outCount = 0;
 static char *preMsg = NULL;
diff --git a/src/utils.h b/src/utils.h
index 7239d6c..27d74fd 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -35,9 +35,6 @@
 
 #include <X11/Xfuncproto.h>
 
-extern void *
-recalloc(void *ptr, size_t old_size, size_t new_size);
-
 /*
  * We sometimes malloc strings and then expose them as const char*'s. This
  * macro is used when we free these strings in order to avoid -Wcast-qual
@@ -47,8 +44,6 @@ recalloc(void *ptr, size_t old_size, size_t new_size);
 
 #define uTypedAlloc(t)              ((t*)malloc(sizeof(t)))
 #define uTypedCalloc(n, t)          ((t*)calloc((n), sizeof(t)))
-#define uTypedRealloc(pO, n, t)     ((t*)realloc((pO), (n) * sizeof(t)))
-#define uTypedRecalloc(pO, o, n, t) ((t*)recalloc((pO), (o) * sizeof(t), (n) * sizeof(t)))
 
 #define uDupString(s)          ((s) ? strdup(s) : NULL)
 #define uStringText(s)         ((s) == NULL ? "<NullString>" : (s))