remove suspicious cast that could maybe cause an overflow (#4169)

* suspicious cast

* don't print 64b

* explicit type
This commit is contained in:
Matthew Kennedy 2022-05-12 20:40:37 -07:00 committed by GitHub
parent 75932d96bf
commit 23d222c159
1 changed files with 3 additions and 2 deletions

View File

@ -67,11 +67,12 @@ void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* s
ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp);
#if EFI_ENABLE_ASSERTS
int32_t deltaTimeNt = (int32_t)nt - getTimeNowLowerNt();
efitick_t deltaTimeNt = nt - getTimeNowLowerNt();
if (deltaTimeNt >= TOO_FAR_INTO_FUTURE_NT) {
// we are trying to set callback for too far into the future. This does not look right at all
firmwareError(CUSTOM_ERR_TASK_TIMER_OVERFLOW, "scheduleByTimestampNt() too far: %d %s", deltaTimeNt, msg);
int32_t intDeltaTimeNt = (int32_t)deltaTimeNt;
firmwareError(CUSTOM_ERR_TASK_TIMER_OVERFLOW, "scheduleByTimestampNt() too far: %d %s", intDeltaTimeNt, msg);
return;
}
#endif