diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-08-18 18:36:29 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-08-18 18:36:29 (GMT) |
commit | 7b6349da4dc968691f1a374211fcc153c8b4f1c6 (patch) | |
tree | bb0fc76955ef3166c3416522fef009c9d65ab7f3 /Source/cmFortranParserImpl.cxx | |
parent | 50ad1e0a144ae1f2267a4966789e5a16372f458e (diff) | |
download | CMake-7b6349da4dc968691f1a374211fcc153c8b4f1c6.zip CMake-7b6349da4dc968691f1a374211fcc153c8b4f1c6.tar.gz CMake-7b6349da4dc968691f1a374211fcc153c8b4f1c6.tar.bz2 |
CMake: don't use else after return
Diffstat (limited to 'Source/cmFortranParserImpl.cxx')
-rw-r--r-- | Source/cmFortranParserImpl.cxx | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 7d04898..30a33b4 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -22,29 +22,27 @@ bool cmFortranParser_s::FindIncludeFile(const char* dir, if (cmSystemTools::FileIsFullPath(includeName)) { fileName = includeName; return cmSystemTools::FileExists(fileName.c_str(), true); - } else { - // Check for the file in the directory containing the including - // file. - std::string fullName = dir; + } + // Check for the file in the directory containing the including + // file. + std::string fullName = dir; + fullName += "/"; + fullName += includeName; + if (cmSystemTools::FileExists(fullName.c_str(), true)) { + fileName = fullName; + return true; + } + + // Search the include path for the file. + for (std::vector<std::string>::const_iterator i = this->IncludePath.begin(); + i != this->IncludePath.end(); ++i) { + fullName = *i; fullName += "/"; fullName += includeName; if (cmSystemTools::FileExists(fullName.c_str(), true)) { fileName = fullName; return true; } - - // Search the include path for the file. - for (std::vector<std::string>::const_iterator i = - this->IncludePath.begin(); - i != this->IncludePath.end(); ++i) { - fullName = *i; - fullName += "/"; - fullName += includeName; - if (cmSystemTools::FileExists(fullName.c_str(), true)) { - fileName = fullName; - return true; - } - } } return false; } @@ -88,9 +86,8 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname) cmFortran_yy_switch_to_buffer(buffer, parser->Scanner); parser->FileStack.push(f); return 1; - } else { - return 0; } + return 0; } bool cmFortranParser_FilePop(cmFortranParser* parser) @@ -99,15 +96,14 @@ bool cmFortranParser_FilePop(cmFortranParser* parser) // to the next one on the stack. if (parser->FileStack.empty()) { return 0; - } else { - cmFortranFile f = parser->FileStack.top(); - parser->FileStack.pop(); - fclose(f.File); - YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner); - cmFortran_yy_delete_buffer(current, parser->Scanner); - cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner); - return 1; } + cmFortranFile f = parser->FileStack.top(); + parser->FileStack.pop(); + fclose(f.File); + YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner); + cmFortran_yy_delete_buffer(current, parser->Scanner); + cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner); + return 1; } int cmFortranParser_Input(cmFortranParser* parser, char* buffer, |