From: hno <> Date: Wed, 17 Oct 2001 07:36:05 +0000 (+0000) Subject: Make xcalloc() take size_t in both it's arguments. This to match the X-Git-Tag: SQUID_3_0_PRE1~1361 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a7e978a763df939eb3809a31bb5c95d6785e59f;p=thirdparty%2Fsquid.git Make xcalloc() take size_t in both it's arguments. This to match the definition of calloc(). --- diff --git a/include/util.h b/include/util.h index ac5577d364..a2ef5a88c4 100644 --- a/include/util.h +++ b/include/util.h @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.61 2001/10/08 16:18:31 hno Exp $ + * $Id: util.h,v 1.62 2001/10/17 01:36:07 hno Exp $ * * AUTHOR: Harvest Derived * @@ -75,7 +75,7 @@ extern double tvSubDsec(struct timeval, struct timeval); extern char *xstrncpy(char *, const char *, size_t); extern size_t xcountws(const char *str); extern time_t parse_rfc1123(const char *str); -extern void *xcalloc(int, size_t); +extern void *xcalloc(size_t, size_t); extern void *xmalloc(size_t); extern void *xrealloc(void *, size_t); extern void Tolower(char *); diff --git a/lib/util.c b/lib/util.c index abc6b6fd13..f0c1ef2d21 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.79 2001/06/29 14:48:06 hno Exp $ + * $Id: util.c,v 1.80 2001/10/17 01:36:05 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -553,7 +553,7 @@ xrealloc(void *s, size_t sz) * Never returns NULL; fatal on error. */ void * -xcalloc(int n, size_t sz) +xcalloc(size_t n, size_t sz) { void *p; @@ -563,8 +563,8 @@ xcalloc(int n, size_t sz) sz = 1; if ((p = calloc(n, sz)) == NULL) { if (failure_notify) { - snprintf(msg, 128, "xcalloc: Unable to allocate %d blocks of %d bytes!\n", - (int) n, (int) sz); + snprintf(msg, 128, "xcalloc: Unable to allocate %u blocks of %u bytes!\n", + (unsigned int) n, (unsigned int) sz); (*failure_notify) (msg); } else { perror("xcalloc"); @@ -582,7 +582,7 @@ xcalloc(int n, size_t sz) #endif #if MEM_GEN_TRACE if (tracefp) - fprintf(tracefp, "c:%d:%d:%p\n", n, sz, p); + fprintf(tracefp, "c:%u:%u:%p\n", (unsigned int)n, (unsigned int)sz, p); #endif return (p); }