Style: Updated the coding style with "astyle"

This commit is contained in:
Daniel Marjamäki 2009-01-05 15:49:57 +00:00
parent 7495190312
commit ea1f3f4e85
48 changed files with 3411 additions and 3392 deletions

View File

@ -352,7 +352,7 @@ void CheckClass::constructors()
isPrivate = false; isPrivate = false;
// Is there a private constructor? // Is there a private constructor?
else if ( isPrivate && Token::simpleMatch(tok, classNameToken->str() + " (") ) else if (isPrivate && Token::simpleMatch(tok, (classNameToken->str() + " (").c_str()))
{ {
hasPrivateConstructor = true; hasPrivateConstructor = true;
break; break;

View File

@ -85,7 +85,8 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetAllocationType( const T
"kmalloc", "kmalloc",
"kzalloc", "kzalloc",
"kcalloc", "kcalloc",
0}; 0
};
for (unsigned int i = 0; mallocfunc[i]; i++) for (unsigned int i = 0; mallocfunc[i]; i++)
{ {
if (tok2->str() == mallocfunc[i]) if (tok2->str() == mallocfunc[i])
@ -103,7 +104,8 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetAllocationType( const T
"g_try_malloc0", "g_try_malloc0",
"g_strdup", "g_strdup",
"g_strndup", "g_strndup",
0}; 0
};
for (unsigned int i = 0; gmallocfunc[i]; i++) for (unsigned int i = 0; gmallocfunc[i]; i++)
{ {
if (tok2->str() == gmallocfunc[i]) if (tok2->str() == gmallocfunc[i])

View File

@ -112,7 +112,8 @@ std::string Preprocessor::read(std::istream &istr)
// Avoid exiting loop if string contains "-characters // Avoid exiting loop if string contains "-characters
ch = 0; ch = 0;
} }
} while ( istr.good() && ch != '\"' ); }
while (istr.good() && ch != '\"');
} }
// char constants.. // char constants..
@ -409,7 +410,7 @@ std::string Preprocessor::getcode(const std::string &filedata, std::string cfg)
static std::string Preprocessor::expandMacros( std::string code ) std::string Preprocessor::expandMacros(std::string code)
{ {
std::list<std::string> macros; std::list<std::string> macros;

View File

@ -89,7 +89,7 @@ private:
static bool match_cfg_def(std::string cfg, const std::string &def); static bool match_cfg_def(std::string cfg, const std::string &def);
static std::string expandMacros( const std::string &code ); static std::string expandMacros(std::string code);
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

16
token.h
View File

@ -29,16 +29,24 @@ public:
void str(const char s[]); void str(const char s[]);
const std::string &str() const const std::string &str() const
{ return _str; } {
return _str;
}
const char *aaaa() const const char *aaaa() const
{ return _cstr; } {
return _cstr;
}
char aaaa0() const char aaaa0() const
{ return _cstr[0]; } {
return _cstr[0];
}
char aaaa1() const char aaaa1() const
{ return _cstr[1]; } {
return _cstr[1];
}
/** /**
* Unlink and delete next token. * Unlink and delete next token.

View File

@ -855,10 +855,18 @@ void Tokenizer::simplifyTokenList()
switch (*(tok->strAt(2))) switch (*(tok->strAt(2)))
{ {
case '+': i1 += i2; break; case '+':
case '-': i1 -= i2; break; i1 += i2;
case '*': i1 *= i2; break; break;
case '/': i1 /= i2; break; case '-':
i1 -= i2;
break;
case '*':
i1 *= i2;
break;
case '/':
i1 /= i2;
break;
} }
tok = tok->next(); tok = tok->next();
std::ostringstream str; std::ostringstream str;