diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 14:22:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 13:03:06 +0000 |
commit | 6768a9b602c5cd6b4702faf862cac60527bded99 (patch) | |
tree | fa7048ac03cd0c9bd00949e2ce236980ccaf3efd | |
parent | ad16351d9d8fd440bb8941c453b802ad5c109b23 (diff) |
loplugin:redundantcast check for c-style casts to void
Change-Id: Ic8b99f590436f94825e471bc61411c69fd768862
Reviewed-on: https://gerrit.libreoffice.org/36208
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | compilerplugins/clang/redundantcast.cxx | 3 | ||||
-rw-r--r-- | idlc/source/aststack.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table4.cxx | 2 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_node.cxx | 8 |
4 files changed, 8 insertions, 7 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx index 59e21657f548..e157e05668bd 100644 --- a/compilerplugins/clang/redundantcast.cxx +++ b/compilerplugins/clang/redundantcast.cxx @@ -307,7 +307,8 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) { return true; } bool bBuiltinType = t1->isSpecificBuiltinType(BuiltinType::Bool) || t1->isSpecificBuiltinType(BuiltinType::Double) - || t1->isSpecificBuiltinType(BuiltinType::Float); + || t1->isSpecificBuiltinType(BuiltinType::Float) + || t1->isSpecificBuiltinType(BuiltinType::Void); if ((bBuiltinType || loplugin::TypeCheck(t1).Typedef()) && t1 == t2) { // Ignore FD_ISSET expanding to "...(SOCKET)(fd)..." in some Microsoft diff --git a/idlc/source/aststack.cxx b/idlc/source/aststack.cxx index 1eaddbaabb42..13afe71bd886 100644 --- a/idlc/source/aststack.cxx +++ b/idlc/source/aststack.cxx @@ -64,7 +64,7 @@ AstScope* AstStack::nextToTop() return nullptr; tmp = top(); // Save top - (void) pop(); // Pop it + pop(); // Pop it retval = top(); // Get next one down (void) push(tmp); // Push top back return retval; // Return next one down diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index ac6e5e04ddfb..db5b1bebbb40 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -410,7 +410,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); for (SCSIZE i=1; i<nCount && rListData; i++) { - (void)GetString(nCol, nRow, aStr); + GetString(nCol, nRow, aStr); if (!rListData->GetSubIndex(aStr, rListIndex, bMatchCase)) rListData = nullptr; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index 3a450b5329f5..e36b8100f682 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -71,10 +71,10 @@ void NodeTest::testTdf47813() #undef MATRIX ScopedVclPtrInstance<VirtualDevice> pOutputDevice; SmFormat aFmt; - (void)pNodeA->Arrange(*pOutputDevice, aFmt); - (void)pNodeC->Arrange(*pOutputDevice, aFmt); - (void)pNodeL->Arrange(*pOutputDevice, aFmt); - (void)pNodeR->Arrange(*pOutputDevice, aFmt); + pNodeA->Arrange(*pOutputDevice, aFmt); + pNodeC->Arrange(*pOutputDevice, aFmt); + pNodeL->Arrange(*pOutputDevice, aFmt); + pNodeR->Arrange(*pOutputDevice, aFmt); long nWidthA = pNodeA->GetRect().GetWidth(); long nWidthC = pNodeC->GetRect().GetWidth(); long nWidthL = pNodeL->GetRect().GetWidth(); |