From 7496aaf566ab16e2ea0632850e46c68c00522263 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 6 Apr 2022 11:52:44 -0400 Subject: [PATCH] Restyle --- src/access/AccessControl.h | 2 -- .../examples/ExampleAccessControlDelegate.cpp | 17 ----------------- src/app/AttributeCache.h | 2 -- src/app/BufferedReadCallback.h | 2 -- src/app/WriteHandler.h | 3 +-- src/app/util/ember-compatibility-functions.cpp | 2 +- src/controller/python/OpCredsBinding.cpp | 2 +- src/controller/tests/data_model/TestRead.cpp | 1 - src/credentials/GroupDataProviderImpl.cpp | 4 ++-- src/inet/IPAddress.h | 1 - src/inet/InetInterface.h | 1 - .../tests/TestMinimalMdnsAllocator.cpp | 2 +- src/messaging/ReliableMessageContext.h | 1 - src/messaging/ReliableMessageMgr.cpp | 6 ++---- src/messaging/ReliableMessageMgr.h | 1 - src/tools/chip-cert/CertUtils.cpp | 3 +-- src/transport/SessionHolder.cpp | 4 ++-- src/transport/raw/tests/TestTCP.cpp | 2 +- 18 files changed, 12 insertions(+), 44 deletions(-) diff --git a/src/access/AccessControl.h b/src/access/AccessControl.h index a7d0eb82cdd5a7..478ac2f66ea9c5 100644 --- a/src/access/AccessControl.h +++ b/src/access/AccessControl.h @@ -213,7 +213,6 @@ class AccessControl */ CHIP_ERROR RemoveTarget(size_t index) { return mDelegate->RemoveTarget(index); } - const Delegate & GetDelegate() const { return *mDelegate; } Delegate & GetDelegate() { return *mDelegate; } @@ -267,7 +266,6 @@ class AccessControl CHIP_ERROR Next(Entry & entry) { return mDelegate->Next(entry); } - const Delegate & GetDelegate() const { return *mDelegate; } Delegate & GetDelegate() { return *mDelegate; } diff --git a/src/access/examples/ExampleAccessControlDelegate.cpp b/src/access/examples/ExampleAccessControlDelegate.cpp index 5d25c5ce2d69a2..20432e725713d0 100644 --- a/src/access/examples/ExampleAccessControlDelegate.cpp +++ b/src/access/examples/ExampleAccessControlDelegate.cpp @@ -130,7 +130,6 @@ class SubjectStorage return CHIP_ERROR_INVALID_ARGUMENT; } - CHIP_ERROR Serialize(chip::TLV::TLVWriter & writer) const { return writer.Put(chip::TLV::AnonymousTag(), mNode); } CHIP_ERROR Deserialize(chip::TLV::TLVReader & reader) @@ -142,10 +141,8 @@ class SubjectStorage private: static bool IsValid(NodeId node) { return node != kUndefinedNodeId; } - static_assert(sizeof(NodeId) == 8, "Expecting 8 byte node ID"); - NodeId mNode; }; @@ -194,7 +191,6 @@ class TargetStorage return CHIP_ERROR_INVALID_ARGUMENT; } - CHIP_ERROR Serialize(chip::TLV::TLVWriter & writer) const { ReturnErrorOnFailure(writer.Put(chip::TLV::AnonymousTag(), mCluster)); @@ -241,7 +237,6 @@ class TargetStorage !((target.flags & Target::kDeviceType) && !IsValidDeviceType(target.deviceType)); } - void Decode(Target & target) const { auto & flags = target.flags; @@ -297,7 +292,6 @@ class TargetStorage } } - static_assert(sizeof(ClusterId) == 4, "Expecting 4 byte cluster ID"); static_assert(sizeof(EndpointId) == 2, "Expecting 2 byte endpoint ID"); static_assert(sizeof(DeviceTypeId) == 4, "Expecting 4 byte device type ID"); @@ -346,7 +340,6 @@ class TargetStorage // (mDeviceType >> kEndpointShift) --> extract endpoint from mDeviceType static constexpr int kEndpointShift = 16; - ClusterId mCluster; DeviceTypeId mDeviceType; }; @@ -390,7 +383,6 @@ class EntryStorage return nullptr; } - // Pool support static EntryStorage pool[kEntryStoragePoolSize]; @@ -419,7 +411,6 @@ class EntryStorage return pool <= this && this < end; } - EntryStorage() = default; void Init() @@ -457,7 +448,6 @@ class EntryStorage } } - enum class ConvertDirection { kAbsoluteToRelative, @@ -512,7 +502,6 @@ class EntryStorage index = found ? toIndex : ArraySize(acl); } - static constexpr uint8_t kTagInUse = 1; static constexpr uint8_t kTagFabricIndex = 2; static constexpr uint8_t kTagAuthMode = 3; @@ -598,7 +587,6 @@ class EntryStorage return reader.ExitContainer(container); } - static constexpr size_t kMaxSubjects = CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_SUBJECTS_PER_ENTRY; static constexpr size_t kMaxTargets = CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_TARGETS_PER_ENTRY; @@ -648,7 +636,6 @@ class EntryDelegate : public Entry::Delegate return pool <= &delegate && &delegate < end; } - void Release() override { mStorage->Release(); @@ -840,7 +827,6 @@ class EntryDelegate : public Entry::Delegate return CHIP_ERROR_SENTINEL; } - void Init(Entry & entry, EntryStorage & storage) { entry.SetDelegate(*this); @@ -922,7 +908,6 @@ class EntryIteratorDelegate : public EntryIterator::Delegate return pool <= &delegate && &delegate < end; } - void Release() override { mInUse = false; } CHIP_ERROR Next(Entry & entry) override @@ -963,7 +948,6 @@ class EntryIteratorDelegate : public EntryIterator::Delegate return CHIP_ERROR_SENTINEL; } - void Init(EntryIterator & iterator, const FabricIndex * fabricIndex) { iterator.SetDelegate(*this); @@ -1245,7 +1229,6 @@ class AccessControlDelegate : public AccessControl::Delegate return CHIP_ERROR_NOT_IMPLEMENTED; } - void SetStorageDelegate(chip::PersistentStorageDelegate * storageDelegate) { mStorageDelegate = storageDelegate; } private: diff --git a/src/app/AttributeCache.h b/src/app/AttributeCache.h index 6cba5f55e49f72..37e782dc613e71 100644 --- a/src/app/AttributeCache.h +++ b/src/app/AttributeCache.h @@ -338,7 +338,6 @@ class AttributeCache : protected ReadClient::Callback */ CHIP_ERROR UpdateCache(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus); - // // ReadClient::Callback // @@ -360,7 +359,6 @@ class AttributeCache : protected ReadClient::Callback return mCallback.OnDeallocatePaths(std::move(aReadPrepareParams)); } - Callback & mCallback; NodeState mCache; std::set mChangedAttributeSet; diff --git a/src/app/BufferedReadCallback.h b/src/app/BufferedReadCallback.h index 8f6c4433ba33d6..a4b2ce750a1038 100644 --- a/src/app/BufferedReadCallback.h +++ b/src/app/BufferedReadCallback.h @@ -63,7 +63,6 @@ class BufferedReadCallback : public ReadClient::Callback */ CHIP_ERROR BufferData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apReader); - // // ReadClient::Callback // @@ -84,7 +83,6 @@ class BufferedReadCallback : public ReadClient::Callback return mCallback.OnDeallocatePaths(std::move(aReadPrepareParams)); } - /* * Given a reader positioned at a list element, allocate a packet buffer, copy the list item where * the reader is positioned into that buffer and add it to our buffered list for tracking. diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index 8a9bf600604c82..e1091186c1c542 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -141,12 +141,11 @@ class WriteHandler : public Messaging::ExchangeDelegate */ void Close(); -// ExchangeDelegate + // ExchangeDelegate CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override; void OnResponseTimeout(Messaging::ExchangeContext * apExchangeContext) override; - Messaging::ExchangeContext * mpExchangeCtx = nullptr; WriteResponseMessage::Builder mWriteResponseBuilder; State mState = State::Uninitialized; diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 7c6c9490fd9a72..a45147bc96b945 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -323,7 +323,7 @@ void IncreaseClusterDataVersion(const ConcreteClusterPath & aConcreteClusterPath ChipLogDetail(DataManagement, "Endpoint %" PRIx16 ", Cluster " ChipLogFormatMEI " update version to %" PRIx32, aConcreteClusterPath.mEndpointId, ChipLogValueMEI(aConcreteClusterPath.mClusterId), *(version)); } - } +} CHIP_ERROR SendSuccessStatus(AttributeReportIB::Builder & aAttributeReport, AttributeDataIB::Builder & aAttributeDataIBBuilder) { diff --git a/src/controller/python/OpCredsBinding.cpp b/src/controller/python/OpCredsBinding.cpp index 59c959c41685df..8e4a5d31f8cff7 100644 --- a/src/controller/python/OpCredsBinding.cpp +++ b/src/controller/python/OpCredsBinding.cpp @@ -105,7 +105,7 @@ extern chip::Controller::ScriptDevicePairingDelegate sPairingDelegate; class TestCommissioner : public chip::Controller::AutoCommissioner { public: - TestCommissioner() { Reset(); } + TestCommissioner() { Reset(); } ~TestCommissioner() {} CHIP_ERROR SetCommissioningParameters(const chip::Controller::CommissioningParameters & params) override { diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index 443c2d680a7eaa..0eef610e9fe89e 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -212,7 +212,6 @@ class TestReadInteraction : public app::ReadHandler::ApplicationCallback // of reads in parallel and wait for them all to succeed. static void SubscribeThenReadHelper(nlTestSuite * apSuite, TestContext & aCtx, size_t aSubscribeCount, size_t aReadCount); - bool mEmitSubscriptionError = false; int32_t mNumActiveSubscriptions = 0; bool mAlterSubscriptionIntervals = false; diff --git a/src/credentials/GroupDataProviderImpl.cpp b/src/credentials/GroupDataProviderImpl.cpp index 171db9e88cb31e..25367f83e28868 100644 --- a/src/credentials/GroupDataProviderImpl.cpp +++ b/src/credentials/GroupDataProviderImpl.cpp @@ -384,7 +384,7 @@ struct GroupData : public GroupDataProvider::GroupInfo, PersistentData { public: - TestAllocator() + TestAllocator() { #if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC // void dmalloc_track(const dmalloc_track_t track_func) diff --git a/src/messaging/ReliableMessageContext.h b/src/messaging/ReliableMessageContext.h index 4b05c7fbcbdc80..19bfeca4e993c3 100644 --- a/src/messaging/ReliableMessageContext.h +++ b/src/messaging/ReliableMessageContext.h @@ -229,7 +229,6 @@ class ReliableMessageContext // will send that ack at some point. void SetPendingPeerAckMessageCounter(uint32_t aPeerAckMessageCounter); - friend class ReliableMessageMgr; friend class ExchangeContext; friend class ExchangeMessageDispatch; diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 4c0c66ec84d3ac..5dcad89fde520e 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -41,7 +41,7 @@ namespace chip { namespace Messaging { ReliableMessageMgr::RetransTableEntry::RetransTableEntry(ReliableMessageContext * rc) : - ec(*rc->GetExchangeContext()), nextRetransTime(0), sendCount(0) + ec(*rc->GetExchangeContext()), nextRetransTime(0), sendCount(0) { ec->SetMessageNotAcked(true); } @@ -89,9 +89,7 @@ void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) }); } #else -void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) -{ - } +void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) {} #endif // RMP_TICKLESS_DEBUG void ReliableMessageMgr::ExecuteActions() diff --git a/src/messaging/ReliableMessageMgr.h b/src/messaging/ReliableMessageMgr.h index fdac0eff5290ea..544c30e313746b 100644 --- a/src/messaging/ReliableMessageMgr.h +++ b/src/messaging/ReliableMessageMgr.h @@ -69,7 +69,6 @@ class ReliableMessageMgr including both successfully and failure send. */ }; - ReliableMessageMgr(BitMapObjectPool & contextPool); ~ReliableMessageMgr(); diff --git a/src/tools/chip-cert/CertUtils.cpp b/src/tools/chip-cert/CertUtils.cpp index c4f817ad717b3a..00a86e4d8c96f6 100644 --- a/src/tools/chip-cert/CertUtils.cpp +++ b/src/tools/chip-cert/CertUtils.cpp @@ -356,8 +356,7 @@ bool AddAuthorityKeyId(X509 * cert, X509 * caCert) int index = 0; std::unique_ptr akid(AUTHORITY_KEYID_new(), &AUTHORITY_KEYID_free); - akid->keyid = - reinterpret_cast(X509_get_ext_d2i(caCert, NID_subject_key_identifier, &isCritical, &index)); + akid->keyid = reinterpret_cast(X509_get_ext_d2i(caCert, NID_subject_key_identifier, &isCritical, &index)); if (akid->keyid == nullptr) { ReportOpenSSLErrorAndExit("X509_get_ext_d2i", res = false); diff --git a/src/transport/SessionHolder.cpp b/src/transport/SessionHolder.cpp index feabb1cb2ea8d2..df4987cfbb02f3 100644 --- a/src/transport/SessionHolder.cpp +++ b/src/transport/SessionHolder.cpp @@ -24,7 +24,7 @@ SessionHolder::~SessionHolder() Release(); } -SessionHolder::SessionHolder(const SessionHolder & that) +SessionHolder::SessionHolder(const SessionHolder & that) { mSession = that.mSession; if (mSession.HasValue()) @@ -33,7 +33,7 @@ SessionHolder::SessionHolder(const SessionHolder & that) } } -SessionHolder::SessionHolder(SessionHolder && that) +SessionHolder::SessionHolder(SessionHolder && that) { mSession = that.mSession; if (mSession.HasValue()) diff --git a/src/transport/raw/tests/TestTCP.cpp b/src/transport/raw/tests/TestTCP.cpp index 1c15f9edb47ab7..5add4e15081b05 100644 --- a/src/transport/raw/tests/TestTCP.cpp +++ b/src/transport/raw/tests/TestTCP.cpp @@ -238,7 +238,7 @@ struct TestData // `sizes[]` is a zero-terminated sequence of packet buffer sizes. // If total length supplied is not large enough for at least the PacketHeader and length field, // the last buffer will be made larger. - TestData() : mPayload(nullptr), mTotalLength(0), mMessageLength(0), mMessageOffset(0) {} + TestData() : mPayload(nullptr), mTotalLength(0), mMessageLength(0), mMessageOffset(0) {} ~TestData() { Free(); } bool Init(const uint16_t sizes[]); void Free();