#include <string.h>
void *
-xmalloc(uns size)
+xmalloc(size_t size)
{
void *x = malloc(size);
if (!x)
- die("Cannot allocate %d bytes of memory", size);
+ die("Cannot allocate %zu bytes of memory", size);
return x;
}
#define xrealloc ucw_xrealloc
#define xfree ucw_xfree
-void *xmalloc(uns) LIKE_MALLOC; /** Allocate memory and die() if there is none. **/
-void *xrealloc(void *, uns); /** Reallocate memory and die() if there is none. **/
+void *xmalloc(size_t) LIKE_MALLOC; /** Allocate memory and die() if there is none. **/
+void *xrealloc(void *, size_t); /** Reallocate memory and die() if there is none. **/
void xfree(void *); /** Free memory allocated by xmalloc() or xrealloc(). **/
void *xmalloc_zero(uns) LIKE_MALLOC; /** Allocate memory and fill it by zeroes. **/
#include <stdlib.h>
void *
-xrealloc(void *old, uns size)
+xrealloc(void *old, size_t size)
{
/* We assume that realloc(NULL, x) works like malloc(x), which is true with the glibc. */
void *x = realloc(old, size);
if (!x)
- die("Cannot reallocate %d bytes of memory", size);
+ die("Cannot reallocate %zu bytes of memory", size);
return x;
}