X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fxalloc.h;h=8668e198b7222b773a7e48573cccd05ed88e2bd2;hb=a46cc0f8b755cec78b27aa4fb8224d5f479582be;hp=c9bbb13862c7175d4a9737a33a98d25ec710f9d3;hpb=e5534304172dd2dd7340d565dc55cc68ad1fb288;p=gnulib.git diff --git a/lib/xalloc.h b/lib/xalloc.h index c9bbb1386..8668e198b 100644 --- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -61,10 +61,10 @@ void *xcalloc PARAMS ((size_t n, size_t s)); void *xrealloc PARAMS ((void *p, size_t n)); char *xstrdup PARAMS ((const char *str)); -# define XMALLOC(Type, N_bytes) ((Type *) xmalloc (sizeof (Type) * (N_bytes))) -# define XCALLOC(Type, N_bytes) ((Type *) xcalloc (sizeof (Type), (N_bytes))) -# define XREALLOC(Ptr, Type, N_bytes) \ - ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_bytes))) +# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) +# define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items))) +# define XREALLOC(Ptr, Type, N_items) \ + ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) /* Declare and alloc memory for VAR of type TYPE. */ # define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1)