diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-06-26 19:18:14 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-06-26 19:18:14 +0000 |
commit | c3868afc98f44fd1ff3f32ca2a92e673adb92ab9 (patch) | |
tree | 78f4a48aa86bf24ab1c154a5b7c9dfb641054722 /sys | |
parent | c0323a07fb64ca28dea948838fdbcdfb6567eec8 (diff) | |
download | FreeBSD-src-c3868afc98f44fd1ff3f32ca2a92e673adb92ab9.zip FreeBSD-src-c3868afc98f44fd1ff3f32ca2a92e673adb92ab9.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/swap_pager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 1beb5fe..3dd7279 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; |