summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-07-04 18:40:14 +0000
committerriastradh <riastradh@NetBSD.org>2023-07-04 18:40:14 +0000
commitef004cbae1c7ccd037b8d815e11f05c7bee6d727 (patch)
treecff2d2ec5c770ed8fb57c5760a26c586deb30bae /lib
parent08b3ba2045319f41ea875f35e81ffe63b89ae590 (diff)
libbsdmalloc: Nix K&R definitions. Bump WARNS to 3.
Diffstat (limited to 'lib')
-rw-r--r--lib/libbsdmalloc/Makefile4
-rw-r--r--lib/libbsdmalloc/malloc.c24
2 files changed, 10 insertions, 18 deletions
diff --git a/lib/libbsdmalloc/Makefile b/lib/libbsdmalloc/Makefile
index ca0fb9979f7..fd09ffa60bd 100644
--- a/lib/libbsdmalloc/Makefile
+++ b/lib/libbsdmalloc/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.6 2023/07/04 16:23:15 riastradh Exp $
+# $NetBSD: Makefile,v 1.7 2023/07/04 18:40:14 riastradh Exp $
-WARNS= 2
+WARNS= 3
.include <bsd.own.mk>
diff --git a/lib/libbsdmalloc/malloc.c b/lib/libbsdmalloc/malloc.c
index d401bee85f7..8b830b6f4df 100644
--- a/lib/libbsdmalloc/malloc.c
+++ b/lib/libbsdmalloc/malloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: malloc.c,v 1.4 2023/07/04 15:09:04 riastradh Exp $ */
+/* $NetBSD: malloc.c,v 1.5 2023/07/04 18:40:14 riastradh Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)malloc.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: malloc.c,v 1.4 2023/07/04 15:09:04 riastradh Exp $");
+__RCSID("$NetBSD: malloc.c,v 1.5 2023/07/04 18:40:14 riastradh Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -176,8 +176,7 @@ botch(s)
#endif
void *
-malloc(nbytes)
- size_t nbytes;
+malloc(size_t nbytes)
{
union overhead *op;
int bucket;
@@ -270,8 +269,7 @@ malloc(nbytes)
* Allocate more memory to the indicated bucket.
*/
static void
-morecore(bucket)
- int bucket;
+morecore(int bucket)
{
union overhead *op;
long sz; /* size of desired block */
@@ -313,8 +311,7 @@ morecore(bucket)
}
void
-free(cp)
- void *cp;
+free(void *cp)
{
long size;
union overhead *op;
@@ -357,9 +354,7 @@ free(cp)
int __realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */
void *
-realloc(cp, nbytes)
- void *cp;
- size_t nbytes;
+realloc(void *cp, size_t nbytes)
{
u_long onb;
long i;
@@ -448,9 +443,7 @@ realloc(cp, nbytes)
* Return bucket number, or -1 if not found.
*/
static int
-findbucket(freep, srchlen)
- union overhead *freep;
- int srchlen;
+findbucket(union overhead *freep, int srchlen)
{
union overhead *p;
int i, j;
@@ -475,8 +468,7 @@ findbucket(freep, srchlen)
* frees for each size category.
*/
void
-mstats(s)
- char *s;
+mstats(char *s)
{
int i, j;
union overhead *p;