Skip to content

Commit

Permalink
Restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Apr 6, 2022
1 parent ab0e704 commit 7496aaf
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 44 deletions.
2 changes: 0 additions & 2 deletions src/access/AccessControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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; }
Expand Down
17 changes: 0 additions & 17 deletions src/access/examples/ExampleAccessControlDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
};

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -241,7 +237,6 @@ class TargetStorage
!((target.flags & Target::kDeviceType) && !IsValidDeviceType(target.deviceType));
}


void Decode(Target & target) const
{
auto & flags = target.flags;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -346,7 +340,6 @@ class TargetStorage
// (mDeviceType >> kEndpointShift) --> extract endpoint from mDeviceType
static constexpr int kEndpointShift = 16;


ClusterId mCluster;
DeviceTypeId mDeviceType;
};
Expand Down Expand Up @@ -390,7 +383,6 @@ class EntryStorage
return nullptr;
}


// Pool support
static EntryStorage pool[kEntryStoragePoolSize];

Expand Down Expand Up @@ -419,7 +411,6 @@ class EntryStorage
return pool <= this && this < end;
}


EntryStorage() = default;

void Init()
Expand Down Expand Up @@ -457,7 +448,6 @@ class EntryStorage
}
}


enum class ConvertDirection
{
kAbsoluteToRelative,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -648,7 +636,6 @@ class EntryDelegate : public Entry::Delegate
return pool <= &delegate && &delegate < end;
}


void Release() override
{
mStorage->Release();
Expand Down Expand Up @@ -840,7 +827,6 @@ class EntryDelegate : public Entry::Delegate
return CHIP_ERROR_SENTINEL;
}


void Init(Entry & entry, EntryStorage & storage)
{
entry.SetDelegate(*this);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -963,7 +948,6 @@ class EntryIteratorDelegate : public EntryIterator::Delegate
return CHIP_ERROR_SENTINEL;
}


void Init(EntryIterator & iterator, const FabricIndex * fabricIndex)
{
iterator.SetDelegate(*this);
Expand Down Expand Up @@ -1245,7 +1229,6 @@ class AccessControlDelegate : public AccessControl::Delegate
return CHIP_ERROR_NOT_IMPLEMENTED;
}


void SetStorageDelegate(chip::PersistentStorageDelegate * storageDelegate) { mStorageDelegate = storageDelegate; }

private:
Expand Down
2 changes: 0 additions & 2 deletions src/app/AttributeCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ class AttributeCache : protected ReadClient::Callback
*/
CHIP_ERROR UpdateCache(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus);


//
// ReadClient::Callback
//
Expand All @@ -360,7 +359,6 @@ class AttributeCache : protected ReadClient::Callback
return mCallback.OnDeallocatePaths(std::move(aReadPrepareParams));
}


Callback & mCallback;
NodeState mCache;
std::set<ConcreteAttributePath> mChangedAttributeSet;
Expand Down
2 changes: 0 additions & 2 deletions src/app/BufferedReadCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class BufferedReadCallback : public ReadClient::Callback
*/
CHIP_ERROR BufferData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apReader);


//
// ReadClient::Callback
//
Expand All @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions src/app/WriteHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/util/ember-compatibility-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/OpCredsBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
1 change: 0 additions & 1 deletion src/controller/tests/data_model/TestRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/credentials/GroupDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ struct GroupData : public GroupDataProvider::GroupInfo, PersistentData<kPersiste
bool first = true;

GroupData() : GroupInfo(nullptr){};
GroupData(chip::FabricIndex fabric) : fabric_index(fabric) {}
GroupData(chip::FabricIndex fabric) : fabric_index(fabric) {}
GroupData(chip::FabricIndex fabric, chip::GroupId group) : GroupInfo(group, nullptr), fabric_index(fabric) {}

CHIP_ERROR UpdateKey(DefaultStorageKeyAllocator & key) override
Expand Down Expand Up @@ -505,7 +505,7 @@ struct KeyMapData : public GroupDataProvider::GroupKey, LinkedData
chip::GroupId group_id = kUndefinedGroupId;
chip::KeysetId keyset_id = 0;

KeyMapData() {};
KeyMapData(){};
KeyMapData(chip::FabricIndex fabric, uint16_t link_id = 0, chip::GroupId group = kUndefinedGroupId, chip::KeysetId keyset = 0) :
GroupKey(group, keyset), LinkedData(link_id), fabric_index(fabric)
{}
Expand Down
1 change: 0 additions & 1 deletion src/inet/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


IPAddress() = default;
IPAddress(const IPAddress & other) = default;

Expand Down
1 change: 0 additions & 1 deletion src/inet/InetInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class InterfaceId
static constexpr size_t kMaxIfNameLength = Z_DEVICE_MAX_NAME_LEN;
#endif


~InterfaceId() = default;

constexpr InterfaceId() : mPlatformInterface(kPlatformNull) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ constexpr size_t kMaxRecords = 10;
class TestAllocator : public QueryResponderAllocator<kMaxRecords>
{
public:
TestAllocator()
TestAllocator()
{
#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC
// void dmalloc_track(const dmalloc_track_t track_func)
Expand Down
1 change: 0 additions & 1 deletion src/messaging/ReliableMessageContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions src/messaging/ReliableMessageMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion src/messaging/ReliableMessageMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class ReliableMessageMgr
including both successfully and failure send. */
};


ReliableMessageMgr(BitMapObjectPool<ExchangeContext, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS> & contextPool);
~ReliableMessageMgr();

Expand Down
3 changes: 1 addition & 2 deletions src/tools/chip-cert/CertUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ bool AddAuthorityKeyId(X509 * cert, X509 * caCert)
int index = 0;
std::unique_ptr<AUTHORITY_KEYID, void (*)(AUTHORITY_KEYID *)> akid(AUTHORITY_KEYID_new(), &AUTHORITY_KEYID_free);

akid->keyid =
reinterpret_cast<ASN1_OCTET_STRING *>(X509_get_ext_d2i(caCert, NID_subject_key_identifier, &isCritical, &index));
akid->keyid = reinterpret_cast<ASN1_OCTET_STRING *>(X509_get_ext_d2i(caCert, NID_subject_key_identifier, &isCritical, &index));
if (akid->keyid == nullptr)
{
ReportOpenSSLErrorAndExit("X509_get_ext_d2i", res = false);
Expand Down
4 changes: 2 additions & 2 deletions src/transport/SessionHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SessionHolder::~SessionHolder()
Release();
}

SessionHolder::SessionHolder(const SessionHolder & that)
SessionHolder::SessionHolder(const SessionHolder & that)
{
mSession = that.mSession;
if (mSession.HasValue())
Expand All @@ -33,7 +33,7 @@ SessionHolder::SessionHolder(const SessionHolder & that)
}
}

SessionHolder::SessionHolder(SessionHolder && that)
SessionHolder::SessionHolder(SessionHolder && that)
{
mSession = that.mSession;
if (mSession.HasValue())
Expand Down
2 changes: 1 addition & 1 deletion src/transport/raw/tests/TestTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7496aaf

Please sign in to comment.