Re: register removal from /usr/src/sbin/rcorder/hash.c

看板DFBSD_submit作者時間21年前 (2004/12/02 04:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/7 (看更多)
patch attempt 2 (correct way around) --- hash.c.bak 2004-12-01 19:28:32.000000000 +0000 +++ hash.c 2004-12-01 19:28:41.000000000 +0000 @@ -103,7 +103,7 @@ */ /* - * 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 r ounded up to a power of * two. If <= 0, a reasonable default is @@ -111,10 +111,10 @@ * 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 @@ 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_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_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 @@ 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_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_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 @@ */ 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;
文章代碼(AID): #11hYC400 (DFBSD_submit)
討論串 (同標題文章)
文章代碼(AID): #11hYC400 (DFBSD_submit)