Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jul 2018 11:05:19 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r475879 - in head/games/warmux: . files
Message-ID:  <201807301105.w6UB5JnZ075399@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Mon Jul 30 11:05:18 2018
New Revision: 475879
URL: https://svnweb.freebsd.org/changeset/ports/475879

Log:
  games/warmux: Fix build with Clang 6
  
  interface/weapon_menu.cpp:394:12: error: cannot initialize return object of type 'Weapon *' with an rvalue of type 'bool'
      return false;
             ^~~~~
  
  http://beefy12.nyi.freebsd.org/data/head-amd64-default/p475478_s336801/logs/errors/warmux-11.04.1_9.log
  
  map/tile.cpp:676:30: error: non-constant-expression cannot be narrowed from type
        'uint' (aka 'unsigned int') to 'uint16_t' (aka 'unsigned short') in initializer
        list [-Wc++11-narrowing]
        SynchTileInfo info = { i, t->GetSynchsum() };
                               ^

Added:
  head/games/warmux/files/patch-src_interface_weapon__menu.cpp   (contents, props changed)
Modified:
  head/games/warmux/Makefile

Modified: head/games/warmux/Makefile
==============================================================================
--- head/games/warmux/Makefile	Mon Jul 30 10:07:28 2018	(r475878)
+++ head/games/warmux/Makefile	Mon Jul 30 11:05:18 2018	(r475879)
@@ -19,10 +19,13 @@ LIB_DEPENDS=	libxml++-2.6.so:textproc/libxml++26 \
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	cxx_present=yes
-USES=		dos2unix gmake pkgconfig tar:bzip2
+USES=		compiler dos2unix gmake pkgconfig tar:bzip2
 USE_SDL=	sdl image mixer ttf gfx net
 DOS2UNIX_GLOB=	fixed_class.h
 
+# build ignores CXXFLAGS
+CFLAGS+=	${CFLAGS_${CHOSEN_COMPILER_TYPE}}
+CFLAGS_clang=	-Wno-c++11-narrowing
 WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSION:R}
 
 OPTIONS_DEFINE=	FRIBIDI SERVER NLS DEBUG

Added: head/games/warmux/files/patch-src_interface_weapon__menu.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/warmux/files/patch-src_interface_weapon__menu.cpp	Mon Jul 30 11:05:18 2018	(r475879)
@@ -0,0 +1,15 @@
+interface/weapon_menu.cpp:394:12: error: cannot initialize return object of type 'Weapon *' with an rvalue of type 'bool'
+    return false;
+           ^~~~~
+
+--- src/interface/weapon_menu.cpp.orig	2018-07-30 10:50:34 UTC
++++ src/interface/weapon_menu.cpp
+@@ -391,7 +391,7 @@ void WeaponsMenu::Draw()
+ Weapon * WeaponsMenu::UpdateCurrentOverflyItem(const Polygon * poly)
+ {
+   if (!show)
+-    return false;
++    return NULL;
+   const std::vector<PolygonItem *>& items = poly->GetItem();
+   WeaponMenuItem * tmp;
+   Interface::GetInstance()->SetCurrentOverflyWeapon(NULL);



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