From 8e439b98950b09f9578c59c59650331b0633d011 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Tue, 21 Jun 2022 22:48:29 +0200 Subject: [PATCH] Zero-initialize all command arguments --- src/openrct2/title/Command/FollowEntity.h | 4 ++-- src/openrct2/title/Command/LoadPark.h | 2 +- src/openrct2/title/Command/LoadScenario.h | 2 +- src/openrct2/title/Command/RotateView.h | 2 +- src/openrct2/title/Command/SetSpeed.h | 2 +- src/openrct2/title/Command/SetZoom.h | 2 +- src/openrct2/title/Command/Wait.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2/title/Command/FollowEntity.h b/src/openrct2/title/Command/FollowEntity.h index e76b6c7eff..0fbb7a5908 100644 --- a/src/openrct2/title/Command/FollowEntity.h +++ b/src/openrct2/title/Command/FollowEntity.h @@ -24,8 +24,8 @@ namespace OpenRCT2::Title struct { - EntityId SpriteIndex; - utf8 SpriteName[USER_STRING_MAX_LENGTH]; + EntityId SpriteIndex{ EntityId::GetNull() }; + utf8 SpriteName[USER_STRING_MAX_LENGTH]{}; } Follow; int16_t operator()(int16_t timer); diff --git a/src/openrct2/title/Command/LoadPark.h b/src/openrct2/title/Command/LoadPark.h index c2c2986aec..8198f8a184 100644 --- a/src/openrct2/title/Command/LoadPark.h +++ b/src/openrct2/title/Command/LoadPark.h @@ -18,7 +18,7 @@ namespace OpenRCT2::Title static constexpr const char* Name = "Load Park Command"; static constexpr const char* ScriptingName = "load"; - uint8_t SaveIndex; + uint8_t SaveIndex{}; int16_t operator()(int16_t timer); }; diff --git a/src/openrct2/title/Command/LoadScenario.h b/src/openrct2/title/Command/LoadScenario.h index 27fa347481..62b96e90e7 100644 --- a/src/openrct2/title/Command/LoadScenario.h +++ b/src/openrct2/title/Command/LoadScenario.h @@ -22,7 +22,7 @@ namespace OpenRCT2::Title static constexpr const char* Name = "Load Scenario Command"; static constexpr const char* ScriptingName = "loadsc"; - utf8 Scenario[TITLE_COMMAND_SCENARIO_LENGTH]; + utf8 Scenario[TITLE_COMMAND_SCENARIO_LENGTH]{}; int16_t operator()(int16_t timer); }; diff --git a/src/openrct2/title/Command/RotateView.h b/src/openrct2/title/Command/RotateView.h index 87253c03bd..c3bf0bb423 100644 --- a/src/openrct2/title/Command/RotateView.h +++ b/src/openrct2/title/Command/RotateView.h @@ -18,7 +18,7 @@ namespace OpenRCT2::Title static constexpr const char* Name = "Rotate View Command"; static constexpr const char* ScriptingName = "rotate"; - uint8_t Rotations; + uint8_t Rotations{}; int16_t operator()(int16_t timer); }; diff --git a/src/openrct2/title/Command/SetSpeed.h b/src/openrct2/title/Command/SetSpeed.h index 01297cbba9..36d5e7daf0 100644 --- a/src/openrct2/title/Command/SetSpeed.h +++ b/src/openrct2/title/Command/SetSpeed.h @@ -18,7 +18,7 @@ namespace OpenRCT2::Title static constexpr const char* Name = "Set Speed Command"; static constexpr const char* ScriptingName = "speed"; - uint8_t Speed; + uint8_t Speed{}; int16_t operator()(int16_t timer); }; diff --git a/src/openrct2/title/Command/SetZoom.h b/src/openrct2/title/Command/SetZoom.h index e0347c39b9..70374fac86 100644 --- a/src/openrct2/title/Command/SetZoom.h +++ b/src/openrct2/title/Command/SetZoom.h @@ -19,7 +19,7 @@ namespace OpenRCT2::Title static constexpr const char* ScriptingName = "zoom"; // TODO: Use ZoomLevel instead - uint8_t Zoom; + uint8_t Zoom{}; int16_t operator()(int16_t timer); }; diff --git a/src/openrct2/title/Command/Wait.h b/src/openrct2/title/Command/Wait.h index 1da57e5b48..9bc216955c 100644 --- a/src/openrct2/title/Command/Wait.h +++ b/src/openrct2/title/Command/Wait.h @@ -18,7 +18,7 @@ namespace OpenRCT2::Title static constexpr const char* Name = "Wait Command"; static constexpr const char* ScriptingName = "wait"; - uint16_t Milliseconds; + uint16_t Milliseconds{}; int16_t operator()(int16_t timer); };