Skip to content

Commit

Permalink
Mock attribute storage compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Apr 25, 2022
1 parent 3d8d55c commit ba84eb6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/util/mock/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ uint16_t emberAfEndpointCount(void)

uint16_t emberAfIndexFromEndpoint(chip::EndpointId endpoint)
{
static_assert(ArraySize(endpoints) < UINT16_MAX);

for (size_t i = 0; i < ArraySize(endpoints); i++)
{
if (endpoints[i] == endpoint)
{
return i;
return static_cast<uint16_t>(i);
}
}
return UINT16_MAX;
Expand Down Expand Up @@ -205,7 +207,9 @@ uint8_t emberAfClusterIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
{
if (clusters[i + clusterIndex[endpointIndex]] == cluster)
{
return i;
VerifyOrDie(i <= UINT8_MAX);

return static_cast<uint8_t>(i);
}
}
return UINT8_MAX;
Expand Down

0 comments on commit ba84eb6

Please sign in to comment.