diff options
author | obrien <obrien@FreeBSD.org> | 2002-03-21 18:49:23 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-03-21 18:49:23 +0000 |
commit | 1196344bb37334ed0f8808056a53ca058758843c (patch) | |
tree | 12b252b7426e8a8904ef257bea10fea6038142f4 /lib/libc/db/hash | |
parent | 8ee1755c8ef3729bb2d3c4bfae2b85b786fdaf70 (diff) | |
download | FreeBSD-src-1196344bb37334ed0f8808056a53ca058758843c.zip FreeBSD-src-1196344bb37334ed0f8808056a53ca058758843c.tar.gz |
Remove 'register' keyword.
Diffstat (limited to 'lib/libc/db/hash')
-rw-r--r-- | lib/libc/db/hash/hash.c | 24 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_bigkey.c | 18 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_buf.c | 16 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_func.c | 30 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_log2.c | 4 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_page.c | 58 |
6 files changed, 78 insertions, 72 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 34fe4ad..cb69744 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -32,13 +32,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include "namespace.h" #include <sys/param.h> @@ -358,7 +358,7 @@ init_htab(hashp, nelem) HTAB *hashp; int nelem; { - register int nbuckets, nsegs; + int nbuckets, nsegs; int l2; /* @@ -605,11 +605,11 @@ hash_access(hashp, action, key, val) ACTION action; DBT *key, *val; { - register BUFHEAD *rbufp; + BUFHEAD *rbufp; BUFHEAD *bufp, *save_bufp; - register u_int16_t *bp; - register int n, ndx, off, size; - register char *kp; + u_int16_t *bp; + int n, ndx, off, size; + char *kp; u_int16_t pageno; #ifdef HASH_STATISTICS @@ -734,8 +734,8 @@ hash_seq(dbp, key, data, flag) DBT *key, *data; u_int32_t flag; { - register u_int32_t bucket; - register BUFHEAD *bufp; + u_int32_t bucket; + BUFHEAD *bufp; HTAB *hashp; u_int16_t *bp, ndx; @@ -878,7 +878,7 @@ hash_realloc(p_ptr, oldsize, newsize) SEGMENT **p_ptr; int oldsize, newsize; { - register void *p; + void *p; if ( (p = malloc(newsize)) ) { memmove(p, *p_ptr, oldsize); @@ -914,8 +914,8 @@ alloc_segs(hashp, nsegs) HTAB *hashp; int nsegs; { - register int i; - register SEGMENT store; + int i; + SEGMENT store; int save_errno; diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c index 0cee07e..f49e77f 100644 --- a/lib/libc/db/hash/hash_bigkey.c +++ b/lib/libc/db/hash/hash_bigkey.c @@ -37,6 +37,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); /* * PACKAGE: hash @@ -90,7 +92,7 @@ __big_insert(hashp, bufp, key, val) BUFHEAD *bufp; const DBT *key, *val; { - register u_int16_t *p; + u_int16_t *p; int key_size, n, val_size; u_int16_t space, move_bytes, off; char *cp, *key_data, *val_data; @@ -188,7 +190,7 @@ __big_delete(hashp, bufp) HTAB *hashp; BUFHEAD *bufp; { - register BUFHEAD *last_bfp, *rbufp; + BUFHEAD *last_bfp, *rbufp; u_int16_t *bp, pageno; int key_done, n; @@ -270,8 +272,8 @@ __find_bigpair(hashp, bufp, ndx, key, size) char *key; int size; { - register u_int16_t *bp; - register char *p; + u_int16_t *bp; + char *p; int ksize; u_int16_t bytes; char *kkey; @@ -452,8 +454,8 @@ collect_data(hashp, bufp, len, set) BUFHEAD *bufp; int len, set; { - register u_int16_t *bp; - register char *p; + u_int16_t *bp; + char *p; BUFHEAD *xbp; u_int16_t save_addr; int mylen, totlen; @@ -576,8 +578,8 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret) u_int32_t obucket;/* Old Bucket */ SPLIT_RETURN *ret; { - register BUFHEAD *tmpp; - register u_int16_t *tp; + BUFHEAD *tmpp; + u_int16_t *tp; BUFHEAD *bp; DBT key, val; u_int32_t change; diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c index afa9164..401b682 100644 --- a/lib/libc/db/hash/hash_buf.c +++ b/lib/libc/db/hash/hash_buf.c @@ -32,13 +32,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); /* * PACKAGE: hash @@ -109,9 +109,9 @@ __get_buf(hashp, addr, prev_bp, newpage) BUFHEAD *prev_bp; int newpage; /* If prev_bp set, indicates a new overflow page. */ { - register BUFHEAD *bp; - register u_int32_t is_disk_mask; - register int is_disk, segment_ndx; + BUFHEAD *bp; + u_int32_t is_disk_mask; + int is_disk, segment_ndx; SEGMENT segp; is_disk = 0; @@ -163,9 +163,9 @@ newbuf(hashp, addr, prev_bp) u_int32_t addr; BUFHEAD *prev_bp; { - register BUFHEAD *bp; /* The buffer we're going to use */ - register BUFHEAD *xbp; /* Temp pointer */ - register BUFHEAD *next_xbp; + BUFHEAD *bp; /* The buffer we're going to use */ + BUFHEAD *xbp; /* Temp pointer */ + BUFHEAD *next_xbp; SEGMENT segp; int segment_ndx; u_int16_t oaddr, *shortp; diff --git a/lib/libc/db/hash/hash_func.c b/lib/libc/db/hash/hash_func.c index a5ec434..d7f84bb 100644 --- a/lib/libc/db/hash/hash_func.c +++ b/lib/libc/db/hash/hash_func.c @@ -37,6 +37,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)hash_func.c 8.2 (Berkeley) 2/21/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/types.h> @@ -68,10 +70,10 @@ u_int32_t (*__default_hash) __P((const void *, size_t)) = hash4; static u_int32_t hash1(keyarg, len) const void *keyarg; - register size_t len; + size_t len; { - register const u_char *key; - register u_int32_t h; + const u_char *key; + u_int32_t h; /* Convert string to integer */ for (key = keyarg, h = 0; len--;) @@ -90,9 +92,9 @@ hash2(keyarg, len) const void *keyarg; size_t len; { - register const u_char *e, *key; - register u_int32_t h; - register u_char c; + const u_char *e, *key; + u_int32_t h; + u_char c; key = keyarg; e = key + len; @@ -117,11 +119,11 @@ hash2(keyarg, len) static u_int32_t hash3(keyarg, len) const void *keyarg; - register size_t len; + size_t len; { - register const u_char *key; - register size_t loop; - register u_int32_t h; + const u_char *key; + size_t loop; + u_int32_t h; #define HASHC h = *key++ + 65599 * h @@ -165,11 +167,11 @@ hash3(keyarg, len) static u_int32_t hash4(keyarg, len) const void *keyarg; - register size_t len; + size_t len; { - register const u_char *key; - register size_t loop; - register u_int32_t h; + const u_char *key; + size_t loop; + u_int32_t h; #define HASH4a h = (h << 5) - h + *key++; #define HASH4b h = (h << 5) + h + *key++; diff --git a/lib/libc/db/hash/hash_log2.c b/lib/libc/db/hash/hash_log2.c index c8c56bf..c9634dc 100644 --- a/lib/libc/db/hash/hash_log2.c +++ b/lib/libc/db/hash/hash_log2.c @@ -37,6 +37,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/types.h> @@ -46,7 +48,7 @@ u_int32_t __log2(num) u_int32_t num; { - register u_int32_t i, limit; + u_int32_t i, limit; limit = 1; for (i = 0; limit < num; limit = limit << 1, i++); diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c index dd042c8..65358a2 100644 --- a/lib/libc/db/hash/hash_page.c +++ b/lib/libc/db/hash/hash_page.c @@ -32,13 +32,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); /* * PACKAGE: hashing @@ -101,7 +101,7 @@ putpair(p, key, val) char *p; const DBT *key, *val; { - register u_int16_t *bp, n, off; + u_int16_t *bp, n, off; bp = (u_int16_t *)p; @@ -132,10 +132,10 @@ extern int __delpair(hashp, bufp, ndx) HTAB *hashp; BUFHEAD *bufp; - register int ndx; + int ndx; { - register u_int16_t *bp, newoff; - register int n; + u_int16_t *bp, newoff; + int n; u_int16_t pairlen; bp = (u_int16_t *)bufp->page; @@ -151,9 +151,9 @@ __delpair(hashp, bufp, ndx) if (ndx != (n - 1)) { /* Hard Case -- need to shuffle keys */ - register int i; - register char *src = bufp->page + (int)OFFSET(bp); - register char *dst = src + (int)pairlen; + int i; + char *src = bufp->page + (int)OFFSET(bp); + char *dst = src + (int)pairlen; memmove(dst, src, bp[ndx + 1] - OFFSET(bp)); /* Now adjust the pointers */ @@ -186,9 +186,9 @@ __split_page(hashp, obucket, nbucket) HTAB *hashp; u_int32_t obucket, nbucket; { - register BUFHEAD *new_bufp, *old_bufp; - register u_int16_t *ino; - register char *np; + BUFHEAD *new_bufp, *old_bufp; + u_int16_t *ino; + char *np; DBT key, val; int n, ndx, retval; u_int16_t copyto, diff, off, moved; @@ -283,12 +283,12 @@ ugly_split(hashp, obucket, old_bufp, new_bufp, copyto, moved) u_int32_t obucket; /* Same as __split_page. */ BUFHEAD *old_bufp, *new_bufp; int copyto; /* First byte on page which contains key/data values. */ - int moved; /* Number of pairs moved to new page. */ + int moved; /* Number of pairs moved to new page. */ { - register BUFHEAD *bufp; /* Buffer header for ino */ - register u_int16_t *ino; /* Page keys come off of */ - register u_int16_t *np; /* New page */ - register u_int16_t *op; /* Page keys go on to if they aren't moving */ + BUFHEAD *bufp; /* Buffer header for ino */ + u_int16_t *ino; /* Page keys come off of */ + u_int16_t *np; /* New page */ + u_int16_t *op; /* Page keys go on to if they aren't moving */ BUFHEAD *last_bfp; /* Last buf header OVFL needing to be freed */ DBT key, val; @@ -404,7 +404,7 @@ __addel(hashp, bufp, key, val) BUFHEAD *bufp; const DBT *key, *val; { - register u_int16_t *bp, *sop; + u_int16_t *bp, *sop; int do_expand; bp = (u_int16_t *)bufp->page; @@ -470,7 +470,7 @@ __add_ovflpage(hashp, bufp) HTAB *hashp; BUFHEAD *bufp; { - register u_int16_t *sp; + u_int16_t *sp; u_int16_t ndx, ovfl_num; #ifdef DEBUG1 int tmp1, tmp2; @@ -525,7 +525,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap) u_int32_t bucket; int is_bucket, is_disk, is_bitmap; { - register int fd, page, size; + int fd, page, size; int rsize; u_int16_t *bp; @@ -555,7 +555,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap) PAGE_INIT(p); } else if (hashp->LORDER != BYTE_ORDER) { - register int i, max; + int i, max; if (is_bitmap) { max = hashp->BSIZE >> 2; /* divide by 4 */ @@ -585,7 +585,7 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap) u_int32_t bucket; int is_bucket, is_bitmap; { - register int fd, page, size; + int fd, page, size; int wsize; size = hashp->BSIZE; @@ -594,8 +594,8 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap) fd = hashp->fp; if (hashp->LORDER != BYTE_ORDER) { - register int i; - register int max; + int i; + int max; if (is_bitmap) { max = hashp->BSIZE >> 2; /* divide by 4 */ @@ -654,7 +654,7 @@ static u_int32_t first_free(map) u_int32_t map; { - register u_int32_t i, mask; + u_int32_t i, mask; mask = 0x1; for (i = 0; i < BITS_PER_MAP; i++) { @@ -669,8 +669,8 @@ static u_int16_t overflow_page(hashp) HTAB *hashp; { - register u_int32_t *freep; - register int max_free, offset, splitnum; + u_int32_t *freep; + int max_free, offset, splitnum; u_int16_t addr; int bit, first_page, free_bit, free_page, i, in_use_bits, j; #ifdef DEBUG2 @@ -818,7 +818,7 @@ __free_ovflpage(hashp, obufp) HTAB *hashp; BUFHEAD *obufp; { - register u_int16_t addr; + u_int16_t addr; u_int32_t *freep; int bit_address, free_page, free_bit; u_int16_t ndx; @@ -886,7 +886,7 @@ squeeze_key(sp, key, val) u_int16_t *sp; const DBT *key, *val; { - register char *p; + char *p; u_int16_t free_space, n, off, pageno; p = (char *)sp; |