summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Hash.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2017-05-03 06:25:44 +0100
committerTillmann Karras <tilkax@gmail.com>2017-05-03 06:40:52 +0100
commit3a13e1aa7a35724ccc0d13f3436b7486d5a58101 (patch)
tree8ce51cf6f919b22597944c82730dd0eab040d219 /Source/Core/Common/Hash.cpp
parent25f61f032946535150afaa70492b370190614c4d (diff)
Common/Hash: small cleanup
Diffstat (limited to 'Source/Core/Common/Hash.cpp')
-rw-r--r--Source/Core/Common/Hash.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp
index e047df89c9..8ff20affe7 100644
--- a/Source/Core/Common/Hash.cpp
+++ b/Source/Core/Common/Hash.cpp
@@ -13,7 +13,7 @@
#include <arm_acle.h>
#endif
-static u64 (*ptrHashFunction)(const u8* src, u32 len, u32 samples) = &GetMurmurHash3;
+static u64 (*ptrHashFunction)(const u8* src, u32 len, u32 samples) = nullptr;
// uint32_t
// WARNING - may read one more byte!
@@ -106,7 +106,7 @@ u32 HashEctor(const u8* ptr, int length)
// Block read - if your platform needs to do endian-swapping or can only
// handle aligned reads, do the conversion here
-inline u64 getblock(const u64* p, int i)
+static u64 getblock(const u64* p, int i)
{
return p[i];
}
@@ -114,7 +114,7 @@ inline u64 getblock(const u64* p, int i)
//----------
// Block mix - combine the key bits with the hash bits and scramble everything
-inline void bmix64(u64& h1, u64& h2, u64& k1, u64& k2, u64& c1, u64& c2)
+static void bmix64(u64& h1, u64& h2, u64& k1, u64& k2, u64& c1, u64& c2)
{
k1 *= c1;
k1 = _rotl64(k1, 23);
@@ -140,7 +140,7 @@ inline void bmix64(u64& h1, u64& h2, u64& k1, u64& k2, u64& c1, u64& c2)
//----------
// Finalization mix - avalanches all bits to within 0.05% bias
-inline u64 fmix64(u64 k)
+static u64 fmix64(u64 k)
{
k ^= k >> 33;
k *= 0xff51afd7ed558ccd;
@@ -151,7 +151,7 @@ inline u64 fmix64(u64 k)
return k;
}
-u64 GetMurmurHash3(const u8* src, u32 len, u32 samples)
+static u64 GetMurmurHash3(const u8* src, u32 len, u32 samples)
{
const u8* data = (const u8*)src;
const int nblocks = len / 16;
@@ -245,7 +245,7 @@ u64 GetMurmurHash3(const u8* src, u32 len, u32 samples)
#if defined(_M_X86_64)
FUNCTION_TARGET_SSE42
-u64 GetCRC32(const u8* src, u32 len, u32 samples)
+static u64 GetCRC32(const u8* src, u32 len, u32 samples)
{
u64 h[4] = {len, 0, 0, 0};
u32 Step = (len / 8);
@@ -285,7 +285,7 @@ u64 GetCRC32(const u8* src, u32 len, u32 samples)
#elif defined(_M_ARM_64)
-u64 GetCRC32(const u8* src, u32 len, u32 samples)
+static u64 GetCRC32(const u8* src, u32 len, u32 samples)
{
u64 h[4] = {len, 0, 0, 0};
u32 Step = (len / 8);
@@ -325,7 +325,7 @@ u64 GetCRC32(const u8* src, u32 len, u32 samples)
#else
-u64 GetCRC32(const u8* src, u32 len, u32 samples)
+static u64 GetCRC32(const u8* src, u32 len, u32 samples)
{
return 0;
}
@@ -396,7 +396,7 @@ u64 GetHashHiresTexture(const u8* src, u32 len, u32 samples)
#if defined(_M_X86)
FUNCTION_TARGET_SSE42
-u64 GetCRC32(const u8* src, u32 len, u32 samples)
+static u64 GetCRC32(const u8* src, u32 len, u32 samples)
{
u32 h = len;
u32 Step = (len / 4);
@@ -419,7 +419,7 @@ u64 GetCRC32(const u8* src, u32 len, u32 samples)
#else
-u64 GetCRC32(const u8* src, u32 len, u32 samples)
+static u64 GetCRC32(const u8* src, u32 len, u32 samples)
{
return 0;
}
@@ -430,7 +430,7 @@ u64 GetCRC32(const u8* src, u32 len, u32 samples)
// Block read - if your platform needs to do endian-swapping or can only
// handle aligned reads, do the conversion here
-inline u32 getblock(const u32* p, int i)
+static u32 getblock(const u32* p, int i)
{
return p[i];
}
@@ -440,7 +440,7 @@ inline u32 getblock(const u32* p, int i)
// avalanches all bits to within 0.25% bias
-inline u32 fmix32(u32 h)
+static u32 fmix32(u32 h)
{
h ^= h >> 16;
h *= 0x85ebca6b;
@@ -451,7 +451,7 @@ inline u32 fmix32(u32 h)
return h;
}
-inline void bmix32(u32& h1, u32& h2, u32& k1, u32& k2, u32& c1, u32& c2)
+static void bmix32(u32& h1, u32& h2, u32& k1, u32& k2, u32& c1, u32& c2)
{
k1 *= c1;
k1 = _rotl(k1, 11);
@@ -476,7 +476,7 @@ inline void bmix32(u32& h1, u32& h2, u32& k1, u32& k2, u32& c1, u32& c2)
//----------
-u64 GetMurmurHash3(const u8* src, u32 len, u32 samples)
+static u64 GetMurmurHash3(const u8* src, u32 len, u32 samples)
{
const u8* data = (const u8*)src;
u32 out[2];