diff options
author | rubidium <rubidium@openttd.org> | 2007-10-20 14:51:09 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-10-20 14:51:09 +0000 |
commit | 8212088c03c0a0af451f734391699e5dab8d8608 (patch) | |
tree | 28fbe813d418b83e119aa615200f98b20ba520c8 /src/openttd.h | |
parent | 54369cba0f9d1cda2d40752eb337d153b3b6775f (diff) | |
download | openttd-8212088c03c0a0af451f734391699e5dab8d8608.tar.xz |
(svn r11312) -Codechange: implement a overflow safe integer and use that for money and don't misuses CommandCost to have a overflow safe integer. Based on a patch by Noldo.
Diffstat (limited to 'src/openttd.h')
-rw-r--r-- | src/openttd.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openttd.h b/src/openttd.h index 5514c2165..2fdf8e0a9 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -69,7 +69,9 @@ typedef uint16 SignID; typedef uint16 GroupID; typedef uint16 EngineRenewID; typedef uint16 DestinationID; -typedef int64 Money; + +typedef OverflowSafeInt<int64, INT64_MAX, INT64_MIN> OverflowSafeInt64; +typedef OverflowSafeInt64 Money; /* DestinationID must be at least as large as every these below, because it can * be any of them |