diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2019-03-25 22:45:32 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-26 20:54:40 +0000 |
commit | e453572b6ab9feeacd4fcbd660d954aec44c4777 (patch) | |
tree | 16a6f46f81608733f50b29cf07b53b808fcf599d /src | |
parent | 03ca3190c9b73de3e43fe1e7e2293b8c1e3aa3d5 (diff) | |
download | openttd-e453572b6ab9feeacd4fcbd660d954aec44c4777.tar.xz |
Codechange: Initialise a few variables that -flto seems to think could possibly be uninitialised
Diffstat (limited to 'src')
-rw-r--r-- | src/order_base.h | 2 | ||||
-rw-r--r-- | src/strings.cpp | 3 | ||||
-rw-r--r-- | src/vehicle_cmd.cpp | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/order_base.h b/src/order_base.h index 0def7b0bc..b11c20d8e 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -50,7 +50,7 @@ private: public: Order *next; ///< Pointer to next order. If NULL, end of list - Order() : refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {} + Order() : flags(0), refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {} ~Order(); Order(uint32 packed); diff --git a/src/strings.cpp b/src/strings.cpp index 204c68c20..c3669e5dc 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -118,7 +118,8 @@ void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size) */ void SetDParamMaxDigits(uint n, uint count, FontSize size) { - uint front, next; + uint front = 0; + uint next = 0; GetBroadestDigit(&front, &next, size); uint64 val = count > 1 ? front : next; for (; count > 1; count--) { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 919173ac1..059f60837 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -131,7 +131,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint DoCommandFlag subflags = flags; if (refitting) subflags |= DC_EXEC; - Vehicle *v; + Vehicle *v = NULL; switch (type) { case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(tile, subflags, e, GB(p1, 24, 8), &v)); break; case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(tile, subflags, e, GB(p1, 24, 8), &v)); break; |