From 20e28bb687a9ea1804ae8faceb3971f47ca93b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 9 Dec 2008 07:25:00 +0000 Subject: [PATCH] Variable usage : 2 more fixes --- CheckOther.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CheckOther.cpp b/CheckOther.cpp index 7b3dc6e13..262a5301f 100644 --- a/CheckOther.cpp +++ b/CheckOther.cpp @@ -844,7 +844,7 @@ static bool isOp(const TOKEN *tok) tok->str() == ">" || tok->str() == ">=" || tok->str() == "<<" || - TOKEN::Match(tok, "[+-*/&|,]"))); + TOKEN::Match(tok, "[+-*/&|,[]]"))); } void CheckOther::functionVariableUsage() @@ -892,6 +892,9 @@ void CheckOther::functionVariableUsage() if ((TOKEN::Match(tok,"[(=&!]") || isOp(tok)) && TOKEN::Match(tok->next(), "%var%")) varUsage[ tok->strAt(1) ] |= USAGE_READ; + if (TOKEN::Match(tok, "-=|+=|*=|/= %var%")) + varUsage[ tok->strAt(1) ] |= USAGE_READ; + if (TOKEN::Match(tok, "%var%") && (tok->next()->str()==")" || isOp(tok->next()))) varUsage[ tok->str() ] |= USAGE_READ;