aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/kdb/db2/libdb2/hash
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2016-08-24 19:49:11 -0400
committerTom Yu <tlyu@mit.edu>2016-09-08 15:15:33 -0400
commit252f7358e3e2515a64307e41ec6776fbe060e353 (patch)
tree2070f13bf65f217037c69b1b45ab2826cd5b5d19 /src/plugins/kdb/db2/libdb2/hash
parent4613d503986f34f05ff310fcc580f65ba60eec5b (diff)
downloadkrb5-252f7358e3e2515a64307e41ec6776fbe060e353.zip
krb5-252f7358e3e2515a64307e41ec6776fbe060e353.tar.gz
krb5-252f7358e3e2515a64307e41ec6776fbe060e353.tar.bz2
Clean up libdb2 warnings
Clean up many pointer alignment warnings by casting through (void *). Clean up many signed-unsigned comparison warnings by casting to unsigned types or redeclaring variables as unsigned types as appropriate.
Diffstat (limited to 'src/plugins/kdb/db2/libdb2/hash')
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/hash.c2
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/hash.h20
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/hash_page.c16
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/page.h2
4 files changed, 20 insertions, 20 deletions
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.c b/src/plugins/kdb/db2/libdb2/hash/hash.c
index 2a5b4f8..76f5d47 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash.c
@@ -997,7 +997,7 @@ __call_hash(hashp, k, len)
int8_t *k;
int32_t len;
{
- int32_t n, bucket;
+ u_int32_t n, bucket;
n = hashp->hash(k, len);
bucket = n & hashp->hdr.high_mask;
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.h b/src/plugins/kdb/db2/libdb2/hash/hash.h
index 32793ca..f1ab9df 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash.h
+++ b/src/plugins/kdb/db2/libdb2/hash/hash.h
@@ -67,19 +67,19 @@ typedef struct hashhdr { /* Disk resident portion */
int32_t magic; /* Magic NO for hash tables */
int32_t version; /* Version ID */
int32_t lorder; /* Byte Order */
- int32_t bsize; /* Bucket/Page Size */
+ u_int32_t bsize; /* Bucket/Page Size */
int32_t bshift; /* Bucket shift */
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 table */
- int32_t ffactor; /* Fill factor */
+ u_int32_t last_freed; /* Last overflow page freed */
+ 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 */
+ 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) */
+ u_int32_t hdrpages; /* Size of table header */
+ u_int32_t h_charkey; /* value of hash(CHARKEY) */
#define NCACHED 32 /* number of bit maps and spare points */
- int32_t spares[NCACHED];/* spare pages for overflow */
+ u_int32_t spares[NCACHED];/* spare pages for overflow */
u_int16_t bitmaps[NCACHED]; /* address of overflow page bitmaps */
} HASHHDR;
@@ -174,7 +174,7 @@ typedef struct item_info {
indx_t ndx;
indx_t pgndx;
u_int8_t status;
- int32_t seek_size;
+ u_int32_t seek_size;
db_pgno_t seek_found_page;
indx_t key_off;
indx_t data_off;
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_page.c b/src/plugins/kdb/db2/libdb2/hash/hash_page.c
index 86ba7ba..5624dfd 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash_page.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash_page.c
@@ -231,7 +231,7 @@ putpair(p, key, val)
{
u_int16_t *pagep, n, off;
- pagep = (PAGE16 *)p;
+ pagep = (PAGE16 *)(void *)p;
/* Items on the page are 0-indexed. */
n = NUM_ENT(pagep);
@@ -888,7 +888,7 @@ __pgin_routine(pg_cookie, pgno, page)
if (is_bitmap_pgno(hashp, pgno)) {
max = hashp->hdr.bsize >> 2; /* divide by 4 bytes */
for (i = 0; i < max; i++)
- M_32_SWAP(((int32_t *)pagep)[i]);
+ M_32_SWAP(((int32_t *)(void *)pagep)[i]);
} else
swap_page_header_in(pagep);
}
@@ -919,7 +919,7 @@ __pgout_routine(pg_cookie, pgno, page)
if (is_bitmap_pgno(hashp, pgno)) {
max = hashp->hdr.bsize >> 2; /* divide by 4 bytes */
for (i = 0; i < max; i++)
- M_32_SWAP(((int32_t *)pagep)[i]);
+ M_32_SWAP(((int32_t *)(void *)pagep)[i]);
} else
swap_page_header_out(pagep);
}
@@ -1037,7 +1037,7 @@ __ibitmap(hashp, pnum, nbits, ndx)
/* make a new bitmap page */
if (__new_page(hashp, pnum, A_BITMAP) != 0)
return (1);
- if (!(ip = (u_int32_t *)__get_page(hashp, pnum, A_BITMAP)))
+ if (!(ip = (u_int32_t *)(void *)__get_page(hashp, pnum, A_BITMAP)))
return (1);
hashp->nmaps++;
clearints = ((nbits - 1) >> INT32_T_BYTE_SHIFT) + 1;
@@ -1074,8 +1074,8 @@ overflow_page(hashp)
HTAB *hashp;
{
u_int32_t *freep;
- int32_t bit, first_page, free_bit, free_page, i, in_use_bits, j;
- int32_t max_free, offset, splitnum;
+ u_int32_t bit, first_page, free_bit, free_page, i, in_use_bits, j;
+ u_int32_t max_free, offset, splitnum;
u_int16_t addr;
#ifdef DEBUG2
int32_t tmp1, tmp2;
@@ -1299,7 +1299,7 @@ __free_ovflpage(hashp, pagep)
PAGE16 *pagep;
{
u_int32_t *freep;
- int32_t bit_address, free_page, free_bit;
+ u_int32_t bit_address, free_page, free_bit;
u_int16_t addr, ndx;
addr = page_to_oaddr(hashp, ADDR(pagep));
@@ -1340,7 +1340,7 @@ fetch_bitmap(hashp, ndx)
if (ndx >= hashp->nmaps)
return (NULL);
if (!hashp->mapp[ndx])
- hashp->mapp[ndx] = (u_int32_t *)__get_page(hashp,
+ hashp->mapp[ndx] = (u_int32_t *)(void *)__get_page(hashp,
hashp->hdr.bitmaps[ndx], A_BITMAP);
return (hashp->mapp[ndx]);
diff --git a/src/plugins/kdb/db2/libdb2/hash/page.h b/src/plugins/kdb/db2/libdb2/hash/page.h
index 989f967..8cfdf00 100644
--- a/src/plugins/kdb/db2/libdb2/hash/page.h
+++ b/src/plugins/kdb/db2/libdb2/hash/page.h
@@ -88,7 +88,7 @@
#define PAIR_OVERHEAD ((sizeof(indx_t) << 1))
/* Use this macro to extract a value of type T from page P at offset O. */
-#define REFERENCE(P, T, O) (((T *)((u_int8_t *)(P) + O))[0])
+#define REFERENCE(P, T, O) (((T *)(void *)((u_int8_t *)(void *)(P) + O))[0])
/*
* Use these macros to access fields on a page; P is a PAGE16 *.