mirror of
https://github.com/eclipse/wakaama.git
synced 2025-05-08 23:31:37 +08:00
Work around -Wsign-compare
Using difftime() might be more clean, but uses doubles instead of integers.
This commit is contained in:
parent
893f814d53
commit
f2ff386d0e
@ -746,7 +746,7 @@ void observe_step(lwm2m_context_t * contextP,
|
||||
{
|
||||
LOG_ARG("Checking minimal period (%d s)", watcherP->parameters->minPeriod);
|
||||
|
||||
if (watcherP->lastTime + watcherP->parameters->minPeriod > currentTime)
|
||||
if ((time_t)(watcherP->lastTime + watcherP->parameters->minPeriod) > currentTime)
|
||||
{
|
||||
// Minimum Period did not elapse yet
|
||||
interval = watcherP->lastTime + watcherP->parameters->minPeriod - currentTime;
|
||||
@ -768,7 +768,7 @@ void observe_step(lwm2m_context_t * contextP,
|
||||
{
|
||||
LOG_ARG("Checking maximal period (%d s)", watcherP->parameters->maxPeriod);
|
||||
|
||||
if (watcherP->lastTime + watcherP->parameters->maxPeriod <= currentTime)
|
||||
if ((time_t)(watcherP->lastTime + watcherP->parameters->maxPeriod) <= currentTime)
|
||||
{
|
||||
LOG("Notify on maximal period");
|
||||
notify = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user