From d96cb9277ba9c17343ad4d2c435c0e37fe4c1da3 Mon Sep 17 00:00:00 2001 From: Reinder Feenstra Date: Fri, 30 Jun 2023 08:54:54 +0200 Subject: [PATCH] fixes for clang-tidy reported issues --- server/src/hardware/interface/dccplusplusinterface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/hardware/interface/dccplusplusinterface.cpp b/server/src/hardware/interface/dccplusplusinterface.cpp index 425d294f..39bbec3b 100644 --- a/server/src/hardware/interface/dccplusplusinterface.cpp +++ b/server/src/hardware/interface/dccplusplusinterface.cpp @@ -88,7 +88,7 @@ DCCPlusPlusInterface::DCCPlusPlusInterface(World& world, std::string_view _id) // update speedsteps of all decoders, DCC++ only has a global speedsteps setting const auto values = decoderSpeedSteps(DecoderProtocol::DCCShort); // identical for DCCLong assert(values.size() == 1); - for(auto& decoder : *decoders) + for(const auto& decoder : *decoders) { Attributes::setValues(decoder->speedSteps, values); decoder->speedSteps.setValueInternal(values.front()); @@ -114,6 +114,7 @@ std::pair DCCPlusPlusInterface::decoderAddressMinMax(Decoder tcb::span DCCPlusPlusInterface::decoderSpeedSteps(DecoderProtocol protocol) const { + (void)protocol; // silence unused warning for release build assert(protocol == DecoderProtocol::DCCShort || protocol == DecoderProtocol::DCCLong); const auto& speedStepValues = DCCPlusPlus::Settings::speedStepValues; // find value in array so we can create a span, using a span of a variable won't work due to the compare with prevous value in the attribute setter