#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;
#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
#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))