summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/atexit.c2
-rw-r--r--lib/libc/stdlib/bsearch.c16
-rw-r--r--lib/libc/stdlib/calloc.c6
-rw-r--r--lib/libc/stdlib/exit.c4
-rw-r--r--lib/libc/stdlib/getenv.c10
-rw-r--r--lib/libc/stdlib/getsubopt.c14
-rw-r--r--lib/libc/stdlib/heapsort.c6
-rw-r--r--lib/libc/stdlib/malloc.c2
-rw-r--r--lib/libc/stdlib/merge.c8
-rw-r--r--lib/libc/stdlib/qsort.c6
-rw-r--r--lib/libc/stdlib/radixsort.c16
-rw-r--r--lib/libc/stdlib/random.c22
-rw-r--r--lib/libc/stdlib/setenv.c12
-rw-r--r--lib/libc/stdlib/strhash.c12
14 files changed, 75 insertions, 61 deletions
diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c
index 1416b47..f5b57c4 100644
--- a/lib/libc/stdlib/atexit.c
+++ b/lib/libc/stdlib/atexit.c
@@ -65,7 +65,7 @@ atexit(fn)
void (*fn)();
{
static struct atexit __atexit0; /* one guaranteed table */
- register struct atexit *p;
+ struct atexit *p;
_MUTEX_LOCK(&atexit_mutex);
if ((p = __atexit) == NULL)
diff --git a/lib/libc/stdlib/bsearch.c b/lib/libc/stdlib/bsearch.c
index 4cee9de..5ee24bc 100644
--- a/lib/libc/stdlib/bsearch.c
+++ b/lib/libc/stdlib/bsearch.c
@@ -34,6 +34,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)bsearch.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <stddef.h>
#include <stdlib.h>
@@ -56,16 +58,16 @@ static char sccsid[] = "@(#)bsearch.c 8.1 (Berkeley) 6/4/93";
*/
void *
bsearch(key, base0, nmemb, size, compar)
- register const void *key;
+ const void *key;
const void *base0;
size_t nmemb;
- register size_t size;
- register int (*compar) __P((const void *, const void *));
+ size_t size;
+ int (*compar) __P((const void *, const void *));
{
- register const char *base = base0;
- register size_t lim;
- register int cmp;
- register const void *p;
+ const char *base = base0;
+ size_t lim;
+ int cmp;
+ const void *p;
for (lim = nmemb; lim != 0; lim >>= 1) {
p = base + (lim >> 1) * size;
diff --git a/lib/libc/stdlib/calloc.c b/lib/libc/stdlib/calloc.c
index 7a83603..ced9273 100644
--- a/lib/libc/stdlib/calloc.c
+++ b/lib/libc/stdlib/calloc.c
@@ -34,6 +34,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)calloc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
@@ -41,9 +43,9 @@ static char sccsid[] = "@(#)calloc.c 8.1 (Berkeley) 6/4/93";
void *
calloc(num, size)
size_t num;
- register size_t size;
+ size_t size;
{
- register void *p;
+ void *p;
size *= num;
if ( (p = malloc(size)) )
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index 32f51d4..8ed5844 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -61,8 +61,8 @@ void
exit(status)
int status;
{
- register struct atexit *p;
- register int n;
+ struct atexit *p;
+ int n;
/* Ensure that the auto-initialization routine is linked in: */
extern int _thread_autoinit_dummy_decl;
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
index a6bbd35..24683f3 100644
--- a/lib/libc/stdlib/getenv.c
+++ b/lib/libc/stdlib/getenv.c
@@ -34,6 +34,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getenv.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <stddef.h>
@@ -52,13 +54,13 @@ inline char *__findenv __P((const char *, int *));
*/
inline char *
__findenv(name, offset)
- register const char *name;
+ const char *name;
int *offset;
{
extern char **environ;
- register int len, i;
- register const char *np;
- register char **p, *cp;
+ int len, i;
+ const char *np;
+ char **p, *cp;
if (name == NULL || environ == NULL)
return (NULL);
diff --git a/lib/libc/stdlib/getsubopt.c b/lib/libc/stdlib/getsubopt.c
index bc055b8..c27bcf6 100644
--- a/lib/libc/stdlib/getsubopt.c
+++ b/lib/libc/stdlib/getsubopt.c
@@ -31,9 +31,11 @@
* SUCH DAMAGE.
*/
-#ifndef lint
+#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getsubopt.c 8.1 (Berkeley) 6/4/93";
-#endif /* not lint */
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <unistd.h>
#include <stdlib.h>
@@ -48,11 +50,11 @@ char *suboptarg;
int
getsubopt(optionp, tokens, valuep)
- register char **optionp, **valuep;
- register char * const *tokens;
+ char **optionp, **valuep;
+ char * const *tokens;
{
- register int cnt;
- register char *p;
+ int cnt;
+ char *p;
suboptarg = *valuep = NULL;
diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c
index 9649553..89e9592 100644
--- a/lib/libc/stdlib/heapsort.c
+++ b/lib/libc/stdlib/heapsort.c
@@ -37,6 +37,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)heapsort.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <errno.h>
#include <stddef.h>
@@ -143,8 +145,8 @@ heapsort(vbase, nmemb, size, compar)
size_t nmemb, size;
int (*compar) __P((const void *, const void *));
{
- register int cnt, i, j, l;
- register char tmp, *tmp1, *tmp2;
+ int cnt, i, j, l;
+ char tmp, *tmp1, *tmp2;
char *base, *k, *p, *t;
if (nmemb <= 1)
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 2b8d807..7998acc 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1084,7 +1084,7 @@ ifree(void *ptr)
void *
malloc(size_t size)
{
- register void *r;
+ void *r;
THREAD_LOCK();
malloc_func = " in malloc():";
diff --git a/lib/libc/stdlib/merge.c b/lib/libc/stdlib/merge.c
index 083a964..2fb1f3a 100644
--- a/lib/libc/stdlib/merge.c
+++ b/lib/libc/stdlib/merge.c
@@ -37,6 +37,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* Hybrid exponential search/linear search merge sort with hybrid
@@ -98,12 +100,12 @@ int
mergesort(base, nmemb, size, cmp)
void *base;
size_t nmemb;
- register size_t size;
+ size_t size;
int (*cmp) __P((const void *, const void *));
{
- register int i, sense;
+ int i, sense;
int big, iflag;
- register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
+ u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
u_char *list2, *list1, *p2, *p, *last, **p1;
if (size < PSIZE / 2) { /* Pointers must fit into 2 * size. */
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index 8adb714..71d9dc9 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -52,10 +52,10 @@ static inline void swapfunc __P((char *, char *, int, int));
*/
#define swapcode(TYPE, parmi, parmj, n) { \
long i = (n) / sizeof (TYPE); \
- register TYPE *pi = (TYPE *) (parmi); \
- register TYPE *pj = (TYPE *) (parmj); \
+ TYPE *pi = (TYPE *) (parmi); \
+ TYPE *pj = (TYPE *) (parmj); \
do { \
- register TYPE t = *pi; \
+ TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
} while (--i > 0); \
diff --git a/lib/libc/stdlib/radixsort.c b/lib/libc/stdlib/radixsort.c
index 0a583ac..873c7ec 100644
--- a/lib/libc/stdlib/radixsort.c
+++ b/lib/libc/stdlib/radixsort.c
@@ -37,6 +37,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)radixsort.c 8.2 (Berkeley) 4/28/95";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* Radixsort routines.
@@ -140,8 +142,8 @@ r_sort_a(a, n, i, tr, endch)
u_int endch;
{
static int count[256], nc, bmin;
- register int c;
- register const u_char **ak, *r;
+ int c;
+ const u_char **ak, *r;
stack s[SIZE], *sp, *sp0, *sp1, temp;
int *cp, bigc;
const u_char **an, *t, **aj, **top[256];
@@ -231,8 +233,8 @@ r_sort_b(a, ta, n, i, tr, endch)
u_int endch;
{
static int count[256], nc, bmin;
- register int c;
- register const u_char **ak, **ai;
+ int c;
+ const u_char **ak, **ai;
stack s[512], *sp, *sp0, *sp1, temp;
const u_char **top[256];
int *cp, bigc;
@@ -297,12 +299,12 @@ r_sort_b(a, ta, n, i, tr, endch)
static inline void
simplesort(a, n, b, tr, endch) /* insertion sort */
- register const u_char **a;
+ const u_char **a;
int n, b;
- register const u_char *tr;
+ const u_char *tr;
u_int endch;
{
- register u_char ch;
+ u_char ch;
const u_char **ak, **ai, *s, *t;
for (ak = a+1; --n >= 1; ak++)
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c
index df5154e..be12368 100644
--- a/lib/libc/stdlib/random.c
+++ b/lib/libc/stdlib/random.c
@@ -81,7 +81,7 @@ static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
* period of the generator is approximately deg*(2**deg - 1); thus doubling
* the amount of state information has a vast influence on the period of the
* generator. Note: the deg*(2**deg - 1) is an approximation only good for
- * large deg, when the period of the shift register is the dominant factor.
+ * large deg, when the period of the shift is the dominant factor.
* With deg equal to seven, the period is actually much longer than the
* 7*(2**7 - 1) predicted by this formula.
*
@@ -217,7 +217,7 @@ static long *end_ptr = &randtbl[DEG_3 + 1];
static inline long good_rand __P((long));
static inline long good_rand (x)
- register long x;
+ long x;
{
#ifdef USE_WEAK_SEEDING
/*
@@ -235,7 +235,7 @@ static inline long good_rand (x)
* Park and Miller, Communications of the ACM, vol. 31, no. 10,
* October 1988, p. 1195.
*/
- register long hi, lo;
+ long hi, lo;
hi = x / 127773;
lo = x % 127773;
@@ -262,7 +262,7 @@ void
srandom(x)
unsigned long x;
{
- register long i;
+ long i;
if (rand_type == TYPE_0)
state[0] = x;
@@ -351,8 +351,8 @@ initstate(seed, arg_state, n)
char *arg_state; /* pointer to state array */
long n; /* # bytes of state info */
{
- register char *ostate = (char *)(&state[-1]);
- register long *long_arg_state = (long *) arg_state;
+ char *ostate = (char *)(&state[-1]);
+ long *long_arg_state = (long *) arg_state;
if (rand_type == TYPE_0)
state[-1] = rand_type;
@@ -417,9 +417,9 @@ char *
setstate(arg_state)
char *arg_state; /* pointer to state array */
{
- register long *new_state = (long *) arg_state;
- register long type = new_state[0] % MAX_TYPES;
- register long rear = new_state[0] / MAX_TYPES;
+ long *new_state = (long *) arg_state;
+ long type = new_state[0] % MAX_TYPES;
+ long rear = new_state[0] / MAX_TYPES;
char *ostate = (char *)(&state[-1]);
if (rand_type == TYPE_0)
@@ -469,8 +469,8 @@ setstate(arg_state)
long
random()
{
- register long i;
- register long *f, *r;
+ long i;
+ long *f, *r;
if (rand_type == TYPE_0) {
i = state[0];
diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c
index cd82c0d..ef10810 100644
--- a/lib/libc/stdlib/setenv.c
+++ b/lib/libc/stdlib/setenv.c
@@ -51,13 +51,13 @@ char *__findenv __P((const char *, int *));
*/
int
setenv(name, value, rewrite)
- register const char *name;
- register const char *value;
+ const char *name;
+ const char *value;
int rewrite;
{
extern char **environ;
static char **alloced; /* if allocated space before */
- register char *c;
+ char *c;
int l_value, offset;
if (*value == '=') /* no `=' in value */
@@ -71,8 +71,8 @@ setenv(name, value, rewrite)
return (0);
}
} else { /* create new slot */
- register int cnt;
- register char **p;
+ int cnt;
+ char **p;
for (p = environ, cnt = 0; *p; ++p, ++cnt);
if (alloced == environ) { /* just increase size */
@@ -111,7 +111,7 @@ unsetenv(name)
const char *name;
{
extern char **environ;
- register char **p;
+ char **p;
int offset;
while (__findenv(name, &offset)) /* if set multiple times */
diff --git a/lib/libc/stdlib/strhash.c b/lib/libc/stdlib/strhash.c
index 8de4f3f..8da9064 100644
--- a/lib/libc/stdlib/strhash.c
+++ b/lib/libc/stdlib/strhash.c
@@ -100,7 +100,7 @@ static hash_node *list_find(caddr_t key, hash_node *head);
hash_table *
hash_create(int size)
{
- register int i;
+ int i;
hash_table *new = (hash_table *)malloc(sizeof(hash_table));
if (!new || size < 0){
@@ -293,8 +293,8 @@ assign_key(char *key, hash_node *node)
void
hash_traverse(hash_table *table, int (*func)(), void *arg)
{
- register int i;
- register int size = table->size;
+ int i;
+ int size = table->size;
if (!func)
return;
@@ -320,8 +320,8 @@ hash_traverse(hash_table *table, int (*func)(), void *arg)
void
hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2))
{
- register int i;
- register int size = table->size;
+ int i;
+ int size = table->size;
for (i = 0; i < size; i++) {
hash_node *n = table->buckets[i];
@@ -350,7 +350,7 @@ hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2))
void
hash_stats(hash_table *table, int verbose)
{
- register int i;
+ int i;
int total_elements = 0;
int non_empty_buckets = 0;
int max_count = 0;
OpenPOWER on IntegriCloud