- Index: src/rail_cmd.cpp
- ===================================================================
- --- src/rail_cmd.cpp (revision 27688)
- +++ src/rail_cmd.cpp (working copy)
- @@ -68,7 +68,9 @@
- 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;
- + for (; i < lengthof(_railtypes); i++) _railtypes[i] = empty_railtype;
- }
- void ResolveRailTypeGUISprites(RailtypeInfo *rti)
- src/rail_cmd.cpp: In function ‘void ResetRailTypes()’:
- src/rail_cmd.cpp:72:28: error: uninitialized const ‘empty_railtype’ [-fpermissive]
- static const RailtypeInfo empty_railtype;
- ^
- In file included from src/station_func.h:20:0,
- from src/station_map.h:18,
- from src/depot_map.h:15,
- from src/depot_base.h:15,
- from src/rail_cmd.cpp:16:
- src/rail.h:116:7: note: ‘const class RailtypeInfo’ has no user-provided default constructor
- class RailtypeInfo {
- ^
- src/rail.h:123:12: note: and the implicitly-defined constructor does not initialize ‘SpriteID RailtypeInfo::<anonymous struct>::track_y’
- SpriteID track_y; ///< single piece of rail in Y direction, with ground
- ^
- Makefile:234: recipe for target 'rail_cmd.o' failed