Skip to content

Commit

Permalink
Revert "restyle"
Browse files Browse the repository at this point in the history
This reverts commit f855ea5.
  • Loading branch information
joonhaengHeo committed Apr 18, 2023
1 parent f855ea5 commit fb12a69
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -789,13 +789,11 @@ CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const
, mBufferedReadAdapter(*this)
{
if (aAttributePathParamsList != nullptr) {
mAttributePathParamsList
= Platform::MakeMemoryUnique<app::AttributePathParams>(aAttributePathParamsSize, sizeof(AttributePathParams));
memcpy(
mAttributePathParamsList.get(), aAttributePathParamsList, aAttributePathParamsSize * sizeof(AttributePathParams));
mAttributePathParamsList = Platform::MakeMemoryUnique<app::AttributePathParams>(aAttributePathParamsSize, sizeof(AttributePathParams));
memcpy(mAttributePathParamsList.get(), aAttributePathParamsList, aAttributePathParamsSize * sizeof(AttributePathParams));
mAttributePathParamsSize = aAttributePathParamsSize;
}

if (aEventPathParamsList != nullptr) {
mEventPathParamsList = Platform::MakeMemoryUnique<app::EventPathParams>(aEventPathParamsSize, sizeof(EventPathParams));
memcpy(mEventPathParamsList.get(), aEventPathParamsList, aEventPathParamsSize * sizeof(EventPathParams));
Expand Down Expand Up @@ -1005,13 +1003,13 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri
}
};

Platform::MemoryUniquePtr<AttributePathParams> attributePathParamsList = nullptr;
Platform::MemoryUniquePtr<EventPathParams> eventPathParamsList = nullptr;
Platform::MemoryUniquePtr<AttributePathParams> attributePathParamsList = nullptr;
Platform::MemoryUniquePtr<EventPathParams> eventPathParamsList = nullptr;

if (attributes != nil) {
size_t count = 0;
attributePathParamsList
= Platform::MakeMemoryUnique<AttributePathParams>([attributes count], sizeof(AttributePathParams));
= Platform::MakeMemoryUnique<AttributePathParams>([attributes count], sizeof(AttributePathParams));
VerifyOrReturnError(attributePathParamsList != nullptr, CHIP_ERROR_NO_MEMORY);
for (MTRAttributeRequestPath * attribute in attributes) {
[attribute convertToAttributePathParams:attributePathParamsList.get()[count++]];
Expand All @@ -1020,7 +1018,8 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri

if (events != nil) {
size_t count = 0;
eventPathParamsList = Platform::MakeMemoryUnique<EventPathParams>([events count], sizeof(EventPathParams));
eventPathParamsList
= Platform::MakeMemoryUnique<EventPathParams>([events count], sizeof(EventPathParams));
VerifyOrReturnError(eventPathParamsList != nullptr, CHIP_ERROR_NO_MEMORY);
for (MTREventRequestPath * event in events) {
[event convertToEventPathParams:eventPathParamsList.get()[count++]];
Expand All @@ -1037,8 +1036,7 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri
readParams.mpEventPathParamsList = eventPathParamsList.get();
readParams.mEventPathParamsListSize = [eventPaths count];

auto onDone = [resultArray, interactionStatus, bridge, successCb, failureCb](
BufferedReadClientCallback<MTRDataValueDictionaryDecodableType> * callback) {
auto onDone = [resultArray, interactionStatus, bridge, successCb, failureCb](BufferedReadClientCallback<MTRDataValueDictionaryDecodableType> * callback) {
if (*interactionStatus != CHIP_NO_ERROR) {
// Failure
failureCb(bridge, *interactionStatus);
Expand Down

0 comments on commit fb12a69

Please sign in to comment.