Mercurial > hg > openttd
changeset 6111:e999ec323771 draft
(svn r8847) -Fix
There is not much point in hiding a normal 64bit multiplication in a function, so do not do it
author | tron <tron@openttd.org> |
---|---|
date | Thu, 22 Feb 2007 19:05:26 +0000 |
parents | 8e8a6a41114d |
children | c1f929f6b1a5 |
files | src/economy.cpp src/macros.h |
diffstat | 2 files changed, 1 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/economy.cpp +++ b/src/economy.cpp @@ -613,9 +613,8 @@ 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); }
--- a/src/macros.h +++ b/src/macros.h @@ -53,10 +53,6 @@ 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))