Style: Updated the coding style with "astyle"
This commit is contained in:
parent
7495190312
commit
ea1f3f4e85
|
@ -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;
|
||||||
|
|
|
@ -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])
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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
16
token.h
|
@ -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.
|
||||||
|
|
16
tokenize.cpp
16
tokenize.cpp
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue