diff options
author | rubidium <rubidium@openttd.org> | 2007-06-19 00:05:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-06-19 00:05:26 +0000 |
commit | 16ce2192e45cbc4d2ba01267578ea5c3943caf0f (patch) | |
tree | b07b07a2f5f04c71f8608530c990ebe9bdf603e1 /src/macros.h | |
parent | 23af871615557914fd36744afe46a93a360603ce (diff) | |
download | openttd-16ce2192e45cbc4d2ba01267578ea5c3943caf0f.tar.xz |
(svn r10212) -Fix [FS#723]: money overflow bugs in many locations.
Diffstat (limited to 'src/macros.h')
-rw-r--r-- | src/macros.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h index 7b8b8dba6..c10ef4d49 100644 --- a/src/macros.h +++ b/src/macros.h @@ -26,6 +26,12 @@ static inline T max(T a, T b) return a >= b ? a : b; } +template <typename T> +static inline T min(T a, T b) +{ + return a < b ? a : b; +} + static inline int min(int a, int b) { if (a <= b) return a; return b; } static inline uint minu(uint a, uint b) { if (a <= b) return a; return b; } |