From e432cef2962c92aafd74bf07778786d661969dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 26 Aug 2005 02:07:41 +0000 Subject: [PATCH] Updated a few more hash functions to be able to deal with negative numbers. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14067 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/block_cache.cpp | 4 ++-- src/system/kernel/vm/vm.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index d2089e6e63..ac45fb0a99 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -74,7 +74,7 @@ transaction_hash(void *_transaction, const void *_id, uint32 range) if (transaction != NULL) return transaction->id % range; - return *id % range; + return (uint32)*id % range; } @@ -121,7 +121,7 @@ cached_block::Hash(void *_cacheEntry, const void *_block, uint32 range) if (cacheEntry != NULL) return cacheEntry->block_number % range; - return *block % range; + return (uint64)*block % range; } diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index b626d54571..f4a84ade35 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -97,7 +97,7 @@ area_hash(void *_area, const void *key, uint32 range) if (area != NULL) return area->id % range; - return *id % range; + return (uint32)*id % range; }