Rename qAbs Function for timeval
This decouples it from qAbs which is declared as a constexpr under certain compilation flags and enables for qtbase to be compiled with GCC 4.8 Change-Id: I78e02256ffc8b460ca74ae5241e77dfac4e09ba9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
cf885ee836
commit
d9ff510f02
@ -94,8 +94,7 @@ timeval QTimerInfoList::updateCurrentTime()
|
|||||||
|
|
||||||
#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED)
|
#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED)
|
||||||
|
|
||||||
template <>
|
timeval qAbsTimeval(const timeval &t)
|
||||||
timeval qAbs(const timeval &t)
|
|
||||||
{
|
{
|
||||||
timeval tmp = t;
|
timeval tmp = t;
|
||||||
if (tmp.tv_sec < 0) {
|
if (tmp.tv_sec < 0) {
|
||||||
@ -144,7 +143,7 @@ bool QTimerInfoList::timeChanged(timeval *delta)
|
|||||||
timeval tickGranularity;
|
timeval tickGranularity;
|
||||||
tickGranularity.tv_sec = 0;
|
tickGranularity.tv_sec = 0;
|
||||||
tickGranularity.tv_usec = msPerTick * 1000;
|
tickGranularity.tv_usec = msPerTick * 1000;
|
||||||
return elapsedTimeTicks < ((qAbs(*delta) - tickGranularity) * 10);
|
return elapsedTimeTicks < ((qAbsTimeval(*delta) - tickGranularity) * 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user