Loading

Paste #pkijmq3kz

  1. Index: src/rail_cmd.cpp
  2. ===================================================================
  3. --- src/rail_cmd.cpp    (revision 27688)
  4. +++ src/rail_cmd.cpp    (working copy)
  5. @@ -68,7 +68,9 @@
  6.  
  7.         uint i = 0;
  8.         for (; i < lengthof(_original_railtypes); i++) _railtypes[i] = _original_railtypes[i];
  9. -       for (; i < lengthof(_railtypes);          i++) _railtypes[i] = RailtypeInfo(); // zero-init
  10. +
  11. +       static const RailtypeInfo empty_railtype;
  12. +       for (; i < lengthof(_railtypes);          i++) _railtypes[i] = empty_railtype;
  13.  }
  14.  
  15.  void ResolveRailTypeGUISprites(RailtypeInfo *rti)
  16.  
  17.  
  18.  
  19.  
  20. src/rail_cmd.cpp: In function ‘void ResetRailTypes()’:
  21. src/rail_cmd.cpp:72:28: error: uninitialized const ‘empty_railtype’ [-fpermissive]
  22.   static const RailtypeInfo empty_railtype;
  23.                             ^
  24. In file included from src/station_func.h:20:0,
  25.                  from src/station_map.h:18,
  26.                  from src/depot_map.h:15,
  27.                  from src/depot_base.h:15,
  28.                  from src/rail_cmd.cpp:16:
  29. src/rail.h:116:7: note: ‘const class RailtypeInfo’ has no user-provided default constructor
  30.  class RailtypeInfo {
  31.        ^
  32. src/rail.h:123:12: note: and the implicitly-defined constructor does not initialize ‘SpriteID RailtypeInfo::<anonymous struct>::track_y’
  33.    SpriteID track_y;      ///< single piece of rail in Y direction, with ground
  34.             ^
  35. Makefile:234: recipe for target 'rail_cmd.o' failed

Comments