From d252a64ec83c787d3c7fde5332a0a25b36e1fee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 12 Apr 2017 10:44:08 +0200 Subject: [PATCH] Cleanup CheckFunctions::checkIgnoredReturnValue --- lib/checkfunctions.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/lib/checkfunctions.cpp b/lib/checkfunctions.cpp index b12856485..0455e78e4 100644 --- a/lib/checkfunctions.cpp +++ b/lib/checkfunctions.cpp @@ -159,30 +159,8 @@ void CheckFunctions::checkIgnoredReturnValue() // skip c++11 initialization, ({...}) if (Token::Match(tok, "%var%|(|, {")) tok = tok->linkAt(1); - - if (Token::Match(tok->previous(), "%name% (")) { - bool semicolon = false; - for (const Token *tok2 = tok->tokAt(2); tok2 && tok2->str() != ")"; tok2 = tok2->next()) { - if (tok2->str() == ";") - semicolon = true; - else if (Token::Match(tok2, "[({]")) - tok2 = tok2->link(); - } - if (semicolon) - tok = tok->link(); - } - - if (Token::simpleMatch(tok, ") (") && Token::Match(tok->link()->previous(), "%name% (")) { - while (tok && tok->str() != ";") { - if (Token::Match(tok, "(|[")) - tok = tok->link(); - else - tok = tok->next(); - } - if (!tok) - break; - continue; - } + else if (tok->str() == "(") + tok = tok->link(); if (tok->varId() || !Token::Match(tok, "%name% (")) continue;