Propagate static and const modifiers.

No functional change.
This commit is contained in:
Slava Semushin 2009-05-22 21:20:32 +07:00
parent e72583b663
commit 4bd1c3fb00
3 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@ bool isTypeName(const Token *tok)
{
bool ret = false;
std::string _str = tok->str();
const char *type[] = {"case", "return", "delete", 0};
static const char * const type[] = {"case", "return", "delete", 0};
for (int i = 0; type[i]; i++)
ret |= (_str == type[i]);
return !ret;

View File

@ -258,7 +258,7 @@ void CheckOther::WarningIf()
continue;
// Check that there is a condition..
const char *p[6] = {"==", "<=", ">=", "!=", "<", ">"};
static const char * const p[6] = {"==", "<=", ">=", "!=", "<", ">"};
bool iscond = false;
for (int i = 0; i < 6; i++)
{

View File

@ -128,9 +128,9 @@ int main()
// Generate documentation..
std::cout << "Generate doc.." << std::endl;
const unsigned int NUMSUITE = 5;
static const char * const suite[NUMSUITE] = { "error", "all", "style", "all + style", "security" };
for (unsigned int i = 0; i < NUMSUITE; ++i)
{
const char *suite[NUMSUITE] = { "error", "all", "style", "all + style", "security" };
const Message::Settings settings[NUMSUITE] = { Message::error, Message::all, Message::style, Message::style_all, Message::security };
std::cout << " =" << suite[i] << "=" << std::endl;
for (std::list<Message>::const_iterator it = err.begin(); it != err.end(); ++it)