diff options
author | frosch <frosch@openttd.org> | 2016-12-10 15:49:25 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-12-10 15:49:25 +0000 |
commit | 69966b6322b99d2336c76a91525f0b18b36e17f9 (patch) | |
tree | cb17b415edf7bae6cb2eadf99ba8d880ae11801e /src | |
parent | 149adc9cc1b1ffa4b1a37e17deec72b0b6004337 (diff) | |
download | openttd-69966b6322b99d2336c76a91525f0b18b36e17f9.tar.xz |
(svn r27690) -Fix: Old compilers do not zero-initialise POD members when explicitly calling implicitly created default constructors.
Diffstat (limited to 'src')
-rw-r--r-- | src/rail_cmd.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 511f5abc7..a8c20e339 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -68,7 +68,16 @@ void ResetRailTypes() uint i = 0; for (; i < lengthof(_original_railtypes); i++) _railtypes[i] = _original_railtypes[i]; - for (; i < lengthof(_railtypes); i++) _railtypes[i] = RailtypeInfo(); // zero-init + + static const RailtypeInfo empty_railtype = { + {0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,{}}, + {0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0}, + 0, RAILTYPES_NONE, RAILTYPES_NONE, 0, 0, 0, RTFB_NONE, 0, 0, 0, 0, 0, + RailTypeLabelList(), 0, 0, RAILTYPES_NONE, RAILTYPES_NONE, 0, + {}, {} }; + for (; i < lengthof(_railtypes); i++) _railtypes[i] = empty_railtype; } void ResolveRailTypeGUISprites(RailtypeInfo *rti) |