Use an explicit cast to avoid relying on sign extension to do the

right thing in code such as `vm_pindex_t x = ~SWAP_META_MASK'.

Reviewed by:	dillon
This commit is contained in:
Ian Dowse 2002-06-26 19:18:14 +00:00
parent 8f42fb8fc9
commit 5125fe4f45

View file

@ -1649,7 +1649,7 @@ swp_pager_hash(vm_object_t object, vm_pindex_t index)
struct swblock **pswap;
struct swblock *swap;
index &= ~SWAP_META_MASK;
index &= ~(vm_pindex_t)SWAP_META_MASK;
pswap = &swhash[(index ^ (int)(intptr_t)object) & swhash_mask];
while ((swap = *pswap) != NULL) {
if (swap->swb_object == object &&
@ -1731,7 +1731,7 @@ retry:
swap->swb_hnext = NULL;
swap->swb_object = object;
swap->swb_index = index & ~SWAP_META_MASK;
swap->swb_index = index & ~(vm_pindex_t)SWAP_META_MASK;
swap->swb_count = 0;
++object->un_pager.swp.swp_bcount;