From 5125fe4f45482d86cc82bd50876614c78d055ee9 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Wed, 26 Jun 2002 19:18:14 +0000 Subject: 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 --- sys/vm/swap_pager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/vm/swap_pager.c') diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 1beb5fe2a2cc..3dd7279bebea 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -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; -- cgit v1.2.3