Minor updates. Make sure there is no doublechecking. Don't perform certain checks upon c-files.
This commit is contained in:
parent
ad75792512
commit
0fd16be44b
20
main.cpp
20
main.cpp
|
@ -94,7 +94,9 @@ static void CppCheck(const char FileName[])
|
||||||
//WarningHeaderWithImplementation();
|
//WarningHeaderWithImplementation();
|
||||||
|
|
||||||
// Warning upon c-style pointer casts
|
// Warning upon c-style pointer casts
|
||||||
WarningOldStylePointerCast();
|
const char *ext = strrchr(FileName, '.');
|
||||||
|
if (ext && stricmp(ext,".c"))
|
||||||
|
WarningOldStylePointerCast();
|
||||||
|
|
||||||
// Use standard functions instead
|
// Use standard functions instead
|
||||||
WarningIsDigit();
|
WarningIsDigit();
|
||||||
|
@ -159,6 +161,13 @@ void combine_2tokens(TOKEN *tok, const char str1[], const char str2[])
|
||||||
|
|
||||||
void Tokenize(const char FileName[])
|
void Tokenize(const char FileName[])
|
||||||
{
|
{
|
||||||
|
// Has this file been tokenized already?
|
||||||
|
for (unsigned int i = 0; i < Files.size(); i++)
|
||||||
|
{
|
||||||
|
if ( stricmp(Files[i].c_str(), FileName) == 0 )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::ifstream fin(FileName);
|
std::ifstream fin(FileName);
|
||||||
if (!fin.is_open())
|
if (!fin.is_open())
|
||||||
return;
|
return;
|
||||||
|
@ -1106,6 +1115,13 @@ void WarningIncludeHeader()
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
// Redundant code..
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void WarningRedundantCode()
|
void WarningRedundantCode()
|
||||||
{
|
{
|
||||||
for (TOKEN *tok = tokens; tok; tok = tok->next)
|
for (TOKEN *tok = tokens; tok; tok = tok->next)
|
||||||
|
@ -1149,3 +1165,5 @@ void WarningRedundantCode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue