[yade] 02/03: Fix compilation with GCC-5. (Closes: #778190).

Anton Gladky gladk at moszumanska.debian.org
Tue Feb 17 00:48:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository yade.

commit fef7397da44a77774be81d745484dee46dc11844
Author: Anton Gladky <gladk at debian.org>
Date:   Mon Feb 16 23:55:49 2015 +0100

    Fix compilation with  GCC-5. (Closes: #778190).
---
 debian/patches/05_fix_FTBFS_GCC5.patch | 64 ++++++++++++++++++++++++++++++++++
 debian/patches/series                  |  1 +
 2 files changed, 65 insertions(+)

diff --git a/debian/patches/05_fix_FTBFS_GCC5.patch b/debian/patches/05_fix_FTBFS_GCC5.patch
new file mode 100644
index 0000000..7baf779
--- /dev/null
+++ b/debian/patches/05_fix_FTBFS_GCC5.patch
@@ -0,0 +1,64 @@
+From 459085df5e3bdab39aae879d65a6e8198249ebf4 Mon Sep 17 00:00:00 2001
+From: Anton Gladky <gladky.anton at gmail.com>
+Date: Mon, 16 Feb 2015 23:50:18 +0100
+Subject: [PATCH] Fix compilation with  GCC-5. (Closes: #778190)
+
+---
+ lib/base/Math.hpp                | 1 +
+ pkg/dem/Disp2DPropLoadEngine.cpp | 3 +--
+ pkg/dem/MicroMacroAnalyser.cpp   | 6 ++----
+ 3 files changed, 4 insertions(+), 6 deletions(-)
+
+Index: yade/lib/base/Math.hpp
+===================================================================
+--- yade.orig/lib/base/Math.hpp
++++ yade/lib/base/Math.hpp
+@@ -65,6 +65,7 @@ using std::make_pair;
+ #include <boost/foreach.hpp>
+ #include <boost/tuple/tuple.hpp>
+ #include <boost/filesystem/convenience.hpp>
++#include <boost/filesystem.hpp>
+ #include <boost/filesystem/operations.hpp>
+ #include <boost/filesystem/exception.hpp>
+ #include <boost/numeric/conversion/bounds.hpp>
+Index: yade/pkg/dem/Disp2DPropLoadEngine.cpp
+===================================================================
+--- yade.orig/pkg/dem/Disp2DPropLoadEngine.cpp
++++ yade/pkg/dem/Disp2DPropLoadEngine.cpp
+@@ -19,9 +19,8 @@ YADE_PLUGIN((Disp2DPropLoadEngine));
+ void Disp2DPropLoadEngine::postLoad(Disp2DPropLoadEngine&)
+ {
+ 	std::string outputFile="DirSearch" + Key + "Yade";
+-	bool file_exists = std::ifstream (outputFile.c_str()); //if file does not exist, we will write colums titles
+ 	ofile.open(outputFile.c_str(), std::ios::app);
+-	if (!file_exists) ofile<<"theta (!angle in plane (gamma,-du) ) dtau (kPa) dsigma (kPa) dgamma (m) du (m) tau0 (kPa) sigma0 (kPa) d2W coordSs0 coordTot0 coordSsF coordTotF (Yade)" << endl;
++	if (!boost::filesystem::exists( outputFile.c_str() )) ofile<<"theta (!angle in plane (gamma,-du) ) dtau (kPa) dsigma (kPa) dgamma (m) du (m) tau0 (kPa) sigma0 (kPa) d2W coordSs0 coordTot0 coordSsF coordTotF (Yade)" << endl;
+ }
+ 
+ 
+Index: yade/pkg/dem/MicroMacroAnalyser.cpp
+===================================================================
+--- yade.orig/pkg/dem/MicroMacroAnalyser.cpp
++++ yade/pkg/dem/MicroMacroAnalyser.cpp
+@@ -29,9 +29,8 @@ MicroMacroAnalyser::~MicroMacroAnalyser(
+ 
+ void MicroMacroAnalyser::postLoad(MicroMacroAnalyser&)
+ {
+-	bool file_exists = std::ifstream(outputFile.c_str());  //if file does not exist, we will write colums titles
+ 	ofile.open(outputFile.c_str(), std::ios::app);
+-	if (!file_exists) ofile<<"iteration eps1w eps2w eps3w eps11g eps22g eps33g eps12g eps13g eps23g"<< endl;
++	if (!boost::filesystem::exists( outputFile.c_str() )) ofile<<"iteration eps1w eps2w eps3w eps11g eps22g eps33g eps12g eps13g eps23g"<< endl;
+ }
+ 
+ void MicroMacroAnalyser::action()
+@@ -51,9 +50,8 @@ void MicroMacroAnalyser::action()
+ 	if (!initialized) {
+ 		setState(1,true,false);
+ 		//Check file here again, to make sure we write to the correct file when filename is modified after the scene is loaded
+-		bool file_exists = std::ifstream(outputFile.c_str());
+ 		ofile.open(outputFile.c_str(), std::ios::app);
+-		if (!file_exists) ofile<<"iteration eps1w eps2w eps3w eps11g eps22g eps33g eps12g eps13g eps23g"<< endl;
++		if (!boost::filesystem::exists( outputFile.c_str() )) ofile<<"iteration eps1w eps2w eps3w eps11g eps22g eps33g eps12g eps13g eps23g"<< endl;
+ 		initialized=true;
+ 	} else if (scene->iter % interval == 0) {
+ 		setState(2, true, compIncrt);
diff --git a/debian/patches/series b/debian/patches/series
index b4e6505..26b412c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01_remove_google_analytics.patch
+05_fix_FTBFS_GCC5.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/yade.git



More information about the debian-science-commits mailing list