Fix some C++11-related compilation errors (clang)

This commit is contained in:
Phil Williams 2015-06-19 15:58:14 +01:00
parent f29f67710e
commit 90470e878d
3 changed files with 5 additions and 9 deletions

View File

@ -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);
}

View File

@ -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) {

View File

@ -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";
}