commit:     d55c0c3e014959829692300601108a1deb9e1a61
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Sat Dec  1 13:45:03 2018 +0000
Commit:     Azamat H. Hackimov <winterheart <AT> gentoo <DOT> ru>
CommitDate: Sat Dec  1 13:45:03 2018 +0000
URL:        https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=d55c0c3e

games-sports/stuntrally: fix build for gcc6

Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../stuntrally/files/stuntrally-2.6_gcc6-fix.patch | 153 +++++++++++++++++++++
 games-sports/stuntrally/stuntrally-2.6.ebuild      |   4 +
 2 files changed, 157 insertions(+)

diff --git a/games-sports/stuntrally/files/stuntrally-2.6_gcc6-fix.patch 
b/games-sports/stuntrally/files/stuntrally-2.6_gcc6-fix.patch
new file mode 100644
index 0000000..88174fc
--- /dev/null
+++ b/games-sports/stuntrally/files/stuntrally-2.6_gcc6-fix.patch
@@ -0,0 +1,153 @@
+From f7703d8d3f30c34479e5ee0965bff8f8ed85c024 Mon Sep 17 00:00:00 2001
+From: Michael Straube <strau...@gmx.de>
+Date: Thu, 17 Nov 2016 19:54:59 +0100
+Subject: [PATCH] Fix gcc6 build errors
+
+---
+ source/ogre/CarModel_Create.cpp |  2 +-
+ source/vdrift/cartire.cpp       | 32 ++++++++++++++++----------------
+ source/vdrift/model_obj.cpp     |  2 +-
+ source/vdrift/texture.h         |  2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/source/ogre/CarModel_Create.cpp b/source/ogre/CarModel_Create.cpp
+index 834eac714..f53d88f85 100644
+--- a/source/ogre/CarModel_Create.cpp
++++ b/source/ogre/CarModel_Create.cpp
+@@ -130,7 +130,7 @@ void CarModel::Load(int startId)
+ 
+       ///  load config .car
+       string pathCar;
+-      pApp->gui->GetCarPath(&pathCar, 0, 0, sDirname, pApp->mClient);  // 
force orig for newtorked games
++      pApp->gui->GetCarPath(&pathCar, 0, 0, sDirname, pApp->mClient.get() != 
0);  // force orig for newtorked games
+       LoadConfig(pathCar);
+       
+       
+diff --git a/source/vdrift/cartire.cpp b/source/vdrift/cartire.cpp
+index dd6dd487d..253d098f7 100644
+--- a/source/vdrift/cartire.cpp
++++ b/source/vdrift/cartire.cpp
+@@ -114,25 +114,25 @@ MATHVECTOR<Dbl,3> CARTIRE::GetForce(
+       alpha = -atan2(hub_velocity[1], denom) * 180.0/PI_d;
+ 
+       /*crash dyn obj--*/
+-      if (isnan(alpha) || isnan(1.f/sigma_hat))
++      if (std::isnan(alpha) || std::isnan(1.f/sigma_hat))
+       {
+               MATHVECTOR<Dbl,3> outvec(0, 0, 0);
+               return outvec;
+       }
+-      assert(!isnan(alpha));
++      assert(!std::isnan(alpha));
+ 
+       Dbl gamma = current_camber * 180.0/PI_d;
+ 
+       //  beckman method for pre-combining longitudinal and lateral forces
+-      Dbl s = sigma / sigma_hat;  assert(!isnan(s));
+-      Dbl a = alpha / alpha_hat;  assert(!isnan(a));
++      Dbl s = sigma / sigma_hat;  assert(!std::isnan(s));
++      Dbl a = alpha / alpha_hat;  assert(!std::isnan(a));
+ 
+       Dbl rho = std::max( sqrt( s*s+a*a ), 0.0001);  //avoid divide by zero
+-      assert(!isnan(rho));
++      assert(!std::isnan(rho));
+ 
+       Dbl max_Fx(0), max_Fy(0), max_Mz(0);
+-      Dbl Fx = (s / rho) * Pacejka_Fx( rho*sigma_hat, Fz,        
friction_coeff, max_Fx );  assert(!isnan(Fx));
+-      Dbl Fy = (a / rho) * Pacejka_Fy( rho*alpha_hat, Fz, gamma, 
friction_coeff, max_Fy );  assert(!isnan(Fy));
++      Dbl Fx = (s / rho) * Pacejka_Fx( rho*sigma_hat, Fz,        
friction_coeff, max_Fx );  assert(!std::isnan(Fx));
++      Dbl Fy = (a / rho) * Pacejka_Fy( rho*alpha_hat, Fz, gamma, 
friction_coeff, max_Fy );  assert(!std::isnan(Fy));
+       Dbl Mz = Pacejka_Mz( sigma, alpha, Fz, gamma, friction_coeff, max_Mz );
+ 
+       if (slips)  // out vis
+@@ -158,8 +158,8 @@ MATHVECTOR<Dbl,3> CARTIRE::GetForce(
+       {
+               //scale down forces to fit into the maximum
+               Dbl sc = maxforce / combforce;
+-              Fx *= sc;  assert(!isnan(Fx));  max_Fx *= sc;  //vis only
+-              Fy *= sc;  assert(!isnan(Fy));  max_Fy *= sc;
++              Fx *= sc;  assert(!std::isnan(Fx));  max_Fx *= sc;  //vis only
++              Fy *= sc;  assert(!std::isnan(Fy));     max_Fy *= sc;
+               //std::cout << "Limiting " << combforce << " to " << maxforce 
<< std::endl;
+       }/**/
+ 
+@@ -180,14 +180,14 @@ MATHVECTOR<Dbl,3> CARTIRE::GetForce(
+               Fx = 0;
+       }else
+       {       Dbl scale = sqrt(1.0-(Fy/max_Fy)*(Fy/max_Fy));
+-              if (isnan(scale))
++              if (std::isnan(scale))
+                       Fx = 0;
+               else
+                       Fx = Fx*scale;
+       }/**/
+ 
+-      assert(!isnan(Fx));
+-      assert(!isnan(Fy));
++      assert(!std::isnan(Fx));
++      assert(!std::isnan(Fy));
+ 
+       /*if ( hub_velocity.Magnitude () < 0.1 )
+       {
+@@ -279,7 +279,7 @@ Dbl CARTIRE::Pacejka_Fx (Dbl sigma, Dbl Fz, Dbl 
friction_coeff, Dbl & maxforce_o
+ 
+       maxforce_output = D;
+ 
+-      assert(!isnan(Fx));
++      assert(!std::isnan(Fx));
+       return Fx;
+ }
+ 
+@@ -290,7 +290,7 @@ Dbl CARTIRE::Pacejka_Fy (Dbl alpha, Dbl Fz, Dbl gamma, Dbl 
friction_coeff, Dbl &
+ 
+       Dbl D = ( a[1]*Fz+a[2] ) *Fz*friction_coeff;
+       Dbl B = a[3]*sin ( 2.0*atan ( Fz/a[4] ) ) * ( 1.0-a[5]*std::abs ( gamma 
) ) / ( a[0]* ( a[1]*Fz+a[2] ) *Fz );
+-      assert(!isnan(B));
++      assert(!std::isnan(B));
+       Dbl E = a[6]*Fz+a[7];
+       Dbl S = alpha + a[8]*gamma+a[9]*Fz+a[10];
+       Dbl Sv = ( ( a[11]*Fz+a[12] ) *gamma + a[13] ) *Fz+a[14];
+@@ -300,7 +300,7 @@ Dbl CARTIRE::Pacejka_Fy (Dbl alpha, Dbl Fz, Dbl gamma, Dbl 
friction_coeff, Dbl &
+ 
+       //LogO("Fy: "+fToStr(alpha,4,6)+" "+fToStr(Fz,4,6)+" 
"+fToStr(gamma,4,6)+" "+fToStr(friction_coeff,4,6)+" 
"+fToStr(maxforce_output,4,6));
+ 
+-      assert(!isnan(Fy));
++      assert(!std::isnan(Fy));
+       return Fy;
+ }
+ 
+@@ -318,7 +318,7 @@ Dbl CARTIRE::Pacejka_Mz (Dbl sigma, Dbl alpha, Dbl Fz, Dbl 
gamma, Dbl friction_c
+ 
+       maxforce_output = D+Sv;
+ 
+-      assert(!isnan(Mz));
++      assert(!std::isnan(Mz));
+       return Mz;
+ }
+ 
+diff --git a/source/vdrift/model_obj.cpp b/source/vdrift/model_obj.cpp
+index 338d12205..e67c1db0d 100644
+--- a/source/vdrift/model_obj.cpp
++++ b/source/vdrift/model_obj.cpp
+@@ -205,7 +205,7 @@ bool MODEL_OBJ::Save(const std::string & strFileName, 
std::ostream & error_outpu
+       std::ofstream f(strFileName.c_str());
+       if (!f)
+       {
+-              error_output << "Error opening file for writing: " << 
error_output << endl;
++              error_output << "Error opening file for writing: " << endl;
+               return false;
+       }
+       
+diff --git a/source/vdrift/texture.h b/source/vdrift/texture.h
+index b21846a7b..eda00983a 100644
+--- a/source/vdrift/texture.h
++++ b/source/vdrift/texture.h
+@@ -125,7 +125,7 @@ class TEXTURELIBRARY
+               bool FileExists(const std::string & filename)
+               {
+                       std::ifstream f(filename.c_str());
+-                      return f;
++                      return static_cast<bool>(f);
+               }
+ 
+       public:

diff --git a/games-sports/stuntrally/stuntrally-2.6.ebuild 
b/games-sports/stuntrally/stuntrally-2.6.ebuild
index 2352fba..49d0882 100644
--- a/games-sports/stuntrally/stuntrally-2.6.ebuild
+++ b/games-sports/stuntrally/stuntrally-2.6.ebuild
@@ -43,6 +43,10 @@ PDEPEND="${LIVE_PDEPEND}"
 
 REQUIRED_USE="editor? ( game )"
 
+PATCHES=(
+       "${FILESDIR}/${P}_gcc6-fix.patch"
+)
+
 DOCS=(Readme.txt)
 
 src_configure() {

Reply via email to