mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 14:47:46 +00:00
[spinel] fix time narrowing conversion (#4896)
This makes narrowing conversions of time types explicit to fix build errors.
This commit is contained in:
@@ -260,8 +260,8 @@ otError HdlcInterface::WaitForFrame(uint64_t aTimeoutUs)
|
||||
#if OPENTHREAD_POSIX_VIRTUAL_TIME
|
||||
struct Event event;
|
||||
|
||||
timeout.tv_sec = aTimeoutUs / US_PER_S;
|
||||
timeout.tv_usec = aTimeoutUs % US_PER_S;
|
||||
timeout.tv_sec = static_cast<time_t>(aTimeoutUs / US_PER_S);
|
||||
timeout.tv_usec = static_cast<suseconds_t>(aTimeoutUs % US_PER_S);
|
||||
|
||||
virtualTimeSendSleepEvent(&timeout);
|
||||
virtualTimeReceiveEvent(&event);
|
||||
@@ -281,8 +281,8 @@ otError HdlcInterface::WaitForFrame(uint64_t aTimeoutUs)
|
||||
break;
|
||||
}
|
||||
#else // OPENTHREAD_POSIX_VIRTUAL_TIME
|
||||
timeout.tv_sec = aTimeoutUs / US_PER_S;
|
||||
timeout.tv_usec = aTimeoutUs % US_PER_S;
|
||||
timeout.tv_sec = static_cast<time_t>(aTimeoutUs / US_PER_S);
|
||||
timeout.tv_usec = static_cast<suseconds_t>(aTimeoutUs % US_PER_S);
|
||||
|
||||
fd_set read_fds;
|
||||
fd_set error_fds;
|
||||
|
||||
@@ -692,8 +692,8 @@ otError SpiInterface::WaitForFrame(uint64_t aTimeoutUs)
|
||||
int ret;
|
||||
bool isDataReady = false;
|
||||
|
||||
timeout.tv_sec = aTimeoutUs / US_PER_S;
|
||||
timeout.tv_usec = aTimeoutUs % US_PER_S;
|
||||
timeout.tv_sec = static_cast<time_t>(aTimeoutUs / US_PER_S);
|
||||
timeout.tv_usec = static_cast<suseconds_t>(aTimeoutUs % US_PER_S);
|
||||
|
||||
FD_ZERO(&readFdSet);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user