Fix tv_sec casts to use time_t, not long
This commit is contained in:
@@ -116,7 +116,7 @@ epicsShareFunc void fdManager::process (double delay)
|
||||
|
||||
if ( ioPending ) {
|
||||
struct timeval tv;
|
||||
tv.tv_sec = static_cast<long> ( minDelay );
|
||||
tv.tv_sec = static_cast<time_t> ( minDelay );
|
||||
tv.tv_usec = static_cast<long> ( (minDelay-tv.tv_sec) * uSecPerSec );
|
||||
|
||||
fd_set * pReadSet = & this->fdSetsPtr[fdrRead];
|
||||
|
||||
@@ -72,7 +72,7 @@ convertDoubleToWakeTime(double timeout, struct timespec *wakeTime)
|
||||
if (timeout < 0.0)
|
||||
timeout = 0.0;
|
||||
|
||||
wait.tv_sec = static_cast< long >(timeout);
|
||||
wait.tv_sec = static_cast< time_t >(timeout);
|
||||
wait.tv_nsec = static_cast< long >((timeout - (double)wait.tv_sec) * 1e9);
|
||||
|
||||
wakeTime->tv_sec = now.tv_sec + wait.tv_sec;
|
||||
|
||||
@@ -107,7 +107,7 @@ extern "C" epicsShareFunc void
|
||||
perror("convertDoubleToWakeTime");
|
||||
cantProceed("convertDoubleToWakeTime");
|
||||
}
|
||||
wait.tv_sec = static_cast< long >(timeout);
|
||||
wait.tv_sec = static_cast< time_t >(timeout);
|
||||
wait.tv_nsec = static_cast< long >((timeout - (double)wait.tv_sec) * 1e9);
|
||||
wakeTime->tv_sec += wait.tv_sec;
|
||||
wakeTime->tv_nsec += wait.tv_nsec;
|
||||
|
||||
@@ -74,13 +74,13 @@ void testTimer (fdctx *pfdm, double delay)
|
||||
|
||||
epicsTimeGetCurrent (&begin);
|
||||
cbs.done = 0;
|
||||
tmo.tv_sec = (unsigned long) delay;
|
||||
tmo.tv_sec = (time_t) delay;
|
||||
tmo.tv_usec = (unsigned long) ((delay - tmo.tv_sec) * uSecPerSec);
|
||||
aid = fdmgr_add_timeout (pfdm, &tmo, alarmCB, &cbs);
|
||||
verify (aid!=fdmgrNoAlarm);
|
||||
|
||||
while (!cbs.done) {
|
||||
tmo.tv_sec = (unsigned long) delay;
|
||||
tmo.tv_sec = (time_t) delay;
|
||||
tmo.tv_usec = (unsigned long) ((delay - tmo.tv_sec) * uSecPerSec);
|
||||
status = fdmgr_pend_event (pfdm, &tmo);
|
||||
verify (status==0);
|
||||
|
||||
Reference in New Issue
Block a user