diff --git a/src/lib/libc/stdlib/getenv.c b/src/lib/libc/stdlib/getenv.c index 09d47f21..d1487a7a 100644 --- a/src/lib/libc/stdlib/getenv.c +++ b/src/lib/libc/stdlib/getenv.c @@ -33,26 +33,12 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)getenv.c 5.8 (Berkeley) 2/23/91";*/ -static char *rcsid = "$Id: getenv.c,v 1.1.1.1 1995/10/18 08:42:17 deraadt Exp $"; +static char *rcsid = "$Id: getenv.c,v 1.2 1996/03/25 22:16:38 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include -/* - * getenv -- - * Returns ptr to value associated with name, if any, else NULL. - */ -char * -getenv(name) - const char *name; -{ - int offset; - char *__findenv(); - - return(__findenv(name, &offset)); -} - /* * __findenv -- * Returns pointer to value associated with name, if any, else NULL. @@ -64,14 +50,15 @@ getenv(name) */ char * __findenv(name, offset) - register char *name; + register const char *name; int *offset; { extern char **environ; register int len; register char **P, *C; + register const char *cp; - for (C = name, len = 0; *C && *C != '='; ++C, ++len); + for (cp = name, len = 0; *cp != '\0' && *cp != '='; ++cp, ++len); for (P = environ; *P; ++P) if (!strncmp(*P, name, len)) if (*(C = *P + len) == '=') { @@ -80,3 +67,17 @@ __findenv(name, offset) } return(NULL); } + +/* + * getenv -- + * Returns ptr to value associated with name, if any, else NULL. + */ +char * +getenv(name) + const char *name; +{ + int offset; + char *__findenv(); + + return(__findenv(name, &offset)); +} diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 4498a9fb..612759d9 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -59,9 +59,6 @@ static char *rcsid = "$NetBSD: malloc.c,v 1.6 1996/01/17 02:45:25 jtc Exp $"; #define NULL 0 -static void morecore(); -static int findbucket(); - /* * The overhead on a block is at least 4 bytes. When free, this space * contains a pointer to the next free block, and the bottom two bits must @@ -88,6 +85,9 @@ union overhead { #define ov_size ovu.ovu_size }; +static void morecore __P((int)); +static int findbucket __P((union overhead *, int)); + #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ diff --git a/src/lib/libc/stdlib/qsort.c b/src/lib/libc/stdlib/qsort.c index c06bd540..fe757b93 100644 --- a/src/lib/libc/stdlib/qsort.c +++ b/src/lib/libc/stdlib/qsort.c @@ -33,14 +33,14 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char sccsid[] = "from: @(#)qsort.c 8.1 (Berkeley) 6/4/93";*/ -static char *rcsid = "$Id: qsort.c,v 1.1.1.1 1995/10/18 08:42:18 deraadt Exp $"; +static char *rcsid = "$Id: qsort.c,v 1.2 1996/03/25 22:16:40 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include -static inline char *med3 __P((char *, char *, char *, int (*)())); -static inline void swapfunc __P((char *, char *, int, int)); +static __inline char *med3 __P((char *, char *, char *, int (*)())); +static __inline void swapfunc __P((char *, char *, int, int)); #define min(a, b) (a) < (b) ? a : b @@ -61,7 +61,7 @@ static inline void swapfunc __P((char *, char *, int, int)); #define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; -static inline void +static __inline void swapfunc(a, b, n, swaptype) char *a, *b; int n, swaptype; @@ -82,7 +82,7 @@ swapfunc(a, b, n, swaptype) #define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) -static inline char * +static __inline char * med3(a, b, c, cmp) char *a, *b, *c; int (*cmp)(); diff --git a/src/lib/libc/stdlib/radixsort.c b/src/lib/libc/stdlib/radixsort.c index dd51013c..d571c8f3 100644 --- a/src/lib/libc/stdlib/radixsort.c +++ b/src/lib/libc/stdlib/radixsort.c @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char sccsid[] = "from: @(#)radixsort.c 8.1 (Berkeley) 6/4/93";*/ -static char *rcsid = "$Id: radixsort.c,v 1.1.1.1 1995/10/18 08:42:19 deraadt Exp $"; +static char *rcsid = "$Id: radixsort.c,v 1.2 1996/03/25 22:16:39 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -61,7 +61,7 @@ typedef struct { int sn, si; } stack; -static inline void simplesort +static __inline void simplesort __P((const u_char **, int, int, const u_char *, u_int)); static void r_sort_a __P((const u_char **, int, int, const u_char *, u_int)); static void r_sort_b __P((const u_char **, @@ -295,7 +295,7 @@ r_sort_b(a, ta, n, i, tr, endch) } } -static inline void +static __inline void simplesort(a, n, b, tr, endch) /* insertion sort */ register const u_char **a; int n, b;