Minor refactorings. rename token. cleanup if/else.

This commit is contained in:
Dmitry-Me 2014-09-02 16:10:51 +02:00 committed by Daniel Marjamäki
parent f717f4c6b8
commit 7342a81ea7
2 changed files with 5 additions and 7 deletions

View File

@ -158,12 +158,11 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
return false; return false;
} }
if (!_files.empty()) { if (_files.empty()) {
return true;
} else {
std::cout << "cppcheck: error: no files to check - all paths ignored." << std::endl; std::cout << "cppcheck: error: no files to check - all paths ignored." << std::endl;
return false; return false;
} }
return true;
} }
int CppCheckExecutor::check(int argc, const char* const argv[]) int CppCheckExecutor::check(int argc, const char* const argv[])

View File

@ -1597,10 +1597,9 @@ void CheckBufferOverrun::checkInsecureCmdLineArgs()
std::size_t functions = symbolDatabase->functionScopes.size(); std::size_t functions = symbolDatabase->functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) { for (std::size_t i = 0; i < functions; ++i) {
const Scope * scope = symbolDatabase->functionScopes[i]; const Function * function = symbolDatabase->functionScopes[i]->function;
Function * j = scope->function; if (function) {
if (j) { const Token* tok = function->token;
const Token* tok = j->token;
// Get the name of the argv variable // Get the name of the argv variable
unsigned int varid = 0; unsigned int varid = 0;