From 11f4bf8a9afe109aaed0e53133781694a735e225 Mon Sep 17 00:00:00 2001 From: vperus Date: Fri, 17 Dec 2021 20:51:47 +0200 Subject: [input_common] Move variable declaration closer to usage MSVC supplied with VS2022 generates "warning C4189: 'CALIBRATION_THRESHOLD': local variable is initialized but not referenced" which is treated as an error. Circumvent it by moving constexpr variable directly into body of lambda function. --- src/input_common/drivers/udp_client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/input_common') diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp index 730e8b2f3..d6172527c 100644 --- a/src/input_common/drivers/udp_client.cpp +++ b/src/input_common/drivers/udp_client.cpp @@ -536,8 +536,6 @@ CalibrationConfigurationJob::CalibrationConfigurationJob( std::function data_callback) { std::thread([=, this] { - constexpr u16 CALIBRATION_THRESHOLD = 100; - u16 min_x{UINT16_MAX}; u16 min_y{UINT16_MAX}; u16 max_x{}; @@ -546,6 +544,8 @@ CalibrationConfigurationJob::CalibrationConfigurationJob( Status current_status{Status::Initialized}; SocketCallback callback{[](Response::Version) {}, [](Response::PortInfo) {}, [&](Response::PadData data) { + constexpr u16 CALIBRATION_THRESHOLD = 100; + if (current_status == Status::Initialized) { // Receiving data means the communication is ready now current_status = Status::Ready; -- cgit v1.2.3