From 741073cc219a36f999f46104982d6f5574f6bec3 Mon Sep 17 00:00:00 2001 From: Gianluca Scacco Date: Sun, 9 Aug 2009 15:44:01 +0200 Subject: [PATCH] Style check --- src/checkautovariables.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/checkautovariables.cpp b/src/checkautovariables.cpp index 86eb8ed4e..0c75ca3b7 100644 --- a/src/checkautovariables.cpp +++ b/src/checkautovariables.cpp @@ -200,7 +200,7 @@ void CheckAutoVariables::autoVariables() { addVD(tok->tokAt(2)); } - // Inside a function body + // Inside a function body else if (bindent > 0 && Token::Match(tok, "%type% %var% [")) { addVDA(tok->tokAt(1)); @@ -241,15 +241,15 @@ void CheckAutoVariables::autoVariables() "autoVariables", "Return of the address of an auto-variable"); } - // Invalid pointer deallocation + // Invalid pointer deallocation else if (bindent > 0 && Token::Match(tok, "free ( %var% ) ;")) - { - if (isAutoVarArray(tok->tokAt(2))) - reportError(tok, + { + if (isAutoVarArray(tok->tokAt(2))) + reportError(tok, Severity::error, "autoVariables", "Invalid deallocation"); - } + } } vd_list.clear(); vda_list.clear();