[Libreoffice-commits] core.git: compilerplugins/clang idlc/source sc/source starmath/qa

Noel Grandin noel.grandin at collabora.co.uk
Thu Apr 6 13:03:40 UTC 2017


 compilerplugins/clang/redundantcast.cxx |    3 ++-
 idlc/source/aststack.cxx                |    2 +-
 sc/source/core/data/table4.cxx          |    2 +-
 starmath/qa/cppunit/test_node.cxx       |    8 ++++----
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 6768a9b602c5cd6b4702faf862cac60527bded99
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Apr 6 14:22:55 2017 +0200

    loplugin:redundantcast check for c-style casts to void
    
    Change-Id: Ic8b99f590436f94825e471bc61411c69fd768862
    Reviewed-on: https://gerrit.libreoffice.org/36208
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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();


More information about the Libreoffice-commits mailing list