diff --git a/src/app/tests/TestEventLogging.cpp b/src/app/tests/TestEventLogging.cpp index 3653e9751ec11c..732dd9e99c9cc9 100644 --- a/src/app/tests/TestEventLogging.cpp +++ b/src/app/tests/TestEventLogging.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -80,8 +81,7 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), - sizeof(logStorageResources) / sizeof(logStorageResources[0]), + chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &ctx->mEventCounter); return SUCCESS; diff --git a/src/app/tests/TestEventLoggingNoUTCTime.cpp b/src/app/tests/TestEventLoggingNoUTCTime.cpp index 1530e58f8ac8d7..80c4a5038c72de 100644 --- a/src/app/tests/TestEventLoggingNoUTCTime.cpp +++ b/src/app/tests/TestEventLoggingNoUTCTime.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -102,8 +103,7 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), - sizeof(logStorageResources) / sizeof(logStorageResources[0]), + chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &ctx->mEventCounter); return SUCCESS; diff --git a/src/app/tests/TestEventOverflow.cpp b/src/app/tests/TestEventOverflow.cpp index 7091b51701278b..59478e1a2233ff 100644 --- a/src/app/tests/TestEventOverflow.cpp +++ b/src/app/tests/TestEventOverflow.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -72,8 +73,7 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), - sizeof(logStorageResources) / sizeof(logStorageResources[0]), + chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &ctx->mEventCounter); return SUCCESS; diff --git a/src/app/tests/TestFabricScopedEventLogging.cpp b/src/app/tests/TestFabricScopedEventLogging.cpp index 52f791ba947fb3..4258b3c775a9d5 100644 --- a/src/app/tests/TestFabricScopedEventLogging.cpp +++ b/src/app/tests/TestFabricScopedEventLogging.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -80,8 +81,7 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), - sizeof(logStorageResources) / sizeof(logStorageResources[0]), + chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &ctx->mEventCounter); return SUCCESS; diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index 03215e52fbe31b..96f49f8d1b6898 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -177,8 +178,8 @@ CHIP_ERROR InitializeEventLogging(chip::Messaging::ExchangeManager * apMgr) { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - chip::app::EventManagement::CreateEventManagement(apMgr, sizeof(logStorageResources) / sizeof(logStorageResources[0]), - gCircularEventBuffer, logStorageResources, &gEventCounter); + chip::app::EventManagement::CreateEventManagement(apMgr, ArraySize(logStorageResources), gCircularEventBuffer, + logStorageResources, &gEventCounter); return CHIP_NO_ERROR; } diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 423700f3bdf582..110a74c39edceb 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #if !defined(EMBER_SCRIPTED_TEST) @@ -51,14 +52,13 @@ #include #define DECLARE_DYNAMIC_ENDPOINT(endpointName, clusterList) \ - EmberAfEndpointType endpointName = { clusterList, sizeof(clusterList) / sizeof(EmberAfCluster), 0 } + EmberAfEndpointType endpointName = { clusterList, ArraySize(clusterList), 0 } #define DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(clusterListName) EmberAfCluster clusterListName[] = { #define DECLARE_DYNAMIC_CLUSTER(clusterId, clusterAttrs, incomingCommands, outgoingCommands) \ { \ - clusterId, clusterAttrs, sizeof(clusterAttrs) / sizeof(EmberAfAttributeMetadata), 0, ZAP_CLUSTER_MASK(SERVER), NULL, \ - incomingCommands, outgoingCommands \ + clusterId, clusterAttrs, ArraySize(clusterAttrs), 0, ZAP_CLUSTER_MASK(SERVER), NULL, incomingCommands, outgoingCommands \ } #define DECLARE_DYNAMIC_CLUSTER_LIST_END }