]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make xcalloc() take size_t in both it's arguments. This to match the
authorhno <>
Wed, 17 Oct 2001 07:36:05 +0000 (07:36 +0000)
committerhno <>
Wed, 17 Oct 2001 07:36:05 +0000 (07:36 +0000)
definition of calloc().

include/util.h
lib/util.c

index ac5577d36450ad89dde4bb1a9a60dfbce906a9d4..a2ef5a88c4d0c71ec426979a8548638d6e82cf0e 100644 (file)
@@ -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 *);
index abc6b6fd136640f0df8f9952310b201424d4a42a..f0c1ef2d216fbcc08e6da85b81d08ccdb8d0e019 100644 (file)
@@ -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);
 }