View | Details | Raw Unified | Return to bug 214632
Collapse All | Expand All

(-)net-im/kmess-kde4/files/patch-src_utils_xautolock.cpp (+27 lines)
Line 0 Link Here
1
/wrkdirs/usr/ports/net-im/kmess-kde4/work/kmess-2.0.6.2/src/utils/xautolock.cpp:110:7: error: call to 'abs' is ambiguous
2
  if( abs( lastCheck_ - now ) > 120 )
3
      ^~~
4
/usr/include/stdlib.h:83:6: note: candidate function
5
int      abs(int) __pure2;
6
         ^
7
/usr/include/c++/v1/stdlib.h:115:44: note: candidate function
8
inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
9
                                           ^
10
/usr/include/c++/v1/stdlib.h:117:44: note: candidate function
11
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
12
                                           ^
13
14
--- src/utils/xautolock.cpp.orig	2012-02-17 20:16:31 UTC
15
+++ src/utils/xautolock.cpp
16
@@ -106,8 +106,9 @@ void XAutoLock::checkIdle()
17
   unsigned long timeIdle;
18
 
19
   now = (uint)time( 0 );
20
-
21
-  if( abs( lastCheck_ - now ) > 120 )
22
+   
23
+  unsigned int delta = (lastCheck_ > now ? lastCheck_ - now : now - lastCheck_);
24
+  if( delta > 120 )
25
   {
26
     // Whoah, two minutes since we were last called?  Something strange is happening...
27
     resetTimer();

Return to bug 214632