From d75f73c040c6154bfbab6508fca0d9dd15ff6f8d Mon Sep 17 00:00:00 2001 From: Curtis Rahman <111998767+CuRahman@users.noreply.github.com> Date: Mon, 6 May 2024 21:54:43 -0400 Subject: [PATCH] [Silabs] Added [[maybe_unused]] to remove errors from NDEBUG builds (#33315) * Added NDEBUG ifndef to minimize code size * Restyled by whitespace * Restyled by clang-format * Added #endif * Added [[mayne_unused]] --------- Co-authored-by: Restyled.io --- examples/light-switch-app/silabs/src/ZclCallbacks.cpp | 4 ++-- examples/lock-app/silabs/src/ZclCallbacks.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/light-switch-app/silabs/src/ZclCallbacks.cpp b/examples/light-switch-app/silabs/src/ZclCallbacks.cpp index 52542ca88fb390..13375537556067 100644 --- a/examples/light-switch-app/silabs/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/silabs/src/ZclCallbacks.cpp @@ -33,8 +33,8 @@ using namespace ::chip::app::Clusters; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) { - ClusterId clusterId = attributePath.mClusterId; - AttributeId attributeId = attributePath.mAttributeId; + ClusterId clusterId = attributePath.mClusterId; + [[maybe_unused]] AttributeId attributeId = attributePath.mAttributeId; ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); if (clusterId == OnOffSwitchConfiguration::Id) diff --git a/examples/lock-app/silabs/src/ZclCallbacks.cpp b/examples/lock-app/silabs/src/ZclCallbacks.cpp index 1c0c1efab19dde..2aa0e9d0f6cef2 100644 --- a/examples/lock-app/silabs/src/ZclCallbacks.cpp +++ b/examples/lock-app/silabs/src/ZclCallbacks.cpp @@ -48,7 +48,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & if (clusterId == DoorLock::Id && attributeId == DoorLock::Attributes::LockState::Id) { - DoorLock::DlLockState lockState = *(reinterpret_cast(value)); + [[maybe_unused]] DoorLock::DlLockState lockState = *(reinterpret_cast(value)); ChipLogProgress(Zcl, "Door lock cluster: " ChipLogFormatMEI " state %d", ChipLogValueMEI(clusterId), to_underlying(lockState)); #ifdef DIC_ENABLE