summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjfb <>2003-08-04 16:51:49 +0000
committerjfb <>2003-08-04 16:51:49 +0000
commit846bdf59cc19d7049d903acfc3dd5cd50a11b84b (patch)
treebcdf0650da3ee5139db9b499133a5842d00d42f5 /src
parent8aec880e628f94a8e6893d2f9e075504342db194 (diff)
downloadopenbsd-846bdf59cc19d7049d903acfc3dd5cd50a11b84b.tar.gz
openbsd-846bdf59cc19d7049d903acfc3dd5cd50a11b84b.tar.bz2
openbsd-846bdf59cc19d7049d903acfc3dd5cd50a11b84b.zip
ansify function arguments
ok tdeval@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/malloc.c50
1 files changed, 16 insertions, 34 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index 9d73ab021d..85a95652e0 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#if defined(LIBC_SCCS) && !defined(lint) 10#if defined(LIBC_SCCS) && !defined(lint)
11static char rcsid[] = "$OpenBSD: malloc.c,v 1.58 2003/07/19 23:52:27 tdeval Exp $"; 11static char rcsid[] = "$OpenBSD: malloc.c,v 1.59 2003/08/04 16:51:49 jfb Exp $";
12#endif /* LIBC_SCCS and not lint */ 12#endif /* LIBC_SCCS and not lint */
13 13
14/* 14/*
@@ -250,8 +250,7 @@ static void *malloc_bytes(size_t size);
250 250
251#ifdef MALLOC_STATS 251#ifdef MALLOC_STATS
252void 252void
253malloc_dump(fd) 253malloc_dump(FILE *fd)
254 FILE *fd;
255{ 254{
256 struct pginfo **pd; 255 struct pginfo **pd;
257 struct pgfree *pf; 256 struct pgfree *pf;
@@ -310,8 +309,7 @@ malloc_dump(fd)
310extern char *__progname; 309extern char *__progname;
311 310
312static void 311static void
313wrterror(p) 312wrterror(char *p)
314 char *p;
315{ 313{
316 char *q = " error: "; 314 char *q = " error: ";
317 struct iovec iov[4]; 315 struct iovec iov[4];
@@ -335,8 +333,7 @@ wrterror(p)
335} 333}
336 334
337static void 335static void
338wrtwarning(p) 336wrtwarning(char *p)
339 char *p;
340{ 337{
341 char *q = " warning: "; 338 char *q = " warning: ";
342 struct iovec iov[4]; 339 struct iovec iov[4];
@@ -359,7 +356,7 @@ wrtwarning(p)
359 356
360#ifdef MALLOC_STATS 357#ifdef MALLOC_STATS
361static void 358static void
362malloc_exit() 359malloc_exit(void)
363{ 360{
364 FILE *fd = fopen("malloc.out", "a"); 361 FILE *fd = fopen("malloc.out", "a");
365 char *q = "malloc() warning: Couldn't dump stats.\n"; 362 char *q = "malloc() warning: Couldn't dump stats.\n";
@@ -376,8 +373,7 @@ malloc_exit()
376 * Allocate a number of pages from the OS 373 * Allocate a number of pages from the OS
377 */ 374 */
378static void * 375static void *
379map_pages(pages) 376map_pages(size_t pages)
380 size_t pages;
381{ 377{
382 caddr_t result, tail; 378 caddr_t result, tail;
383 379
@@ -412,8 +408,7 @@ map_pages(pages)
412 * Extend page directory 408 * Extend page directory
413 */ 409 */
414static int 410static int
415extend_pgdir(index) 411extend_pgdir(u_long index)
416 u_long index;
417{ 412{
418 struct pginfo **new, **old; 413 struct pginfo **new, **old;
419 size_t i, oldlen; 414 size_t i, oldlen;
@@ -466,7 +461,7 @@ extend_pgdir(index)
466 * Initialize the world 461 * Initialize the world
467 */ 462 */
468static void 463static void
469malloc_init () 464malloc_init(void)
470{ 465{
471 char *p, b[64]; 466 char *p, b[64];
472 int i, j; 467 int i, j;
@@ -584,8 +579,7 @@ malloc_init ()
584 * Allocate a number of complete pages 579 * Allocate a number of complete pages
585 */ 580 */
586static void * 581static void *
587malloc_pages(size) 582malloc_pages(size_t size)
588 size_t size;
589{ 583{
590 void *p, *delay_free = NULL; 584 void *p, *delay_free = NULL;
591 int i; 585 int i;
@@ -670,8 +664,7 @@ malloc_pages(size)
670 */ 664 */
671 665
672static __inline__ int 666static __inline__ int
673malloc_make_chunks(bits) 667malloc_make_chunks(int bits)
674 int bits;
675{ 668{
676 struct pginfo *bp; 669 struct pginfo *bp;
677 void *pp; 670 void *pp;
@@ -765,8 +758,7 @@ malloc_make_chunks(bits)
765 * Allocate a fragment 758 * Allocate a fragment
766 */ 759 */
767static void * 760static void *
768malloc_bytes(size) 761malloc_bytes(size_t size)
769 size_t size;
770{ 762{
771 int i,j; 763 int i,j;
772 u_long u; 764 u_long u;
@@ -828,8 +820,7 @@ malloc_bytes(size)
828 * Allocate a piece of memory 820 * Allocate a piece of memory
829 */ 821 */
830static void * 822static void *
831imalloc(size) 823imalloc(size_t size)
832 size_t size;
833{ 824{
834 void *result; 825 void *result;
835 826
@@ -861,9 +852,7 @@ imalloc(size)
861 * Change the size of an allocation. 852 * Change the size of an allocation.
862 */ 853 */
863static void * 854static void *
864irealloc(ptr, size) 855irealloc(void *ptr, size_t size)
865 void *ptr;
866 size_t size;
867{ 856{
868 void *p; 857 void *p;
869 u_long osize, index; 858 u_long osize, index;
@@ -966,10 +955,7 @@ irealloc(ptr, size)
966 */ 955 */
967 956
968static __inline__ void 957static __inline__ void
969free_pages(ptr, index, info) 958free_pages(void *ptr, int index, struct pginfo *info)
970 void *ptr;
971 int index;
972 struct pginfo *info;
973{ 959{
974 int i; 960 int i;
975 struct pgfree *pf, *pt=NULL; 961 struct pgfree *pf, *pt=NULL;
@@ -1104,10 +1090,7 @@ free_pages(ptr, index, info)
1104 1090
1105/* ARGSUSED */ 1091/* ARGSUSED */
1106static __inline__ void 1092static __inline__ void
1107free_bytes(ptr, index, info) 1093free_bytes(void *ptr, int index, struct pginfo *info)
1108 void *ptr;
1109 int index;
1110 struct pginfo *info;
1111{ 1094{
1112 int i; 1095 int i;
1113 struct pginfo **mp; 1096 struct pginfo **mp;
@@ -1178,8 +1161,7 @@ free_bytes(ptr, index, info)
1178} 1161}
1179 1162
1180static void 1163static void
1181ifree(ptr) 1164ifree(void *ptr)
1182 void *ptr;
1183{ 1165{
1184 struct pginfo *info; 1166 struct pginfo *info;
1185 int index; 1167 int index;