From 9d25cb872022e08161672cb070735fb52440b625 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 7 Feb 2019 12:53:52 +0100 Subject: CppTools: Avoid unused values Value stored to 'newPosStart' during its initialization is never read [clang-analyzer-deadcode.DeadStores] Change-Id: Ib8e16cd1bfc3930588e4c10639f463d4f742da0e Reviewed-by: Orgad Shaneh --- src/plugins/cpptools/cppselectionchanger.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/plugins/cpptools/cppselectionchanger.cpp') diff --git a/src/plugins/cpptools/cppselectionchanger.cpp b/src/plugins/cpptools/cppselectionchanger.cpp index e19c1711a6..98437c1ced 100644 --- a/src/plugins/cpptools/cppselectionchanger.cpp +++ b/src/plugins/cpptools/cppselectionchanger.cpp @@ -560,7 +560,6 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions) qDebug() << "Is raw literal."; // Start from positions that include quotes. - int newPosStart = positions.astPosStart; int newPosEnd = positions.astPosEnd; // Decrement last position to skip last quote. @@ -572,7 +571,7 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions) // Start position will be the end position minus the size of the actual contents of the // literal. - newPosStart = newPosEnd - static_cast(firstToken.string->size()); + int newPosStart = newPosEnd - static_cast(firstToken.string->size()); // Skip raw literal parentheses. if (isRawLiteral) @@ -591,13 +590,8 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions) if (debug) qDebug() << "Selecting inner contents of char literal."; - int newPosStart = positions.astPosStart; - int newPosEnd = positions.astPosEnd; - newPosEnd = newPosEnd - 1; - newPosStart = newPosEnd - static_cast(firstToken.literal->size()); - - positions.astPosStart = newPosStart; - positions.astPosEnd = newPosEnd; + positions.astPosEnd = positions.astPosEnd - 1; + positions.astPosStart = positions.astPosEnd - int(firstToken.literal->size()); } } } else if (ForStatementAST *forStatementAST = ast->asForStatement()) { -- cgit v1.2.1