Handle X timestamp wrapping correctly even on 64bit platforms.

svn path=/trunk/KDE/kdebase/workspace/; revision=528576
This commit is contained in:
Luboš Luňák 2006-04-11 12:55:49 +00:00
parent b7d19892d3
commit 6dc0858b2c

View file

@ -232,15 +232,13 @@ Client* findClientInList( const ClientList& list, T predicate )
inline
int timestampCompare( Time time1, Time time2 ) // like strcmp()
{
if( time1 == time2 )
return 0;
return ( time1 - time2 ) < 1000000000 ? 1 : -1; // time1 > time2 -> 1, handle wrapping
return NET::timestampCompare( time1, time2 );
}
inline
Time timestampDiff( Time time1, Time time2 ) // returns time2 - time1
{ // no need to handle wrapping?
return time2 - time1;
{
return NET::timestampDiff( time1, time2 );
}
bool isLocalMachine( const QByteArray& host );