[haiku-commits] haiku: hrev45564 - src/system/kernel/vm

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 27 Apr 2013 14:43:41 +0200 (CEST)

hrev45564 adds 1 changeset to branch 'master'
old head: db6fcc4952608d6bcc672e04cbc92af47f3cf8ce
new head: 32d7bcb47056a79e35233d184c69430af9fb1890
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=32d7bcb+%5Edb6fcc4

----------------------------------------------------------------------------

32d7bcb: VMAnonymousCache.cpp: use off_t instead of page_num_t
  
  * use off_t instead of page_num_t to fit in swap_hash_key struct.
  * this fixes narrowing conversion and signedness warnings on GCC 4.7.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45564
Commit:      32d7bcb47056a79e35233d184c69430af9fb1890
URL:         http://cgit.haiku-os.org/haiku/commit/?id=32d7bcb
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Apr 27 12:36:58 2013 UTC

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 4 deletions(-)
src/system/kernel/vm/VMAnonymousCache.cpp | 8 ++++----

----------------------------------------------------------------------------

diff --git a/src/system/kernel/vm/VMAnonymousCache.cpp 
b/src/system/kernel/vm/VMAnonymousCache.cpp
index 8302f99..4105676 100644
--- a/src/system/kernel/vm/VMAnonymousCache.cpp
+++ b/src/system/kernel/vm/VMAnonymousCache.cpp
@@ -490,10 +490,10 @@ VMAnonymousCache::Resize(off_t newSize, int priority)
 {
        // If the cache size shrinks, drop all swap pages beyond the new size.
        if (fAllocatedSwapSize > 0) {
-               page_num_t oldPageCount = (virtual_end + B_PAGE_SIZE - 1) >> 
PAGE_SHIFT;
+               off_t oldPageCount = (virtual_end + B_PAGE_SIZE - 1) >> 
PAGE_SHIFT;
                swap_block* swapBlock = NULL;
 
-               for (page_num_t pageIndex = (newSize + B_PAGE_SIZE - 1) >> 
PAGE_SHIFT;
+               for (off_t pageIndex = (newSize + B_PAGE_SIZE - 1) >> 
PAGE_SHIFT;
                        pageIndex < oldPageCount && fAllocatedSwapSize > 0; 
pageIndex++) {
 
                        WriteLocker locker(sSwapHashLock);
@@ -579,7 +579,7 @@ VMAnonymousCache::HasPage(off_t offset)
 bool
 VMAnonymousCache::DebugHasPage(off_t offset)
 {
-       page_num_t pageIndex = offset >> PAGE_SHIFT;
+       off_t pageIndex = offset >> PAGE_SHIFT;
        swap_hash_key key = { this, pageIndex };
        swap_block* swap = sSwapHashTable.Lookup(key);
        if (swap == NULL)
@@ -1093,7 +1093,7 @@ VMAnonymousCache::_MergeSwapPages(VMAnonymousCache* 
source)
 
                WriteLocker locker(sSwapHashLock);
 
-               page_num_t swapBlockPageIndex = offset >> PAGE_SHIFT;
+               off_t swapBlockPageIndex = offset >> PAGE_SHIFT;
                swap_hash_key key = { source, swapBlockPageIndex };
                swap_block* sourceSwapBlock = sSwapHashTable.Lookup(key);
 


Other related posts:

  • » [haiku-commits] haiku: hrev45564 - src/system/kernel/vm - korli