Make all bucket and overflow addresses unsigned
[unix-history] / usr / src / lib / libc / stdlib / calloc.c
index 6aa20e9..6404344 100644 (file)
@@ -1,25 +1,33 @@
-/* @(#)calloc.c        4.2 (Berkeley) %G% */
-
-/*
- * Calloc - allocate and clear memory block
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
  */
  */
-char *
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)calloc.c   5.6 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
+
+#include <stdlib.h>
+#include <string.h>
+
+void *
 calloc(num, size)
 calloc(num, size)
-       register unsigned num, size;
+       size_t num;
+       register size_t size;
 {
 {
-       extern char *malloc();
-       register char *p;
+       register void *p;
 
        size *= num;
        if (p = malloc(size))
                bzero(p, size);
 
        size *= num;
        if (p = malloc(size))
                bzero(p, size);
-       return (p);
+       return(p);
 }
 
 }
 
-cfree(p, num, size)
-       char *p;
-       unsigned num;
-       unsigned size;
+void
+cfree(p)
+       void *p;
 {
 {
-       free(p);
+       (void)free(p);
 }
 }