X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fcalloc.c;h=f4bd27b1cd2a460c89c1e5ba2e3e94190db98c85;hb=2f91880f3afb3cc521111dfcc99b214c77aa97a1;hp=c8c0a78a7a131a2e3d2f052e7d2107a455397c2a;hpb=252b5132c753830d5fd56823373aed85f2a0db63;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/calloc.c b/libiberty/calloc.c index c8c0a78a7a..f4bd27b1cd 100644 --- a/libiberty/calloc.c +++ b/libiberty/calloc.c @@ -1,18 +1,26 @@ -#include "ansidecl.h" -#include "libiberty.h" +/* calloc -- allocate memory which has been initialized to zero. + This function is in the public domain. */ + +/* + +@deftypefn Supplemental void* calloc (size_t @var{nelem}, size_t @var{elsize}) + +Uses @code{malloc} to allocate storage for @var{nelem} objects of +@var{elsize} bytes each, then zeros the memory. + +@end deftypefn + +*/ -#ifdef ANSI_PROTOTYPES +#include "ansidecl.h" #include -#else -#define size_t unsigned long -#endif /* For systems with larger pointers than ints, this must be declared. */ -PTR malloc PARAMS ((size_t)); +PTR malloc (size_t); +void bzero (PTR, size_t); PTR -calloc (nelem, elsize) - size_t nelem, elsize; +calloc (size_t nelem, size_t elsize) { register PTR ptr;