From owner-svn-ports-all@freebsd.org Mon Jun 6 23:55:09 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87229B6E1B6; Mon, 6 Jun 2016 23:55:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 474A11E4B; Mon, 6 Jun 2016 23:55:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56Nt8kD080710; Mon, 6 Jun 2016 23:55:08 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56Nt8jn080709; Mon, 6 Jun 2016 23:55:08 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606062355.u56Nt8jn080709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 6 Jun 2016 23:55:08 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r416491 - head/net/opal/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 23:55:09 -0000 Author: truckman Date: Mon Jun 6 23:55:08 2016 New Revision: 416491 URL: https://svnweb.freebsd.org/changeset/ports/416491 Log: Fix type for abs() calls in net/opal During the exp-run in bug 208158, it was found that net/opal gives errors with libc++ 3.8.0 [1]: ../common/mpi.cxx:135:18: error: call to 'abs' is ambiguous distance = ( abs(MPIs[i].width - desiredWidth ) * ^~~ This is because abs() is being called with unsigned arguments. Fix this by casting the arguments to the appropriate signed type. This mimics what happens with older libraries where the only version of abs() was the one in , which is prototyped: int abs(int) Correct functioning of this expression relies on how integer overflow actually behaves, which is actually undefined in the C++ standard. PR: 209077 Submitted by: dim Added: head/net/opal/files/patch-plugins_video_common_mpi.cxx (contents, props changed) Added: head/net/opal/files/patch-plugins_video_common_mpi.cxx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/opal/files/patch-plugins_video_common_mpi.cxx Mon Jun 6 23:55:08 2016 (r416491) @@ -0,0 +1,13 @@ +--- plugins/video/common/mpi.cxx.orig 2013-02-20 02:18:05 UTC ++++ plugins/video/common/mpi.cxx +@@ -132,8 +132,8 @@ bool MPIList::getNegotiatedMPI( unsigned + // to the desired one or matches it + for (i=0; i < MPIs.size(); i++) { + // we square the value in order to get absolute distances +- distance = ( abs(MPIs[i].width - desiredWidth ) * +- abs(MPIs[i].height - desiredHeight) ); ++ distance = ( abs((int)(MPIs[i].width - desiredWidth )) * ++ abs((int)(MPIs[i].height - desiredHeight)) ); + + if (distance < minDistance) { + minDistance = distance;