diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 81a586c0a32e4a..2ea2d79c7d4ae5 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -118,7 +118,7 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack() chip::FabricId fabricId = strtoull(name.c_str(), nullptr, 0); if (fabricId >= kIdentityOtherFabricId) { - ReturnLogErrorOnFailure(InitializeCommissioner(name.c_str(), fabricId, trustStore)); + ReturnLogErrorOnFailure(InitializeCommissioner(name, fabricId, trustStore)); } // Initialize Group Data, including IPK @@ -168,7 +168,7 @@ CHIP_ERROR CHIPCommand::MaybeTearDownStack() chip::FabricId fabricId = strtoull(name.c_str(), nullptr, 0); if (fabricId >= kIdentityOtherFabricId) { - ReturnLogErrorOnFailure(ShutdownCommissioner(name.c_str())); + ReturnLogErrorOnFailure(ShutdownCommissioner(name)); } StopTracing(); @@ -286,7 +286,7 @@ chip::FabricId CHIPCommand::CurrentCommissionerId() chip::Controller::DeviceCommissioner & CHIPCommand::CurrentCommissioner() { auto item = mCommissioners.find(GetIdentity()); - return *item->second.get(); + return *item->second; } CHIP_ERROR CHIPCommand::ShutdownCommissioner(std::string key) diff --git a/examples/chip-tool/commands/common/Commands.cpp b/examples/chip-tool/commands/common/Commands.cpp index fcc7137a240e63..c7f8fd1a3dcec6 100644 --- a/examples/chip-tool/commands/common/Commands.cpp +++ b/examples/chip-tool/commands/common/Commands.cpp @@ -310,7 +310,7 @@ void Commands::ShowCommand(std::string executable, std::string clusterName, Comm { fprintf(stderr, "Usage:\n"); - std::string arguments = ""; + std::string arguments; arguments += command->GetName(); size_t argumentsCount = command->GetArgumentsCount(); diff --git a/src/access/AccessControl.h b/src/access/AccessControl.h index dc67e89856e1ed..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); } - public: 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); } - public: 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 d7b234343ade48..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; } -public: 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; } -private: static_assert(sizeof(NodeId) == 8, "Expecting 8 byte node ID"); -private: NodeId mNode; }; @@ -194,7 +191,6 @@ class TargetStorage return CHIP_ERROR_INVALID_ARGUMENT; } -public: 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)); } -private: void Decode(Target & target) const { auto & flags = target.flags; @@ -297,7 +292,6 @@ class TargetStorage } } -private: 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; -private: ClusterId mCluster; DeviceTypeId mDeviceType; }; @@ -390,7 +383,6 @@ class EntryStorage return nullptr; } -public: // Pool support static EntryStorage pool[kEntryStoragePoolSize]; @@ -419,7 +411,6 @@ class EntryStorage return pool <= this && this < end; } -public: EntryStorage() = default; void Init() @@ -457,7 +448,6 @@ class EntryStorage } } -public: enum class ConvertDirection { kAbsoluteToRelative, @@ -512,7 +502,6 @@ class EntryStorage index = found ? toIndex : ArraySize(acl); } -public: 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); } -public: 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; } -public: void Release() override { mStorage->Release(); @@ -840,7 +827,6 @@ class EntryDelegate : public Entry::Delegate return CHIP_ERROR_SENTINEL; } -public: void Init(Entry & entry, EntryStorage & storage) { entry.SetDelegate(*this); @@ -922,7 +908,6 @@ class EntryIteratorDelegate : public EntryIterator::Delegate return pool <= &delegate && &delegate < end; } -public: void Release() override { mInUse = false; } CHIP_ERROR Next(Entry & entry) override @@ -963,7 +948,6 @@ class EntryIteratorDelegate : public EntryIterator::Delegate return CHIP_ERROR_SENTINEL; } -public: void Init(EntryIterator & iterator, const FabricIndex * fabricIndex) { iterator.SetDelegate(*this); @@ -1245,7 +1229,6 @@ class AccessControlDelegate : public AccessControl::Delegate return CHIP_ERROR_NOT_IMPLEMENTED; } -public: void SetStorageDelegate(chip::PersistentStorageDelegate * storageDelegate) { mStorageDelegate = storageDelegate; } private: diff --git a/src/app/AttributeCache.h b/src/app/AttributeCache.h index f9143d5e2ab504..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); -private: // // ReadClient::Callback // @@ -360,7 +359,6 @@ class AttributeCache : protected ReadClient::Callback return mCallback.OnDeallocatePaths(std::move(aReadPrepareParams)); } -private: Callback & mCallback; NodeState mCache; std::set mChangedAttributeSet; diff --git a/src/app/BufferedReadCallback.h b/src/app/BufferedReadCallback.h index 5f88ebdaa12c14..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); -private: // // ReadClient::Callback // @@ -84,7 +83,6 @@ class BufferedReadCallback : public ReadClient::Callback return mCallback.OnDeallocatePaths(std::move(aReadPrepareParams)); } -private: /* * 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/ReadClient.cpp b/src/app/ReadClient.cpp index 47a097b7b310da..f06af4f1a87335 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -69,7 +69,6 @@ static void DefaultResubscribePolicy(uint32_t aNumCumulativeRetries, uint32_t & "Computing Resubscribe policy: attempts %" PRIu32 ", max wait time %" PRIu32 " ms, selected wait time %" PRIu32 " ms", aNumCumulativeRetries, maxWaitTimeInMsec, waitTimeInMsec); - return; } ReadClient::ReadClient(InteractionModelEngine * apImEngine, Messaging::ExchangeManager * apExchangeMgr, Callback & apCallback, diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index 6b820282cecf79..e1091186c1c542 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -141,12 +141,11 @@ class WriteHandler : public Messaging::ExchangeDelegate */ void Close(); -private: // ExchangeDelegate + // ExchangeDelegate CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override; void OnResponseTimeout(Messaging::ExchangeContext * apExchangeContext) override; -private: Messaging::ExchangeContext * mpExchangeCtx = nullptr; WriteResponseMessage::Builder mWriteResponseBuilder; State mState = State::Uninitialized; diff --git a/src/app/util/af.h b/src/app/util/af.h index 8b9efc516debf1..1b932867c8eeac 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -597,11 +597,6 @@ uint8_t emberAfGetAddressIndex(void); */ EmberNetworkStatus emberAfNetworkState(void); -/** - * @brief Get this node's radio channel for the current network. - */ -uint8_t emberAfGetRadioChannel(void); - /** * @brief Returns the current network parameters. */ diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 1ce9f152538db8..a45147bc96b945 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -323,7 +323,6 @@ void IncreaseClusterDataVersion(const ConcreteClusterPath & aConcreteClusterPath ChipLogDetail(DataManagement, "Endpoint %" PRIx16 ", Cluster " ChipLogFormatMEI " update version to %" PRIx32, aConcreteClusterPath.mEndpointId, ChipLogValueMEI(aConcreteClusterPath.mClusterId), *(version)); } - return; } CHIP_ERROR SendSuccessStatus(AttributeReportIB::Builder & aAttributeReport, AttributeDataIB::Builder & aAttributeDataIBBuilder) diff --git a/src/controller/python/OpCredsBinding.cpp b/src/controller/python/OpCredsBinding.cpp index 1fdd78757c3b9e..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() : AutoCommissioner() { 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 a6b6e74ac1c6e6..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); -private: bool mEmitSubscriptionError = false; int32_t mNumActiveSubscriptions = 0; bool mAlterSubscriptionIntervals = false; diff --git a/src/credentials/FabricTable.cpp b/src/credentials/FabricTable.cpp index 66fbc2f4c4fa77..67cbec87fb19fa 100644 --- a/src/credentials/FabricTable.cpp +++ b/src/credentials/FabricTable.cpp @@ -799,7 +799,6 @@ void FabricTable::UpdateNextAvailableFabricIndex() } mNextAvailableFabricIndex.ClearValue(); - return; } CHIP_ERROR FabricTable::StoreFabricIndexInfo() const diff --git a/src/credentials/GroupDataProviderImpl.cpp b/src/credentials/GroupDataProviderImpl.cpp index 0e69dcfcd862de..25367f83e28868 100644 --- a/src/credentials/GroupDataProviderImpl.cpp +++ b/src/credentials/GroupDataProviderImpl.cpp @@ -384,7 +384,7 @@ struct GroupData : public GroupDataProvider::GroupInfo, PersistentData::_RunEventLoop() // StopEventLoopTask(). // pthread_cond_signal(&mEventQueueStoppedCond); - - return; } template diff --git a/src/inet/IPAddress.h b/src/inet/IPAddress.h index db9f7bb06d255e..a83bcf4230f9c6 100644 --- a/src/inet/IPAddress.h +++ b/src/inet/IPAddress.h @@ -125,7 +125,6 @@ class DLL_EXPORT IPAddress static constexpr uint16_t kMaxStringLength = INET6_ADDRSTRLEN; #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK -public: IPAddress() = default; IPAddress(const IPAddress & other) = default; diff --git a/src/inet/InetInterface.h b/src/inet/InetInterface.h index aa303b57a2627f..824fc104ba5f2d 100644 --- a/src/inet/InetInterface.h +++ b/src/inet/InetInterface.h @@ -91,7 +91,6 @@ class InterfaceId static constexpr size_t kMaxIfNameLength = Z_DEVICE_MAX_NAME_LEN; #endif -public: ~InterfaceId() = default; constexpr InterfaceId() : mPlatformInterface(kPlatformNull) {} diff --git a/src/lib/dnssd/minimal_mdns/tests/TestMinimalMdnsAllocator.cpp b/src/lib/dnssd/minimal_mdns/tests/TestMinimalMdnsAllocator.cpp index b9febe27d1a7b0..2753f66a973a63 100644 --- a/src/lib/dnssd/minimal_mdns/tests/TestMinimalMdnsAllocator.cpp +++ b/src/lib/dnssd/minimal_mdns/tests/TestMinimalMdnsAllocator.cpp @@ -36,7 +36,7 @@ constexpr size_t kMaxRecords = 10; class TestAllocator : public QueryResponderAllocator { public: - TestAllocator() : QueryResponderAllocator() + TestAllocator() { #if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC // void dmalloc_track(const dmalloc_track_t track_func) diff --git a/src/lib/shell/commands/Config.cpp b/src/lib/shell/commands/Config.cpp index 5a9449e21ef63d..18b994e94c25f0 100644 --- a/src/lib/shell/commands/Config.cpp +++ b/src/lib/shell/commands/Config.cpp @@ -211,7 +211,6 @@ void RegisterConfigCommands() // Register the root `config` command with the top-level shell. Engine::Root().RegisterCommands(&sConfigComand, 1); - return; } } // namespace Shell diff --git a/src/lib/shell/commands/OnboardingCodes.cpp b/src/lib/shell/commands/OnboardingCodes.cpp index 83978e502519dd..49e388cf9ab0a1 100644 --- a/src/lib/shell/commands/OnboardingCodes.cpp +++ b/src/lib/shell/commands/OnboardingCodes.cpp @@ -170,7 +170,6 @@ void RegisterOnboardingCodesCommands() // Register the root `device` command with the top-level shell. Engine::Root().RegisterCommands(&sDeviceComand, 1); - return; } } // namespace Shell diff --git a/src/messaging/ReliableMessageContext.h b/src/messaging/ReliableMessageContext.h index aeed9550ca6e51..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); -private: friend class ReliableMessageMgr; friend class ExchangeContext; friend class ExchangeMessageDispatch; diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index fcf5d0a6078c7e..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()), retainedBuf(EncryptedPacketBufferHandle()), nextRetransTime(0), sendCount(0) + ec(*rc->GetExchangeContext()), nextRetransTime(0), sendCount(0) { ec->SetMessageNotAcked(true); } @@ -89,10 +89,7 @@ void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) }); } #else -void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) -{ - return; -} +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 13266060487a5f..544c30e313746b 100644 --- a/src/messaging/ReliableMessageMgr.h +++ b/src/messaging/ReliableMessageMgr.h @@ -69,7 +69,6 @@ class ReliableMessageMgr including both successfully and failure send. */ }; -public: ReliableMessageMgr(BitMapObjectPool & contextPool); ~ReliableMessageMgr(); diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp b/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp index cf46a3c6e8afc4..bbf5456d276589 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp @@ -103,8 +103,6 @@ void UserDirectedCommissioningServer::SetUDCClientProcessingState(char * instanc client->SetUDCClientProcessingState(state); mUdcClients.MarkUDCClientActive(client); - - return; } void UserDirectedCommissioningServer::OnCommissionableNodeFound(const Dnssd::DiscoveredNodeData & nodeData) diff --git a/src/setup_payload/tests/TestManualCode.cpp b/src/setup_payload/tests/TestManualCode.cpp index 12ff5d2ecff9fd..c768bb12b0bd64 100644 --- a/src/setup_payload/tests/TestManualCode.cpp +++ b/src/setup_payload/tests/TestManualCode.cpp @@ -128,7 +128,7 @@ void TestDecimalRepresentation_AllZeros(nlTestSuite * inSuite, void * inContext) payload.setUpPINCode = 0; payload.discriminator = 0; - std::string expectedResult = ""; + std::string expectedResult; NL_TEST_ASSERT(inSuite, CheckGenerator(payload, expectedResult)); } diff --git a/src/tools/chip-cert/CertUtils.cpp b/src/tools/chip-cert/CertUtils.cpp index 2b9555c6825cad..00a86e4d8c96f6 100644 --- a/src/tools/chip-cert/CertUtils.cpp +++ b/src/tools/chip-cert/CertUtils.cpp @@ -356,9 +356,8 @@ bool AddAuthorityKeyId(X509 * cert, X509 * caCert) int index = 0; std::unique_ptr akid(AUTHORITY_KEYID_new(), &AUTHORITY_KEYID_free); - akid.get()->keyid = - reinterpret_cast(X509_get_ext_d2i(caCert, NID_subject_key_identifier, &isCritical, &index)); - if (akid.get()->keyid == nullptr) + 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/raw/tests/TestTCP.cpp b/src/transport/raw/tests/TestTCP.cpp index 86d17ab4dc6078..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() : mHandle(), 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();