From owner-svn-ports-head@FreeBSD.ORG Wed Dec 3 23:06:57 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B38B567; Wed, 3 Dec 2014 23:06:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2D464BA5; Wed, 3 Dec 2014 23:06:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3N6vJN083634; Wed, 3 Dec 2014 23:06:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3N6vho083633; Wed, 3 Dec 2014 23:06:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412032306.sB3N6vho083633@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 3 Dec 2014 23:06:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r373852 - head/audio/liblo/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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 23:06:57 -0000 Author: dim (src committer) Date: Wed Dec 3 23:06:56 2014 New Revision: 373852 URL: https://svnweb.freebsd.org/changeset/ports/373852 QAT: https://qat.redports.org/buildarchive/r373852/ Log: Fix audio/liblo build with clang 3.5.0 On 64-bit arches, audio/liblo will fail to compile with clang 3.5.0, due to the following -Werror warning: message.c:1000:17: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] abs((char *) d - (char *) end), m); ^ On 64-bit arches, pointer differences are usually longs, but simply replacing the abs() call with labs() is also not a good solution, because then the code is incorrect for 32-bit arches. Fix this by using a ternary operator expression, which is type-safe. While here, fix the printf format conversion specifier for printing ptrdiff_t's. Approved by: portmgr (antoine) Added: head/audio/liblo/files/patch-src-messages.c (contents, props changed) Added: head/audio/liblo/files/patch-src-messages.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/audio/liblo/files/patch-src-messages.c Wed Dec 3 23:06:56 2014 (r373852) @@ -0,0 +1,13 @@ +--- src/message.c.orig 2014-01-20 12:49:42.000000000 +0100 ++++ src/message.c 2014-12-03 23:02:28.000000000 +0100 +@@ -996,8 +996,8 @@ void lo_message_pp(lo_message m) + putchar('\n'); + if (d != end) { + fprintf(stderr, +- "liblo warning: type and data do not match (off by %d) in message %p\n", +- abs((char *) d - (char *) end), m); ++ "liblo warning: type and data do not match (off by %td) in message %p\n", ++ d >= end ? (char *) d - (char *) end : (char *) end - (char *) d, m); + } + } +