Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and Damian-Nordic committed Oct 15, 2021
1 parent eb406b1 commit 325b60f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
28 changes: 17 additions & 11 deletions src/lib/dnssd/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-dig

namespace Operational {

constexpr auto kSubTypeLengths = { kSubTypeCompressedFabricIdMaxLength };
#define SUBTYPES (std::initializer_list<size_t>{ kSubTypeCompressedFabricIdMaxLength })

constexpr size_t kInstanceNameMaxLength = 33; // <NodeId>-<FabricId> in hex (16 + 1 + 16)
constexpr size_t kSubTypeMaxNumber = kSubTypeLengths.size();
constexpr size_t kSubTypeMaxLength = std::max(kSubTypeLengths);
constexpr size_t kSubTypeTotalLength = chip::Sum(kSubTypeLengths);
constexpr size_t kSubTypeMaxNumber = SUBTYPES.size();
constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES);

#undef SUBTYPES

} // namespace Operational

Expand All @@ -63,14 +66,17 @@ constexpr size_t kSubTypeTotalLength = chip::Sum(kSubTypeLengths);

namespace Commissionable {

constexpr auto kSubTypeLengths = {
kSubTypeShortDiscriminatorMaxLength, kSubTypeLongDiscriminatorMaxLength, kSubTypeVendorMaxLength,
kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength, kSubTypeAdditionalCommissioningMaxLength
};
#define SUBTYPES \
(std::initializer_list<size_t>{ kSubTypeShortDiscriminatorMaxLength, kSubTypeLongDiscriminatorMaxLength, \
kSubTypeVendorMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength, \
kSubTypeAdditionalCommissioningMaxLength })

constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex
constexpr size_t kSubTypeMaxNumber = kSubTypeLengths.size();
constexpr size_t kSubTypeMaxLength = std::max(kSubTypeLengths);
constexpr size_t kSubTypeTotalLength = chip::Sum(kSubTypeLengths);
constexpr size_t kSubTypeMaxNumber = SUBTYPES.size();
constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES);

#undef SUBTYPES

} // namespace Commissionable

Expand Down
4 changes: 2 additions & 2 deletions src/lib/support/tests/TestFold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace {

void TestFoldMax(nlTestSuite * inSuite, void * inContext)
{
using List = std::initializer_list<int>;
using Limits = std::numeric_limits<int>;
using List = std::initializer_list<int>;
using Limits = std::numeric_limits<int>;
const auto max = [](int left, int right) { return std::max(left, right); };

// Test empty list
Expand Down

0 comments on commit 325b60f

Please sign in to comment.