Commit af9812bc authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot
Browse files

Merge topic 'cppcheck-fixes2'

3df75ed1 Fixed misc cppcheck warnings:
171efbea Fixed cast/alignment warning by cppcheck
22ad855c Update cppcheck suppressions
e1836ec3

 Fix cppcheck leak warnings
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !1187
parents a0e478cc 3df75ed1
Pipeline #6671 failed with stage
......@@ -13,7 +13,7 @@
//=========================================================================
// This file contains enough suppressions to result in no cppcheck warnings,
// at least on Mac OS X 10.9 with cppcheck 1.72.
// at least on Mac OS X with cppcheck 1.72.
// To run:
// cd /path/to/VTK/
......@@ -28,7 +28,6 @@
// Can't fix in portable way for all VTK-supported platforms.
duplicateExpression:IO/PostgreSQL/vtkPostgreSQLQuery.cxx
obsoleteFunctionsasctime
unpreciseMathCall
// VTK assumes IEEE 754 floats, so this warning isn't useful.
......@@ -38,7 +37,6 @@ memsetClassFloat
clarifyCalculation
cstyleCast
invalidscanf
invalidscanf_libc
noCopyConstructor
noExplicitConstructor
operatorEqVarError
......@@ -114,8 +112,6 @@ operatorEq
postfixOperator
unusedStructMember
// Unsure about these.
exceptRethrowCopy:IO/Core/vtkUTF8TextCodec.cxx
// To investigate further...
memleak:Wrapping/Tools/vtkParsePreprocess.c
unsafeClassCanLeak:GUISupport/Qt/QVTKInteractorInternal.h
unsafeClassCanLeak:Views/Qt/vtkQtListView.h
nullPointerRedundantCheck:IO/Exodus/vtkExodusIIReaderParser.cxx
......@@ -157,8 +157,7 @@ void IntersectWithCell(unsigned nTest,
int TestIntersectWithLine(int argc, char* argv[])
{
std::ostringstream vtkmsg_with_warning_C4701;
ostream& strm = vtkmsg_with_warning_C4701;
std::ostringstream strm;
strm << "Test vtkCell::IntersectWithLine Start" << endl;
vtkSmartPointer<vtkRenderWindow> renderWindow =
......
......@@ -38,7 +38,6 @@ vtkAMRDataSetCache::~vtkAMRDataSetCache()
{
iter->second->Delete();
}
this->Cache.erase( iter );
}
}
......
......@@ -106,7 +106,7 @@ void vtkUTF8TextCodec::ToUnicode(istream& InputStream,
}
else
{
throw ef;
throw;
}
}
}
......
......@@ -121,7 +121,7 @@ static bool CheckStencilExtents(
j >= stencilExt[2] && j <= stencilExt[3] &&
k >= stencilExt[4] && k <= stencilExt[5])
{
match &= !inside ^ (*p > 127);
match &= (!inside) ^ (*p > 127);
}
else
{
......
......@@ -86,9 +86,7 @@ void vtkCompositer::ResizeFloatArray(vtkFloatArray* fa, int numComp,
{
MPI_Free_mem(ptr);
}
char* tptr;
MPI_Alloc_mem(size*numComp*sizeof(float), NULL, &tptr);
ptr = (float*)tptr;
MPI_Alloc_mem(size*numComp*sizeof(float), NULL, &ptr);
fa->SetArray(ptr, size*numComp, 1);
}
else
......@@ -114,9 +112,7 @@ void vtkCompositer::ResizeUnsignedCharArray(vtkUnsignedCharArray* uca,
{
MPI_Free_mem(ptr);
}
char* tptr;
MPI_Alloc_mem(size*numComp*sizeof(unsigned char), NULL, &tptr);
ptr = (unsigned char*)tptr;
MPI_Alloc_mem(size*numComp*sizeof(unsigned char), NULL, &ptr);
uca->SetArray(ptr, size*numComp, 1);
}
else
......
......@@ -102,6 +102,7 @@ vtkQtListView::~vtkQtListView()
{
delete this->ListView;
delete this->TableAdapter;
delete this->TableSorter;
}
//----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment