From c8b09d931d56ee14c3aa7814599958c1d68380e3 Mon Sep 17 00:00:00 2001 From: "Liam J. Foy" Date: Wed, 1 Dec 2004 19:44:53 +0000 Subject: [PATCH] - Remove registers from rcorder - Bump WARNS upto 6 while here Submitted by: Steve Mynott --- sbin/rcorder/Makefile | 4 ++-- sbin/rcorder/hash.c | 44 +++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sbin/rcorder/Makefile b/sbin/rcorder/Makefile index 5e774f2c81..9bee013640 100644 --- a/sbin/rcorder/Makefile +++ b/sbin/rcorder/Makefile @@ -1,6 +1,6 @@ # $NetBSD: Makefile,v 1.1 1999/11/23 05:28:20 mrg Exp $ # $FreeBSD: src/sbin/rcorder/Makefile,v 1.3 2002/06/21 15:52:05 obrien Exp $ -# $DragonFly: src/sbin/rcorder/Makefile,v 1.1 2003/07/24 06:35:38 dillon Exp $ +# $DragonFly: src/sbin/rcorder/Makefile,v 1.2 2004/12/01 19:44:53 liamfoy Exp $ PROG= rcorder SRCS= ealloc.c hash.c rcorder.c @@ -9,7 +9,7 @@ MAN= rcorder.8 LDADD+= -lutil DPADD+= ${LIBUTIL} -WARNS= 0 +WARNS= 6 # XXX hack for make's hash.[ch] CFLAGS+= -DORDER -I. diff --git a/sbin/rcorder/hash.c b/sbin/rcorder/hash.c index 6337c54554..910e2fe208 100644 --- a/sbin/rcorder/hash.c +++ b/sbin/rcorder/hash.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * $NetBSD: hash.c,v 1.1.1.1 1999/11/19 04:30:56 mrg Exp $ - * $DragonFly: src/sbin/rcorder/hash.c,v 1.3 2003/11/01 17:16:01 drhodus Exp $ + * $DragonFly: src/sbin/rcorder/hash.c,v 1.4 2004/12/01 19:44:53 liamfoy Exp $ */ #ifdef MAKE_BOOTSTRAP @@ -103,7 +103,7 @@ static void RebuildTable(Hash_Table *); */ /* - * register Hash_Table *t; Structure to use to hold table. + * Hash_Table *t; Structure to use to hold table. * int numBuckets; How many buckets to create for starters. * This number is rounded up to a power of * two. If <= 0, a reasonable default is @@ -111,10 +111,10 @@ static void RebuildTable(Hash_Table *); * as needed. */ void -Hash_InitTable(register Hash_Table *t, int numBuckets) +Hash_InitTable(Hash_Table *t, int numBuckets) { - register int i; - register struct Hash_Entry **hp; + int i; + struct Hash_Entry **hp; /* * Round up the size to a power of two. @@ -154,8 +154,8 @@ Hash_InitTable(register Hash_Table *t, int numBuckets) void Hash_DeleteTable(Hash_Table *t) { - register struct Hash_Entry **hp, *h, *nexth = NULL; - register int i; + struct Hash_Entry **hp, *h, *nexth = NULL; + int i; for (hp = t->bucketPtr, i = t->size; --i >= 0;) { for (h = *hp++; h != NULL; h = nexth) { @@ -193,9 +193,9 @@ Hash_DeleteTable(Hash_Table *t) Hash_Entry * Hash_FindEntry(Hash_Table *t, char *key) { - register Hash_Entry *e; - register unsigned h; - register char *p; + Hash_Entry *e; + unsigned h; + char *p; for (h = 0, p = key; *p;) h = (h << 5) - h + *p++; @@ -226,11 +226,11 @@ Hash_FindEntry(Hash_Table *t, char *key) */ Hash_Entry * -Hash_CreateEntry(register Hash_Table *t, char *key, Boolean *newPtr) +Hash_CreateEntry(Hash_Table *t, char *key, Boolean *newPtr) { - register Hash_Entry *e; - register unsigned h; - register char *p; + Hash_Entry *e; + unsigned h; + char *p; int keylen; struct Hash_Entry **hp; @@ -291,7 +291,7 @@ Hash_CreateEntry(register Hash_Table *t, char *key, Boolean *newPtr) void Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e) { - register Hash_Entry **hp, *p; + Hash_Entry **hp, *p; if (e == NULL) return; @@ -328,7 +328,7 @@ Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e) */ Hash_Entry * -Hash_EnumFirst(Hash_Table *t, register Hash_Search *searchPtr) +Hash_EnumFirst(Hash_Table *t, Hash_Search *searchPtr) { searchPtr->tablePtr = t; searchPtr->nextIndex = 0; @@ -355,9 +355,9 @@ Hash_EnumFirst(Hash_Table *t, register Hash_Search *searchPtr) */ Hash_Entry * -Hash_EnumNext(register Hash_Search *searchPtr) +Hash_EnumNext(Hash_Search *searchPtr) { - register Hash_Entry *e; + Hash_Entry *e; Hash_Table *t = searchPtr->tablePtr; /* @@ -399,11 +399,11 @@ Hash_EnumNext(register Hash_Search *searchPtr) */ static void -RebuildTable(register Hash_Table *t) +RebuildTable(Hash_Table *t) { - register Hash_Entry *e, *next = NULL, **hp, **xp; - register int i, mask; - register Hash_Entry **oldhp; + Hash_Entry *e, *next = NULL, **hp, **xp; + int i, mask; + Hash_Entry **oldhp; int oldsize; oldhp = t->bucketPtr; -- 2.41.0