Skip to content

Commit

Permalink
fix macro in template headeR
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Apr 26, 2024
1 parent 152a3df commit 30100ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/support/PersistedCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <lib/support/CHIPCounter.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/DefaultStorageKeyAllocator.h>
#include <limits>

namespace chip {

Expand Down Expand Up @@ -131,7 +132,7 @@ class PersistedCounter : public MonotonicallyIncreasingCounter<T>
// 2- Increasing the current counter by value would cause a roll over. This would cause the current value to be < to the
// mNextEpoch so we force an update.
bool shouldDoEpochUpdate = ((MonotonicallyIncreasingCounter<T>::GetValue() + value) >= mNextEpoch) ||
(MonotonicallyIncreasingCounter<T>::GetValue() > INT_MAX - value);
(MonotonicallyIncreasingCounter<T>::GetValue() > std::numeric_limits<T>::max() - value);

ReturnErrorOnFailure(MonotonicallyIncreasingCounter<T>::AdvanceBy(value));

Expand Down

0 comments on commit 30100ac

Please sign in to comment.