From f83fa88512dfc01a7c15c40eca34ddbe391aa7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 2 Mar 2019 21:22:52 +0100 Subject: [PATCH] Fix printing of non-POD NetworkRideId_t The underlying type is using int32_t rather than uint32_t, so reflect that as well --- src/openrct2/actions/RideEntranceExitPlaceAction.hpp | 6 +++--- .../actions/RideEntranceExitRemoveAction.hpp | 12 +++++++----- src/openrct2/actions/RideSetSetting.hpp | 6 +++--- src/openrct2/actions/TrackPlaceAction.hpp | 10 +++++----- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp index 8ef9533354..11dd51083f 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp @@ -62,14 +62,14 @@ public: if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL) { - log_warning("Invalid game command for ride %u", _rideIndex); + log_warning("Invalid game command for ride %d", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, errorTitle); } Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid game command for ride %u", _rideIndex); + log_warning("Invalid game command for ride %d", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, errorTitle); } @@ -152,7 +152,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid game command for ride %u", _rideIndex); + log_warning("Invalid game command for ride %d", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, errorTitle); } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.hpp b/src/openrct2/actions/RideEntranceExitRemoveAction.hpp index 7e8d10fa0f..c13f1deaa3 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.hpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.hpp @@ -49,14 +49,14 @@ public: { if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL) { - log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); + log_warning("Invalid game command for ride %d", int32_t(_rideIndex)); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride id %u for entrance/exit removal", _rideIndex); + log_warning("Invalid ride id %d for entrance/exit removal", (int32_t)_rideIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } @@ -106,7 +106,8 @@ public: if (!found) { log_warning( - "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, _rideIndex, _stationNum); + "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, (int32_t)_rideIndex, + _stationNum); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } @@ -118,7 +119,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride id %u for entrance/exit removal", _rideIndex); + log_warning("Invalid ride id %d for entrance/exit removal", (int32_t)_rideIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } @@ -162,7 +163,8 @@ public: if (!found) { log_warning( - "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, _rideIndex, _stationNum); + "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, (int32_t)_rideIndex, + _stationNum); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } diff --git a/src/openrct2/actions/RideSetSetting.hpp b/src/openrct2/actions/RideSetSetting.hpp index f0a8022e60..6478bde798 100644 --- a/src/openrct2/actions/RideSetSetting.hpp +++ b/src/openrct2/actions/RideSetSetting.hpp @@ -62,14 +62,14 @@ public: { if (_rideIndex >= MAX_RIDES || _rideIndex < 0) { - log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); + log_warning("Invalid game command for ride %d", int32_t(_rideIndex)); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_OPERATING_MODE); } Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride: #%u.", _rideIndex); + log_warning("Invalid ride: #%d.", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_OPERATING_MODE); } @@ -174,7 +174,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride: #%u.", _rideIndex); + log_warning("Invalid ride: #%d.", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_OPERATING_MODE); } diff --git a/src/openrct2/actions/TrackPlaceAction.hpp b/src/openrct2/actions/TrackPlaceAction.hpp index 70dbd29803..74dab23c72 100644 --- a/src/openrct2/actions/TrackPlaceAction.hpp +++ b/src/openrct2/actions/TrackPlaceAction.hpp @@ -67,20 +67,20 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } if (ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride type, rideIndex = %d", _rideIndex); + log_warning("Invalid ride type, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - log_warning("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -414,7 +414,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); } @@ -422,7 +422,7 @@ public: rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - log_warning("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); }