Commit e48e6e80 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

replace xrealloc() by Realloc()

parent ce86b989
......@@ -502,38 +502,6 @@ void memFree(void *ptr, const char *file, const char *functionname, int line)
}
#include "error.h" // cdiAbort()
void *cdiXmalloc(size_t size, const char *filename, const char *functionname,
int line)
{
void *value = malloc(size);
if (size == 0 || value != NULL) ; else
cdiAbort(filename, functionname, line, "malloc failed: %s", strerror(errno));
return value;
}
void *cdiXcalloc(size_t nmemb, size_t size, const char *filename,
const char *functionname, int line)
{
void *value = calloc(nmemb, size);
if (size == 0 || value != NULL) ; else
cdiAbort(filename, functionname, line, "calloc failed: %s", strerror(errno));
return value;
}
void *cdiXrealloc(void *p, size_t size, const char *functionname,
const char *filename, int line)
{
void *value = realloc(p, size);
if (size == 0 || value != NULL) ; else
cdiAbort(filename, functionname, line, "realloc failed: %s", strerror(errno));
return value;
}
size_t memTotal(void)
{
size_t memtotal = 0;
......
......@@ -35,15 +35,6 @@ extern void memFree (void *ptr, const char *file, const char *functionname,
#endif /* DEBUG_MEMORY */
void *cdiXmalloc(size_t, const char *, const char *, int);
#define xmalloc(size) cdiXmalloc((size), __FILE__, __func__, __LINE__ )
void *cdiXcalloc(size_t, size_t, const char *, const char *, int);
#define xcalloc(nmemb,size) cdiXcalloc((nmemb), (size), __FILE__, __func__, __LINE__)
void *cdiXrealloc(void *, size_t, const char *, const char *, int);
#define xrealloc(p,size) cdiXrealloc((p), (size), __FILE__, __func__, __LINE__)
#endif /* _DMEMORY_H */
/*
* Local Variables:
......
......@@ -1028,7 +1028,7 @@ void zaxisDefVct(int zaxisID, int size, const double *vct)
if ( zaxisptr->vct == 0 || zaxisptr->vctsize != size )
{
zaxisptr->vctsize = size;
zaxisptr->vct = (double *)xrealloc(zaxisptr->vct, (size_t)size*sizeof(double));
zaxisptr->vct = (double *) Realloc(zaxisptr->vct, (size_t)size*sizeof(double));
}
memcpy(zaxisptr->vct, vct, (size_t)size*sizeof(double));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment