summaryrefslogtreecommitdiffstats
path: root/src/common/hash.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-02-20 17:41:30 +0100
committerbunnei <bunneidev@gmail.com>2015-02-20 17:41:30 +0100
commit5f9939070e81691e04facca9ff431070988e5b05 (patch)
tree9bd54cdde2c34dd2f63e0396260335f267a46ce1 /src/common/hash.cpp
parentMerge pull request #587 from archshift/assert (diff)
parentMisc cleanup of common and related functions (diff)
downloadyuzu-5f9939070e81691e04facca9ff431070988e5b05.tar
yuzu-5f9939070e81691e04facca9ff431070988e5b05.tar.gz
yuzu-5f9939070e81691e04facca9ff431070988e5b05.tar.bz2
yuzu-5f9939070e81691e04facca9ff431070988e5b05.tar.lz
yuzu-5f9939070e81691e04facca9ff431070988e5b05.tar.xz
yuzu-5f9939070e81691e04facca9ff431070988e5b05.tar.zst
yuzu-5f9939070e81691e04facca9ff431070988e5b05.zip
Diffstat (limited to 'src/common/hash.cpp')
-rw-r--r--src/common/hash.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/common/hash.cpp b/src/common/hash.cpp
index fe2c9e636..0624dab8d 100644
--- a/src/common/hash.cpp
+++ b/src/common/hash.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <algorithm>
#include "common/hash.h"
#if _M_SSE >= 0x402
@@ -155,7 +156,7 @@ u64 GetMurmurHash3(const u8 *src, int len, u32 samples)
const u8 * data = (const u8*)src;
const int nblocks = len / 16;
u32 Step = (len / 8);
- if(samples == 0) samples = max(Step, 1u);
+ if(samples == 0) samples = std::max(Step, 1u);
Step = Step / samples;
if(Step < 1) Step = 1;
@@ -233,7 +234,7 @@ u64 GetCRC32(const u8 *src, int len, u32 samples)
u32 Step = (len / 8);
const u64 *data = (const u64 *)src;
const u64 *end = data + Step;
- if(samples == 0) samples = max(Step, 1u);
+ if(samples == 0) samples = std::max(Step, 1u);
Step = Step / samples;
if(Step < 1) Step = 1;
while(data < end)
@@ -265,7 +266,7 @@ u64 GetHashHiresTexture(const u8 *src, int len, u32 samples)
u32 Step = (len / 8);
const u64 *data = (const u64 *)src;
const u64 *end = data + Step;
- if(samples == 0) samples = max(Step, 1u);
+ if(samples == 0) samples = std::max(Step, 1u);
Step = Step / samples;
if(Step < 1) Step = 1;
while(data < end)
@@ -308,7 +309,7 @@ u64 GetCRC32(const u8 *src, int len, u32 samples)
u32 Step = (len/4);
const u32 *data = (const u32 *)src;
const u32 *end = data + Step;
- if(samples == 0) samples = max(Step, 1u);
+ if(samples == 0) samples = std::max(Step, 1u);
Step = Step / samples;
if(Step < 1) Step = 1;
while(data < end)
@@ -380,7 +381,7 @@ u64 GetMurmurHash3(const u8* src, int len, u32 samples)
u32 out[2];
const int nblocks = len / 8;
u32 Step = (len / 4);
- if(samples == 0) samples = max(Step, 1u);
+ if(samples == 0) samples = std::max(Step, 1u);
Step = Step / samples;
if(Step < 1) Step = 1;
@@ -456,7 +457,7 @@ u64 GetHashHiresTexture(const u8 *src, int len, u32 samples)
u32 Step = (len / 8);
const u64 *data = (const u64 *)src;
const u64 *end = data + Step;
- if(samples == 0) samples = max(Step, 1u);
+ if(samples == 0) samples = std::max(Step, 1u);
Step = Step / samples;
if(Step < 1) Step = 1;
while(data < end)