Update max to std::max

This commit is contained in:
Sacha 2013-02-10 23:01:18 +10:00
parent ddfac0926a
commit b817e3bf26
3 changed files with 8 additions and 8 deletions

View File

@ -167,7 +167,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;
@ -245,7 +245,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)
@ -275,7 +275,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)
@ -318,7 +318,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)
@ -390,7 +390,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;
@ -464,7 +464,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)

View File

@ -91,7 +91,7 @@ struct PsmfEntry {
int id;
};
int getMaxAheadTimestamp(int packets) {return max(40000, packets * 700);}
int getMaxAheadTimestamp(int packets) {return std::max(40000, packets * 700);}
class PsmfStream;

View File

@ -262,7 +262,7 @@ void Lighter::Light(float colorOut0[4], float colorOut1[4], const float colorIn[
}
Color4 lightDiff(gstate_c.lightColor[1][l], 0.0f);
Color4 diff = (lightDiff * *diffuse) * (max(dot, 0.0f) * lightScale);
Color4 diff = (lightDiff * *diffuse) * (std::max(dot, 0.0f) * lightScale);
// Real PSP specular
Vec3 toViewer(0,0,1);