Package: ray / 2.3.1-4

gcc-6.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: allow compilation in GCC6
 GCC6 seems to handle implicit casts from iostream to bool differently.
 This patch adds explicit checks for !stream.fail() instead of relying on
 implicit conversion to do The Right Thing.
Author: Sascha Steinbiss <sascha@steinbiss.name>
--- a/code/GeneOntology/GeneOntology.cpp
+++ b/code/GeneOntology/GeneOntology.cpp
@@ -218,7 +218,7 @@
 		cout<<m_annotationFileName<<endl;
 
 		ifstream test1(m_ontologyFileName.c_str());
-		bool test1Result=test1;
+		bool test1Result=!(test1.fail());
 		test1.close();
 
 		if(!test1Result){
@@ -227,7 +227,7 @@
 		}
 
 		ifstream test2(m_annotationFileName.c_str());
-		bool test2Result=test2;
+		bool test2Result=!(test2.fail());
 		test2.close();
 
 		if(!test2Result){
--- a/code/Mock/Parameters.cpp
+++ b/code/Mock/Parameters.cpp
@@ -1069,7 +1069,7 @@
 	bool hasCommandFile=false;
 	if(argc==2){
 		ifstream f(argv[1]);
-		hasCommandFile=f;
+		hasCommandFile=!(f.fail());
 		f.close();
 	}
 
--- a/code/SequencesLoader/Loader.cpp
+++ b/code/SequencesLoader/Loader.cpp
@@ -47,7 +47,7 @@
 
 int Loader::load(string file,bool isGenome){
 	ifstream f(file.c_str());
-	bool exists=f;
+	bool exists=!(f.fail());
 	f.close();
 	if(!exists){
 		cout<<"Ray: cannot access '"<<file<<"': No such file or directory"<<endl;