From f855ea573ccbfa8b136b6fc349ee235ab00cc91c Mon Sep 17 00:00:00 2001 From: Joonhaeng Heo Date: Mon, 17 Apr 2023 10:49:33 +0900 Subject: [PATCH] restyle --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 0e8cc503a5113c..5d2458d62bf3eb 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -789,11 +789,13 @@ 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)); @@ -1003,13 +1005,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++]]; @@ -1018,8 +1020,7 @@ - (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++]]; @@ -1036,7 +1037,8 @@ - (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);