From owner-svn-ports-all@FreeBSD.ORG Sat Apr 18 16:39:19 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64B0CF0F; Sat, 18 Apr 2015 16:39:19 +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 5202A2F9; Sat, 18 Apr 2015 16:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IGdJS9037825; Sat, 18 Apr 2015 16:39:19 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IGdIxc037821; Sat, 18 Apr 2015 16:39:18 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201504181639.t3IGdIxc037821@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sat, 18 Apr 2015 16:39:18 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r384240 - in head/games/netradiant: . 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.20 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: Sat, 18 Apr 2015 16:39:19 -0000 Author: danfe Date: Sat Apr 18 16:39:18 2015 New Revision: 384240 URL: https://svnweb.freebsd.org/changeset/ports/384240 Log: - Clang insists that reference cannot be bound to dereferenced null pointer in well-defined C++ code (that is correct) and evaluates comparisons like &foo == 0 to false, which breaks NetRadiant; "fix" this with a dirty hack by casting those "bad" references to a local volatile int variable (since NetRadiant is based on GtkRadiant 1.5 codebase, this is the same bug that was fixed in r384239; patches are slightly different though) - While here, make a comment more accurate, and bump port revision Added: head/games/netradiant/files/patch-radiant_treemodel.cpp (contents, props changed) Modified: head/games/netradiant/Makefile Modified: head/games/netradiant/Makefile ============================================================================== --- head/games/netradiant/Makefile Sat Apr 18 16:29:01 2015 (r384239) +++ head/games/netradiant/Makefile Sat Apr 18 16:39:18 2015 (r384240) @@ -3,7 +3,7 @@ PORTNAME= netradiant PORTVERSION= 20130630 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= games cad MASTER_SITES= http://ingar.satgnu.net/gtkradiant/files/ \ http://freebsd.nsu.ru/distfiles/ @@ -48,7 +48,7 @@ pre-install: # Fix permissions of some files (drop bogus execute bit) @${FIND} ${WRKSRC}/install/osirion.game -type f | ${XARGS} ${CHMOD} a-x @${CHMOD} a-x ${WRKSRC}/install/games/osirion.game -# Remove extra copy of GNU GPL from what we install +# Remove a copy of GNU GPL from what we are going to install @${RM} ${WRKSRC}/install/GPL.txt do-install: Added: head/games/netradiant/files/patch-radiant_treemodel.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/netradiant/files/patch-radiant_treemodel.cpp Sat Apr 18 16:39:18 2015 (r384240) @@ -0,0 +1,56 @@ +--- radiant/treemodel.cpp.orig 2013-06-30 14:04:35 UTC ++++ radiant/treemodel.cpp +@@ -647,7 +647,12 @@ void detach( const NameCallback& callbac + }; + + void node_attach_name_changed_callback( scene::Node& node, const NameCallback& callback ){ +- if ( &node != 0 ) { ++ // Reference cannot be bound to dereferenced null pointer in a ++ // well-defined C++ code, and Clang will assume that comparison ++ // below always evaluates to true, resulting in segmentation ++ // fault. Use a dirty hack to force Clang to check for null. ++ volatile int n = (int)&node; ++ if ( n != 0 ) { + Nameable* nameable = Node_getNameable( node ); + if ( nameable != 0 ) { + nameable->attach( callback ); +@@ -655,7 +660,8 @@ void node_attach_name_changed_callback( + } + } + void node_detach_name_changed_callback( scene::Node& node, const NameCallback& callback ){ +- if ( &node != 0 ) { ++ volatile int n = (int)&node; // see the comment on line 650 ++ if ( n != 0 ) { + Nameable* nameable = Node_getNameable( node ); + if ( nameable != 0 ) { + nameable->detach( callback ); +@@ -1124,7 +1130,8 @@ void graph_tree_model_row_deleted( Graph + const char* node_get_name( scene::Node& node ); + + const char* node_get_name_safe( scene::Node& node ){ +- if ( &node == 0 ) { ++ volatile int n = (int)&node; // see the comment on line 650 ++ if ( n == 0 ) { + return ""; + } + return node_get_name( node ); +@@ -1142,7 +1149,8 @@ GraphTreeNode* graph_tree_model_find_par + } + + void node_attach_name_changed_callback( scene::Node& node, const NameCallback& callback ){ +- if ( &node != 0 ) { ++ volatile int n = (int)&node; // see the comment on line 650 ++ if ( n != 0 ) { + Nameable* nameable = Node_getNameable( node ); + if ( nameable != 0 ) { + nameable->attach( callback ); +@@ -1150,7 +1158,8 @@ void node_attach_name_changed_callback( + } + } + void node_detach_name_changed_callback( scene::Node& node, const NameCallback& callback ){ +- if ( &node != 0 ) { ++ volatile int n = (int)&node; // see the comment on line 650 ++ if ( n != 0 ) { + Nameable* nameable = Node_getNameable( node ); + if ( nameable != 0 ) { + nameable->detach( callback );