astyle formatting
This commit is contained in:
parent
08ea6435ac
commit
5acd6fcdc8
|
@ -1395,8 +1395,7 @@ void CheckOther::checkConstVariable()
|
|||
{
|
||||
//Is it the right side of an initialization of a non-const reference
|
||||
bool usedInAssignment = false;
|
||||
for (const Token* tok = var->nameToken(); tok != scope->bodyEnd && tok != nullptr; tok = tok->next())
|
||||
{
|
||||
for (const Token* tok = var->nameToken(); tok != scope->bodyEnd && tok != nullptr; tok = tok->next()) {
|
||||
if (!Token::Match(tok, "& %var% = %varid%", var->declarationId()))
|
||||
continue;
|
||||
const Variable* refvar = tok->next()->variable();
|
||||
|
@ -1410,12 +1409,10 @@ void CheckOther::checkConstVariable()
|
|||
}
|
||||
// Skip if we ever cast this variable to a pointer/reference to a non-const type
|
||||
{
|
||||
bool castToNonConst = [&]
|
||||
{
|
||||
bool castToNonConst = [&] {
|
||||
for (const Token* tok = var->nameToken(); tok != scope->bodyEnd && tok != nullptr; tok = tok->next())
|
||||
{
|
||||
if (tok->isCast())
|
||||
{
|
||||
if (tok->isCast()) {
|
||||
bool isConst = 0 != (tok->valueType()->constness & (1 << tok->valueType()->pointer));
|
||||
if (!isConst)
|
||||
return true;
|
||||
|
|
|
@ -1144,8 +1144,7 @@ private:
|
|||
void findFunctionInBase(const std::string & name, nonneg int args, std::vector<const Function *> & matches) const;
|
||||
};
|
||||
|
||||
enum class Reference
|
||||
{
|
||||
enum class Reference {
|
||||
None,
|
||||
LValue,
|
||||
RValue
|
||||
|
|
|
@ -967,8 +967,7 @@ private:
|
|||
ASSERT(p->valueType()->pointer == 1);
|
||||
}
|
||||
|
||||
void VariableValueTypeReferences()
|
||||
{
|
||||
void VariableValueTypeReferences() {
|
||||
{
|
||||
GET_SYMBOL_DB("void foo(int x) {}\n");
|
||||
const Variable* const p = db->getVariableFromVarId(1);
|
||||
|
|
Loading…
Reference in New Issue