summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/hash
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-03-28 05:45:29 +0000
committerdelphij <delphij@FreeBSD.org>2009-03-28 05:45:29 +0000
commit21b00fc42b2ab16bc19a270792a72971dc10973f (patch)
tree2886e758aa8188bda68aeabd1e440992d0ed0637 /lib/libc/db/hash
parent64850243010a49e44236d9a5a79333f37746f169 (diff)
downloadFreeBSD-src-21b00fc42b2ab16bc19a270792a72971dc10973f.zip
FreeBSD-src-21b00fc42b2ab16bc19a270792a72971dc10973f.tar.gz
Several signed/unsigned warning fixes.
Diffstat (limited to 'lib/libc/db/hash')
-rw-r--r--lib/libc/db/hash/hash.c6
-rw-r--r--lib/libc/db/hash/hash.h8
-rw-r--r--lib/libc/db/hash/hash_bigkey.c3
-rw-r--r--lib/libc/db/hash/hash_log2.c5
4 files changed, 12 insertions, 10 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 3013f68..263c1b0 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -164,7 +164,7 @@ __hash_open(const char *file, int flags, int mode,
if (hashp->VERSION != HASHVERSION &&
hashp->VERSION != OLDHASHVERSION)
RETURN_ERROR(EFTYPE, error1);
- if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
+ if ((int32_t)hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
RETURN_ERROR(EFTYPE, error1);
/*
* Figure out how many segments we need. Max_Bucket is the
@@ -736,7 +736,7 @@ hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag)
break;
}
hashp->cbucket = bucket;
- if (hashp->cbucket > hashp->MAX_BUCKET) {
+ if ((u_int32_t)hashp->cbucket > hashp->MAX_BUCKET) {
hashp->cbucket = -1;
return (ABNORMAL);
}
@@ -858,7 +858,7 @@ hash_realloc(SEGMENT **p_ptr, int oldsize, int newsize)
u_int32_t
__call_hash(HTAB *hashp, char *k, int len)
{
- int n, bucket;
+ unsigned int n, bucket;
n = hashp->hash(k, len);
bucket = n & hashp->HIGH_MASK;
diff --git a/lib/libc/db/hash/hash.h b/lib/libc/db/hash/hash.h
index f35fb4e..8329413 100644
--- a/lib/libc/db/hash/hash.h
+++ b/lib/libc/db/hash/hash.h
@@ -71,11 +71,11 @@ typedef struct hashhdr { /* Disk resident portion */
int32_t ovfl_point; /* Where overflow pages are being
* allocated */
int32_t last_freed; /* Last overflow page freed */
- int32_t max_bucket; /* ID of Maximum bucket in use */
- int32_t high_mask; /* Mask to modulo into entire table */
- int32_t low_mask; /* Mask to modulo into lower half of
+ u_int32_t max_bucket; /* ID of Maximum bucket in use */
+ u_int32_t high_mask; /* Mask to modulo into entire table */
+ u_int32_t low_mask; /* Mask to modulo into lower half of
* table */
- int32_t ffactor; /* Fill factor */
+ u_int32_t ffactor; /* Fill factor */
int32_t nkeys; /* Number of keys in hash table */
int32_t hdrpages; /* Size of table header */
int32_t h_charkey; /* value of hash(CHARKEY) */
diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c
index c2a1e03..32db064 100644
--- a/lib/libc/db/hash/hash_bigkey.c
+++ b/lib/libc/db/hash/hash_bigkey.c
@@ -86,7 +86,8 @@ int
__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
{
u_int16_t *p;
- int key_size, n, val_size;
+ int key_size, n;
+ unsigned int val_size;
u_int16_t space, move_bytes, off;
char *cp, *key_data, *val_data;
diff --git a/lib/libc/db/hash/hash_log2.c b/lib/libc/db/hash/hash_log2.c
index 33e0515..0586aa7 100644
--- a/lib/libc/db/hash/hash_log2.c
+++ b/lib/libc/db/hash/hash_log2.c
@@ -36,9 +36,10 @@ static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-
#include <db.h>
+#include "hash.h"
+#include "page.h"
+#include "extern.h"
u_int32_t
__log2(u_int32_t num)
OpenPOWER on IntegriCloud