Skip to content

Commit

Permalink
Silence CodeQL warning related to comparing uint8_t for loop index wi…
Browse files Browse the repository at this point in the history
…th a size_t pathsConfig.count

in reality pathsConfig.count will never exceed 255 but since this is TestCode simplest is to make the loop condition index a size_t
  • Loading branch information
Alami-Amine committed Jan 23, 2025
1 parent c29c15c commit 7928a0f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class InteractionModelWriter
mTimedInteractionTimeoutMs, mSuppressResponse.ValueOr(false));
VerifyOrReturnError(mWriteClient != nullptr, CHIP_ERROR_NO_MEMORY);

for (uint8_t i = 0; i < pathsConfig.count; i++)
for (size_t i = 0; i < pathsConfig.count; i++)
{
auto & path = pathsConfig.attributePathParams[i];
auto & dataVersion = pathsConfig.dataVersionFilter[i].mDataVersion;
Expand Down Expand Up @@ -592,8 +592,8 @@ class InteractionModel : public InteractionModelReports,
public chip::app::CommandSender::Callback
{
public:
InteractionModel() : InteractionModelReports(this), InteractionModelCommands(this), InteractionModelWriter(this){};
virtual ~InteractionModel(){};
InteractionModel() : InteractionModelReports(this), InteractionModelCommands(this), InteractionModelWriter(this) {};
virtual ~InteractionModel() {};

virtual void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) = 0;
virtual CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) = 0;
Expand Down

0 comments on commit 7928a0f

Please sign in to comment.