CheckOther: Improved the check that checks 'if (condition) var=true;'
This commit is contained in:
parent
f0f117d4f6
commit
8a1ec67b22
|
@ -244,9 +244,10 @@ void WarningIf()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for 'if (condition) flag = true;'
|
// Search for 'if (condition) flag = true;'
|
||||||
|
bool newstatement = false;
|
||||||
for (TOKEN *tok = tokens; tok; tok = tok->next)
|
for (TOKEN *tok = tokens; tok; tok = tok->next)
|
||||||
{
|
{
|
||||||
if (strcmp(tok->str,"if"))
|
if (!newstatement || strcmp(tok->str,"if"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int parlevel = 0;
|
int parlevel = 0;
|
||||||
|
@ -287,6 +288,8 @@ void WarningIf()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newstatement = (strchr("{};",tok->str[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue