From d0a82ce26372badd8d843e4be4d8a8b8e6d6b49d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 22 Feb 2024 13:32:06 -0500 Subject: [PATCH] Minor updates based on clang-tidy feedback --- src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp | 2 +- src/lib/shell/commands/Dns.cpp | 2 +- src/lib/support/tests/TestIniEscaping.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp b/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp index 0249d80d6e35ff..d9b1ed04267a5d 100644 --- a/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp +++ b/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp @@ -41,7 +41,7 @@ RecordWriter & RecordWriter::WriteQName(const FullQName & qname) size_t qNameWriteStart = mOutput->WritePos(); bool isFullyCompressed = true; - for (uint16_t i = 0; i < qname.nameCount; i++) + for (uint16_t i = 0; i < static_cast(qname.nameCount); i++) { // find out if the record part remaining already is located somewhere diff --git a/src/lib/shell/commands/Dns.cpp b/src/lib/shell/commands/Dns.cpp index badd6681fceec3..6abb2dc0393fec 100644 --- a/src/lib/shell/commands/Dns.cpp +++ b/src/lib/shell/commands/Dns.cpp @@ -131,7 +131,7 @@ class DnsShellResolverDelegate : public Dnssd::CommissioningResolveDelegate, pub nodeData.resolutionData.isICDOperatingAsLIT.Value() ? "LIT" : "SIT"); } streamer_printf(streamer_get(), " IP addresses:\r\n"); - for (uint8_t i = 0; i < nodeData.resolutionData.numIPs; i++) + for (size_t i = 0; i < nodeData.resolutionData.numIPs; i++) { streamer_printf(streamer_get(), " %s\r\n", nodeData.resolutionData.ipAddress[i].ToString(ipAddressBuf)); } diff --git a/src/lib/support/tests/TestIniEscaping.cpp b/src/lib/support/tests/TestIniEscaping.cpp index 44f8b37058b3cb..784a8fffdcb156 100644 --- a/src/lib/support/tests/TestIniEscaping.cpp +++ b/src/lib/support/tests/TestIniEscaping.cpp @@ -45,7 +45,6 @@ void TestUnescaping(nlTestSuite * inSuite, void * inContext) // Test valid cases NL_TEST_ASSERT(inSuite, UnescapeKey("") == ""); NL_TEST_ASSERT(inSuite, UnescapeKey("abcd1234,!") == "abcd1234,!"); - std::string out = UnescapeKey("abcd1234,!"); NL_TEST_ASSERT(inSuite, UnescapeKey("ab\\x0acd\\x20\\x3d12\\x5c34\\x7f") == "ab\ncd =12\\34\x7f"); NL_TEST_ASSERT(inSuite, UnescapeKey("\\x20") == " "); NL_TEST_ASSERT(inSuite, UnescapeKey("\\x3d\\x3d\\x3d") == "===");