utils: remove unused recalloc and related macros Their use is superseded by darray everywhere now. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
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))