Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Nov 2016 20:55:18 +0000 (UTC)
From:      "Tobias C. Berner" <tcberner@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r427346 - head/net-im/kmess-kde4/files
Message-ID:  <201611282055.uASKtIax066290@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tcberner
Date: Mon Nov 28 20:55:18 2016
New Revision: 427346
URL: https://svnweb.freebsd.org/changeset/ports/427346

Log:
  net-im/kmess-kde4 : fix 'abs is ambiguous'
  
  Work around the call to abs() being ambigous by simply
  calculating the absolute value in place.
  
  PR:		214632
  Approved by:	just fix it, rakuco (mentor)

Added:
  head/net-im/kmess-kde4/files/patch-src_utils_xautolock.cpp   (contents, props changed)

Added: head/net-im/kmess-kde4/files/patch-src_utils_xautolock.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-im/kmess-kde4/files/patch-src_utils_xautolock.cpp	Mon Nov 28 20:55:18 2016	(r427346)
@@ -0,0 +1,27 @@
+/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
+  if( abs( lastCheck_ - now ) > 120 )
+      ^~~
+/usr/include/stdlib.h:83:6: note: candidate function
+int      abs(int) __pure2;
+         ^
+/usr/include/c++/v1/stdlib.h:115:44: note: candidate function
+inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
+                                           ^
+/usr/include/c++/v1/stdlib.h:117:44: note: candidate function
+inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
+                                           ^
+
+--- src/utils/xautolock.cpp.orig	2012-02-17 20:16:31 UTC
++++ src/utils/xautolock.cpp
+@@ -106,8 +106,9 @@ void XAutoLock::checkIdle()
+   unsigned long timeIdle;
+ 
+   now = (uint)time( 0 );
+-
+-  if( abs( lastCheck_ - now ) > 120 )
++   
++  unsigned int delta = (lastCheck_ > now ? lastCheck_ - now : now - lastCheck_);
++  if( delta > 120 )
+   {
+     // Whoah, two minutes since we were last called?  Something strange is happening...
+     resetTimer();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611282055.uASKtIax066290>