Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/salm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommi A Pirinen <tommi.antero.pirinen@uni-hamburg.de>2017-12-22 18:43:59 +0300
committerTommi A Pirinen <tommi.antero.pirinen@uni-hamburg.de>2017-12-22 18:43:59 +0300
commita92d177d086614be67aef885b0568e32d895f5ef (patch)
tree3f297eee8a8fce8a90698276e67ce3a62bc5fe26
parent1f269bb53733fde890105f29b5c22ac93a828960 (diff)
fix gcc-6.4 compilation error
solution from stack overflow, e.g. <https://stackoverflow.com/questions/32589155/stdofstream-null-wont-compile-for-std-gnu11-any-workaround>
-rwxr-xr-xSrc/IndexSA/_MonoCorpus.cpp2
-rwxr-xr-xSrc/Utils/_UniversalVocabulary.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Src/IndexSA/_MonoCorpus.cpp b/Src/IndexSA/_MonoCorpus.cpp
index fe3ce38..369d2ff 100755
--- a/Src/IndexSA/_MonoCorpus.cpp
+++ b/Src/IndexSA/_MonoCorpus.cpp
@@ -156,7 +156,7 @@ void C_MonoCorpus::loadCorpusAndSort(const char *fileName, const char * idVocFil
ifstream textStream1;
textStream1.open(fileName);
- if(textStream1==NULL){
+ if(!textStream1){
fprintf(stderr,"Text %s does not exist. Exit!\n",fileName);
exit(-1);
}
diff --git a/Src/Utils/_UniversalVocabulary.cpp b/Src/Utils/_UniversalVocabulary.cpp
index 9822c94..f034409 100755
--- a/Src/Utils/_UniversalVocabulary.cpp
+++ b/Src/Utils/_UniversalVocabulary.cpp
@@ -40,7 +40,7 @@ void C_UniversalVocabulary::updateWithNewCorpus(const char * newCorpusFileName)
ifstream textStream;
textStream.open(newCorpusFileName);
- if(textStream==NULL){
+ if(!textStream){
fprintf(stderr,"Corpus file %s does not exist. Exit!\n",newCorpusFileName);
exit(-1);
}