Make all bucket and overflow addresses unsigned
[unix-history] / usr / src / lib / libc / stdlib / calloc.c
index 3c28afa..6404344 100644 (file)
@@ -1,27 +1,33 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ */
+
 #if defined(LIBC_SCCS) && !defined(lint)
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)calloc.c   5.2 (Berkeley) %G%";
-#endif LIBC_SCCS and not lint
+static char sccsid[] = "@(#)calloc.c   5.6 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
 
 
-/*
- * Calloc - allocate and clear memory block
- */
-char *
+#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);
 }
 }