From 2e46dcf582e1cc768883e3be9fefe259efe3328f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 6 Feb 2025 16:10:45 +1100 Subject: [PATCH] AP_HAL_SITL: remove unused variables from RCInput In file included from ../../libraries/AP_HAL_SITL/RCInput.cpp:6: ../../libraries/AP_HAL_SITL/RCInput.h:22:17: warning: private field '_sitlState' is not used [-Wunused-private-field] 22 | SITL_State *_sitlState; | ^ ../../libraries/AP_HAL_SITL/RCInput.h:23:10: warning: private field 'using_rc_protocol' is not used [-Wunused-private-field] 23 | bool using_rc_protocol; | ^ --- libraries/AP_HAL_SITL/HAL_SITL_Class.cpp | 2 +- libraries/AP_HAL_SITL/RCInput.h | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp b/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp index be72972e26..52392c155f 100644 --- a/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp +++ b/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp @@ -42,7 +42,7 @@ static Storage sitlStorage; static SITL_State sitlState; static Scheduler sitlScheduler(&sitlState); #if AP_RCPROTOCOL_ENABLED -static RCInput sitlRCInput(&sitlState); +static RCInput sitlRCInput; #else static Empty::RCInput sitlRCInput; #endif diff --git a/libraries/AP_HAL_SITL/RCInput.h b/libraries/AP_HAL_SITL/RCInput.h index b327c87d4e..1b9ee5c8a9 100644 --- a/libraries/AP_HAL_SITL/RCInput.h +++ b/libraries/AP_HAL_SITL/RCInput.h @@ -9,7 +9,7 @@ class HALSITL::RCInput : public AP_HAL::RCInput { public: - explicit RCInput(SITL_State *sitlState): _sitlState(sitlState) {} + explicit RCInput() {} void init() override; bool new_input() override; uint8_t num_channels() override; @@ -17,10 +17,6 @@ public: uint8_t read(uint16_t* periods, uint8_t len) override; const char *protocol() const override { return "SITL"; } - -private: - SITL_State *_sitlState; - bool using_rc_protocol; }; #endif