From a0216da9221d4606e6a1030b622a170021856098 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 11 May 2021 05:09:43 +0000 Subject: [PATCH] Restyled by clang-format --- src/lib/mdns/platform/Mdns.h | 9 ++++----- src/platform/Linux/MdnsImpl.cpp | 2 +- .../GenericThreadStackManagerImpl_OpenThread.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/mdns/platform/Mdns.h b/src/lib/mdns/platform/Mdns.h index 778fcb19f643ee..cdbd08bace9c34 100644 --- a/src/lib/mdns/platform/Mdns.h +++ b/src/lib/mdns/platform/Mdns.h @@ -35,12 +35,11 @@ namespace chip { namespace Mdns { -static constexpr uint8_t kMdnsNameMaxSize = 33; // [Node]-[Fabric] ID in hex - 16+1+16 -static constexpr uint8_t kMdnsProtocolTextMaxSize = 4; // "_tcp" or "_udp" -static constexpr uint8_t kMdnsTypeMaxSize = 6; // "_chip", "_chipc" or "_chipd" +static constexpr uint8_t kMdnsNameMaxSize = 33; // [Node]-[Fabric] ID in hex - 16+1+16 +static constexpr uint8_t kMdnsProtocolTextMaxSize = 4; // "_tcp" or "_udp" +static constexpr uint8_t kMdnsTypeMaxSize = 6; // "_chip", "_chipc" or "_chipd" static constexpr uint8_t kMdnsTypeAndProtocolMaxSize = kMdnsTypeMaxSize + kMdnsProtocolTextMaxSize + 1; // . -static constexpr uint8_t kMdnsTextKeyMaxSize = 9; -static constexpr uint16_t kMdnsTextMaxSize = 64; +static constexpr uint16_t kMdnsTextMaxSize = 64; enum class MdnsServiceProtocol : uint8_t { diff --git a/src/platform/Linux/MdnsImpl.cpp b/src/platform/Linux/MdnsImpl.cpp index 474238f62b0d0f..982fc5b76ed112 100644 --- a/src/platform/Linux/MdnsImpl.cpp +++ b/src/platform/Linux/MdnsImpl.cpp @@ -84,7 +84,7 @@ CHIP_ERROR MakeAvahiStringListFromTextEntries(TextEntry * entries, size_t size, for (size_t i = 0; i < size; i++) { - uint8_t buf[kMdnsTextKeyMaxSize + 1 + 1]; + uint8_t buf[chip::Mdns::kMdnsTextMaxSize]; size_t offset = static_cast(snprintf(reinterpret_cast(buf), sizeof(buf), "%s=", entries[i].mKey)); if (offset + entries[i].mDataSize > sizeof(buf)) diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index 39ac2f7ceaea19..c5e6ecaca1c5fb 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -121,7 +121,7 @@ class GenericThreadStackManagerImpl_OpenThread { static constexpr uint8_t kMaxServicesNumber = CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES; static constexpr uint8_t kMaxInstanceNameSize = chip::Mdns::kMdnsNameMaxSize; - static constexpr uint8_t kMaxNameSize = chip::Mdns::kMdnsTypeAndProtocolMaxSize + 1; + static constexpr uint8_t kMaxNameSize = chip::Mdns::kMdnsTypeAndProtocolMaxSize; static constexpr uint8_t kMaxHostNameSize = 16; // Thread only supports operational discovery static constexpr uint8_t kMaxTxtEntriesNumber = chip::Mdns::OperationalAdvertisingParameters::kNumAdvertisingTxtEntries;