summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/btree
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/btree
parent64850243010a49e44236d9a5a79333f37746f169 (diff)
downloadFreeBSD-src-21b00fc42b2ab16bc19a270792a72971dc10973f.zip
FreeBSD-src-21b00fc42b2ab16bc19a270792a72971dc10973f.tar.gz
Several signed/unsigned warning fixes.
Diffstat (limited to 'lib/libc/db/btree')
-rw-r--r--lib/libc/db/btree/bt_put.c4
-rw-r--r--lib/libc/db/btree/bt_split.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/db/btree/bt_put.c b/lib/libc/db/btree/bt_put.c
index 31931dc..e4016c0 100644
--- a/lib/libc/db/btree/bt_put.c
+++ b/lib/libc/db/btree/bt_put.c
@@ -197,7 +197,7 @@ delete: if (__bt_dleaf(t, key, h, idx) == RET_ERROR) {
* into the offset array, shift the pointers up.
*/
nbytes = NBLEAFDBT(key->size, data->size);
- if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+ if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) {
if ((status = __bt_split(t, h, key,
data, dflags, nbytes, idx)) != RET_SUCCESS)
return (status);
@@ -278,7 +278,7 @@ bt_fast(BTREE *t, const DBT *key, const DBT *data, int *exactp)
* have to search to get split stack.
*/
nbytes = NBLEAFDBT(key->size, data->size);
- if (h->upper - h->lower < nbytes + sizeof(indx_t))
+ if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t))
goto miss;
if (t->bt_order == FORWARD) {
diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c
index 6ae3ce4..18cd0ed 100644
--- a/lib/libc/db/btree/bt_split.c
+++ b/lib/libc/db/btree/bt_split.c
@@ -205,7 +205,7 @@ __bt_split(BTREE *t, PAGE *sp, const DBT *key, const DBT *data, int flags,
}
/* Split the parent page if necessary or shift the indices. */
- if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+ if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) {
sp = h;
h = h->pgno == P_ROOT ?
bt_root(t, h, &l, &r, &skip, nbytes) :
OpenPOWER on IntegriCloud