From fb12a69fb26e91543bf20ce7f0ff1947ae938649 Mon Sep 17 00:00:00 2001 From: Joonhaeng Heo Date: Tue, 18 Apr 2023 09:05:37 +0900 Subject: [PATCH] Revert "restyle" This reverts commit f855ea573ccbfa8b136b6fc349ee235ab00cc91c. --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 5d2458d62bf3eb..0e8cc503a5113c 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -789,13 +789,11 @@ CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const , mBufferedReadAdapter(*this) { if (aAttributePathParamsList != nullptr) { - mAttributePathParamsList - = Platform::MakeMemoryUnique(aAttributePathParamsSize, sizeof(AttributePathParams)); - memcpy( - mAttributePathParamsList.get(), aAttributePathParamsList, aAttributePathParamsSize * sizeof(AttributePathParams)); + mAttributePathParamsList = Platform::MakeMemoryUnique(aAttributePathParamsSize, sizeof(AttributePathParams)); + memcpy(mAttributePathParamsList.get(), aAttributePathParamsList, aAttributePathParamsSize * sizeof(AttributePathParams)); mAttributePathParamsSize = aAttributePathParamsSize; } - + if (aEventPathParamsList != nullptr) { mEventPathParamsList = Platform::MakeMemoryUnique(aEventPathParamsSize, sizeof(EventPathParams)); memcpy(mEventPathParamsList.get(), aEventPathParamsList, aEventPathParamsSize * sizeof(EventPathParams)); @@ -1005,13 +1003,13 @@ - (void)readAttributePaths:(NSArray * _Nullable)attri } }; - Platform::MemoryUniquePtr attributePathParamsList = nullptr; - Platform::MemoryUniquePtr eventPathParamsList = nullptr; + Platform::MemoryUniquePtr attributePathParamsList = nullptr; + Platform::MemoryUniquePtr eventPathParamsList = nullptr; if (attributes != nil) { size_t count = 0; attributePathParamsList - = Platform::MakeMemoryUnique([attributes count], sizeof(AttributePathParams)); + = Platform::MakeMemoryUnique([attributes count], sizeof(AttributePathParams)); VerifyOrReturnError(attributePathParamsList != nullptr, CHIP_ERROR_NO_MEMORY); for (MTRAttributeRequestPath * attribute in attributes) { [attribute convertToAttributePathParams:attributePathParamsList.get()[count++]]; @@ -1020,7 +1018,8 @@ - (void)readAttributePaths:(NSArray * _Nullable)attri if (events != nil) { size_t count = 0; - eventPathParamsList = Platform::MakeMemoryUnique([events count], sizeof(EventPathParams)); + eventPathParamsList + = Platform::MakeMemoryUnique([events count], sizeof(EventPathParams)); VerifyOrReturnError(eventPathParamsList != nullptr, CHIP_ERROR_NO_MEMORY); for (MTREventRequestPath * event in events) { [event convertToEventPathParams:eventPathParamsList.get()[count++]]; @@ -1037,8 +1036,7 @@ - (void)readAttributePaths:(NSArray * _Nullable)attri readParams.mpEventPathParamsList = eventPathParamsList.get(); readParams.mEventPathParamsListSize = [eventPaths count]; - auto onDone = [resultArray, interactionStatus, bridge, successCb, failureCb]( - BufferedReadClientCallback * callback) { + auto onDone = [resultArray, interactionStatus, bridge, successCb, failureCb](BufferedReadClientCallback * callback) { if (*interactionStatus != CHIP_NO_ERROR) { // Failure failureCb(bridge, *interactionStatus);