(svn r4142) - Fix [FS#74]: Incorrectly loaded settings from the config file when the signed uint32 variable would be negative.

This commit is contained in:
Darkvater
2006-03-28 21:51:14 +00:00
parent 1e428481b2
commit 8560265953
2 changed files with 34 additions and 4 deletions

View File

@@ -35,6 +35,12 @@ static inline int clamp(int a, int min, int max)
return a;
}
static inline uint clampu(uint a, uint min, uint max)
{
if (a <= min) return min;
if (a >= max) return max;
return a;
}
static inline int32 BIGMULSS(int32 a, int32 b, int shift) {
return (int32)(((int64)(a) * (int64)(b)) >> (shift));