summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-22 19:05:26 +0000
committertron <tron@openttd.org>2007-02-22 19:05:26 +0000
commit2e4844abad2b87d37799708641459d14c78f0d8d (patch)
treee1c4e58ba07d56f8e6ef95de2f44cedf49cd37f4
parent8b94d4df22e06b136c0dec02ec2badf7d4497510 (diff)
downloadopenttd-2e4844abad2b87d37799708641459d14c78f0d8d.tar.xz
(svn r8847) -Fix
There is not much point in hiding a normal 64bit multiplication in a function, so do not do it
-rw-r--r--src/economy.cpp3
-rw-r--r--src/macros.h4
2 files changed, 1 insertions, 6 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 85eb0367b..c77146419 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -613,9 +613,8 @@ static void PlayersGenStatistics(void)
static void AddSingleInflation(int32 *value, uint16 *frac, int32 amt)
{
- int64 tmp;
+ int64 tmp = (int64)*value * amt;
int32 low;
- tmp = BIGMULS(*value, amt);
*frac = (uint16)(low = (uint16)tmp + *frac);
*value += (int32)(tmp >> 16) + (low >> 16);
}
diff --git a/src/macros.h b/src/macros.h
index 20b6024a2..00ef5af65 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -53,10 +53,6 @@ static inline uint32 BIGMULUS(uint32 a, uint32 b, int shift)
return (uint32)((uint64)a * (uint64)b >> shift);
}
-static inline int64 BIGMULS(int32 a, int32 b)
-{
- return (int64)a * (int64)b;
-}
/* OPT: optimized into an unsigned comparison */
//#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size))