Running astyle, no functional change.
This commit is contained in:
parent
33d7631ee3
commit
06e818f89d
|
@ -685,7 +685,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
|
|||
}
|
||||
|
||||
// Perform type checks
|
||||
ArgumentInfo argInfo(argListTok, _settings, _tokenizer->isCPP());
|
||||
ArgumentInfo argInfo(argListTok, _settings, _tokenizer->isCPP());
|
||||
|
||||
if (argInfo.typeToken && !argInfo.isLibraryType(_settings)) {
|
||||
if (scan) {
|
||||
|
@ -1383,7 +1383,7 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * tok, const Settings *settings,
|
|||
, _template(false)
|
||||
, address(false)
|
||||
, tempToken(0)
|
||||
, isCPP(isCPP)
|
||||
, isCPP(isCPP)
|
||||
{
|
||||
if (tok) {
|
||||
if (tok->type() == Token::eString) {
|
||||
|
@ -1445,7 +1445,7 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * tok, const Settings *settings,
|
|||
|
||||
// check for some common well known functions
|
||||
else if (isCPP && ((Token::Match(tok1->previous(), "%var% . size|empty|c_str ( ) [,)]") && isStdContainer(tok1->previous())) ||
|
||||
(Token::Match(tok1->previous(), "] . size|empty|c_str ( ) [,)]") && isStdContainer(tok1->previous()->link()->previous())))) {
|
||||
(Token::Match(tok1->previous(), "] . size|empty|c_str ( ) [,)]") && isStdContainer(tok1->previous()->link()->previous())))) {
|
||||
tempToken = new Token(0);
|
||||
tempToken->fileIndex(tok1->fileIndex());
|
||||
tempToken->linenr(tok1->linenr());
|
||||
|
@ -1530,8 +1530,8 @@ namespace {
|
|||
|
||||
bool CheckIO::ArgumentInfo::isStdVectorOrString()
|
||||
{
|
||||
if (!isCPP)
|
||||
return false;
|
||||
if (!isCPP)
|
||||
return false;
|
||||
if (variableInfo->isStlType(stl_vector)) {
|
||||
typeToken = variableInfo->typeStartToken()->tokAt(4);
|
||||
_template = true;
|
||||
|
@ -1595,8 +1595,8 @@ namespace {
|
|||
|
||||
bool CheckIO::ArgumentInfo::isStdContainer(const Token *tok)
|
||||
{
|
||||
if (!isCPP)
|
||||
return false;
|
||||
if (!isCPP)
|
||||
return false;
|
||||
if (tok && tok->variable()) {
|
||||
const Variable* variable = tok->variable();
|
||||
if (variable->isStlType(stl_container)) {
|
||||
|
|
|
@ -86,7 +86,7 @@ private:
|
|||
bool element;
|
||||
bool _template;
|
||||
bool address;
|
||||
bool isCPP;
|
||||
bool isCPP;
|
||||
Token *tempToken;
|
||||
|
||||
private:
|
||||
|
|
|
@ -1975,7 +1975,7 @@ void Tokenizer::concatenateNegativeNumberAndAnyPositive()
|
|||
|
||||
void Tokenizer::simplifyExternC()
|
||||
{
|
||||
if (isC())
|
||||
if (isC())
|
||||
return;
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, "extern \"C\" {|")) {
|
||||
|
@ -9492,9 +9492,9 @@ void Tokenizer::simplifyAsm()
|
|||
}
|
||||
}
|
||||
|
||||
void Tokenizer::simplifyAsm2()
|
||||
void Tokenizer::simplifyAsm2()
|
||||
{
|
||||
// Put ^{} statements in asm()
|
||||
// Put ^{} statements in asm()
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::simpleMatch(tok, "^ {")) {
|
||||
Token * start = tok;
|
||||
|
@ -9849,13 +9849,13 @@ void Tokenizer::simplifyMicrosoftStringFunctions()
|
|||
// Remove Borland code
|
||||
void Tokenizer::simplifyBorland()
|
||||
{
|
||||
// skip if not Windows
|
||||
// skip if not Windows
|
||||
if (_settings->platformType != Settings::Win32A &&
|
||||
_settings->platformType != Settings::Win32W &&
|
||||
_settings->platformType != Settings::Win64)
|
||||
return;
|
||||
if (isC())
|
||||
return;
|
||||
if (isC())
|
||||
return;
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, "( __closure * %name% )")) {
|
||||
tok->deleteNext();
|
||||
|
|
|
@ -620,7 +620,7 @@ public:
|
|||
*/
|
||||
void simplifyAsm();
|
||||
|
||||
/**
|
||||
/**
|
||||
* asm heuristics, Put ^{} statements in asm()
|
||||
*/
|
||||
void simplifyAsm2();
|
||||
|
|
|
@ -5868,7 +5868,7 @@ private:
|
|||
void borland() {
|
||||
// __closure
|
||||
ASSERT_EQUALS("int * a ;",
|
||||
tokenizeAndStringify("int (__closure *a)();", false, true, Settings::Win32A));
|
||||
tokenizeAndStringify("int (__closure *a)();", false, true, Settings::Win32A));
|
||||
|
||||
// __property
|
||||
ASSERT_EQUALS("class Fred { ; __property ; } ;",
|
||||
|
|
|
@ -75,13 +75,13 @@ private:
|
|||
}
|
||||
|
||||
|
||||
void check(const char code[], Settings::PlatformType platform = Settings::Unspecified) {
|
||||
void check(const char code[], Settings::PlatformType platform = Settings::Unspecified) {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
Settings settings;
|
||||
settings.addEnabled("style");
|
||||
settings.platform(platform);
|
||||
settings.platform(platform);
|
||||
|
||||
// Tokenize..
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
|
@ -518,7 +518,7 @@ private:
|
|||
"public:\n"
|
||||
" Foo() { }\n"
|
||||
" __property int x = {read=getx}\n"
|
||||
"};", Settings::Win32A);
|
||||
"};", Settings::Win32A);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue