svn commit: r459535 - head/games/bastet/files

Jan Beich jbeich at FreeBSD.org
Sat Jan 20 17:46:33 UTC 2018


Author: jbeich
Date: Sat Jan 20 17:46:31 2018
New Revision: 459535
URL: https://svnweb.freebsd.org/changeset/ports/459535

Log:
  games/bastet: unbreak build with Clang 6 (C++14 by default)
  
  Ui.cpp:174:18: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list [-Wc++11-narrowing]
      return (Dot){maxlen+1,splits.size()};
                   ^~~~~~~~
  
  Reported by:	pkg-fallout

Added:
  head/games/bastet/files/patch-Ui.cpp   (contents, props changed)

Added: head/games/bastet/files/patch-Ui.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/bastet/files/patch-Ui.cpp	Sat Jan 20 17:46:31 2018	(r459535)
@@ -0,0 +1,49 @@
+Ui.cpp:174:18: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list [-Wc++11-narrowing]
+    return (Dot){maxlen+1,splits.size()};
+                 ^~~~~~~~
+Ui.cpp:174:18: note: insert an explicit cast to silence this issue
+    return (Dot){maxlen+1,splits.size()};
+                 ^~~~~~~~
+                 static_cast<int>( )
+Ui.cpp:174:27: error: non-constant-expression cannot be narrowed from type 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >::size_type' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
+    return (Dot){maxlen+1,splits.size()};
+                          ^~~~~~~~~~~~~
+Ui.cpp:174:27: note: insert an explicit cast to silence this issue
+    return (Dot){maxlen+1,splits.size()};
+                          ^~~~~~~~~~~~~
+                          static_cast<int>( )
+Ui.cpp:236:12: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list [-Wc++11-narrowing]
+    Dot d={width+5,choices.size()};
+           ^~~~~~~
+Ui.cpp:236:12: note: insert an explicit cast to silence this issue
+    Dot d={width+5,choices.size()};
+           ^~~~~~~
+           static_cast<int>( )
+Ui.cpp:236:20: error: non-constant-expression cannot be narrowed from type 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >::size_type' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
+    Dot d={width+5,choices.size()};
+                   ^~~~~~~~~~~~~~
+Ui.cpp:236:20: note: insert an explicit cast to silence this issue
+    Dot d={width+5,choices.size()};
+                   ^~~~~~~~~~~~~~
+                   static_cast<int>( )
+
+--- Ui.cpp.orig	2009-03-20 21:49:31 UTC
++++ Ui.cpp
+@@ -171,7 +171,7 @@ namespace Bastet{
+     BOOST_FOREACH(string &s, splits){
+       maxlen=max(maxlen,s.size());
+     }
+-    return (Dot){maxlen+1,splits.size()};
++    return (Dot){(int)(maxlen+1),(int)splits.size()};
+   }
+ 
+   void Ui::MessageDialog(const std::string &message){
+@@ -233,7 +233,7 @@ namespace Bastet{
+       width=max(width,s.size());
+     }
+ 
+-    Dot d={width+5,choices.size()};
++    Dot d={(int)(width+5),(int)choices.size()};
+     BorderedWindow w(d.y,d.x);
+     wattrset((WINDOW *)w,COLOR_PAIR(20));
+     for(size_t i=0;i<choices.size();++i){


More information about the svn-ports-all mailing list