mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 01:19:11 +00:00
(svn r237) -Fix: [1025836] Company value problem (again). Now company value rightly shows the value, including ALL your money.
-Fix: Graphs now accomodate 64bit numbers (so the company value graph doesn't plummet into -... if value is too big) -Strgen: added CURRCOMPACT64 for this, and 64bit versions of several macros.
This commit is contained in:
6
macros.h
6
macros.h
@@ -13,6 +13,7 @@
|
||||
|
||||
static INLINE int min(int a, int b) { if (a <= b) return a; return b; }
|
||||
static INLINE int max(int a, int b) { if (a >= b) return a; return b; }
|
||||
static INLINE int64 max64(int64 a, int64 b) { if (a >= b) return a; return b; }
|
||||
|
||||
static INLINE uint minu(uint a, uint b) { if (a <= b) return a; return b; }
|
||||
static INLINE uint maxu(uint a, uint b) { if (a >= b) return a; return b; }
|
||||
@@ -49,6 +50,10 @@ static INLINE int32 BIGMULSS(int32 a, int32 b, int shift) {
|
||||
return (int32)(((int64)(a) * (int64)(b)) >> (shift));
|
||||
}
|
||||
|
||||
static INLINE int64 BIGMULSS64(int64 a, int64 b, int shift) {
|
||||
return ((a) * (b)) >> (shift);
|
||||
}
|
||||
|
||||
static INLINE uint32 BIGMULUS(uint32 a, uint32 b, int shift) {
|
||||
return (uint32)(((uint64)(a) * (uint64)(b)) >> (shift));
|
||||
}
|
||||
@@ -194,6 +199,7 @@ static INLINE int intxchg_(int *a, int b) { int t = *a; *a = b; return t; }
|
||||
#define intswap(a,b) ((b) = intxchg_(&(a), (b)))
|
||||
|
||||
static INLINE int myabs(int a) { if (a<0) a = -a; return a; }
|
||||
static INLINE int64 myabs64(int64 a) { if (a<0) a = -a; return a; }
|
||||
|
||||
static INLINE void swap_byte(byte *a, byte *b) { byte t = *a; *a = *b; *b = t; }
|
||||
static INLINE void swap_uint16(uint16 *a, uint16 *b) { uint16 t = *a; *a = *b; *b = t; }
|
||||
|
Reference in New Issue
Block a user