Skip to content

Commit

Permalink
Remove more macros that were syntaxed to look like functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jan 22, 2024
1 parent 1146d49 commit 215f345
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ constexpr const EmberAfDeviceType fixedDeviceTypeList[] = FIXED_DEVI
// Not const, because these need to mutate.
DataVersion fixedEndpointDataVersions[ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT];

#define endpointNumber(x) fixedEndpoints[x]
#define endpointDeviceTypeList(x) \
Span<const EmberAfDeviceType>(&fixedDeviceTypeList[fixedDeviceTypeListOffsets[x]], fixedDeviceTypeListLengths[x])
// Added 'Macro' to silence MISRA warning about conflict with synonymous vars.
#define endpointTypeMacro(x) (&(generatedEmberAfEndpointTypes[fixedEmberAfEndpointTypes[x]]))

AttributeAccessInterface * gAttributeAccessOverrides = nullptr;

// shouldUnregister returns true if the given AttributeAccessInterface should be
Expand Down Expand Up @@ -206,10 +200,11 @@ void emberAfEndpointConfigure()
DataVersion * currentDataVersions = fixedEndpointDataVersions;
for (ep = 0; ep < FIXED_ENDPOINT_COUNT; ep++)
{
emAfEndpoints[ep].endpoint = endpointNumber(ep);
emAfEndpoints[ep].deviceTypeList = endpointDeviceTypeList(ep);
emAfEndpoints[ep].endpointType = endpointTypeMacro(ep);
emAfEndpoints[ep].dataVersions = currentDataVersions;
emAfEndpoints[ep].endpoint = fixedEndpoints[ep];
emAfEndpoints[ep].deviceTypeList =
Span<const EmberAfDeviceType>(&fixedDeviceTypeList[fixedDeviceTypeListOffsets[ep]], fixedDeviceTypeListLengths[ep]);
emAfEndpoints[ep].endpointType = &generatedEmberAfEndpointTypes[fixedEmberAfEndpointTypes[ep]];
emAfEndpoints[ep].dataVersions = currentDataVersions;

emAfEndpoints[ep].bitmask.Set(EmberAfEndpointOptions::isEnabled);
emAfEndpoints[ep].bitmask.Set(EmberAfEndpointOptions::isFlatComposition);
Expand Down

0 comments on commit 215f345

Please sign in to comment.