mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-05 15:58:03 +03:00
Fix some C++11-related compilation errors (clang)
This commit is contained in:
parent
f29f67710e
commit
90470e878d
@ -62,7 +62,7 @@ void Vocabulary::Save(const string& fileName ) const
|
||||
vcbFile.open( fileName.c_str(), ios::out | ios::ate | ios::trunc);
|
||||
|
||||
if (!vcbFile) {
|
||||
cerr << "Failed to open " << vcbFile << endl;
|
||||
cerr << "Failed to open " << fileName << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ void Vocabulary::Load(const string& fileName )
|
||||
vcbFile.open(fileName.c_str());
|
||||
|
||||
if (!vcbFile) {
|
||||
cerr << "no such file or directory: " << vcbFile << endl;
|
||||
cerr << "no such file or directory: " << fileName << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,8 @@ std::auto_ptr<RuleTableLoader> RuleTableLoaderFactory::Create(
|
||||
{
|
||||
InputFileStream input(path);
|
||||
std::string line;
|
||||
bool cont = std::getline(input, line);
|
||||
|
||||
if (cont) {
|
||||
if (std::getline(input, line)) {
|
||||
std::vector<std::string> tokens;
|
||||
Tokenize(tokens, line);
|
||||
if (tokens.size() == 1) {
|
||||
|
@ -148,13 +148,10 @@ int main(int argc, char** argv)
|
||||
cerr << lineNum << " ";
|
||||
}
|
||||
|
||||
bool success;
|
||||
success = getline(strmSource, lineSource);
|
||||
if (!success) {
|
||||
if (!getline(strmSource, lineSource)) {
|
||||
throw "Couldn't read source";
|
||||
}
|
||||
success = getline(strmAlignment, lineAlignment);
|
||||
if (!success) {
|
||||
if (!getline(strmAlignment, lineAlignment)) {
|
||||
throw "Couldn't read alignment";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user