Commit d15f5201 authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot

Merge topic 'cppcheck-misc'

18436989 Fixed some cppcheck warnings, suppressed others
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: David Gobbi's avatarDavid Gobbi <david.gobbi@gmail.com>
Merge-request: !4675
parents a97d8084 18436989
......@@ -41,6 +41,9 @@ memsetClassFloat
assertWithSideEffect
argumentSize
// Gives too many false positives with << stream operator.
shiftNegative
// There are *thousands* of these, too much to manage, so suppress all.
variableScope
......@@ -515,6 +518,9 @@ unreadVariable:Web/WebGLExporter/vtkWebGLWidget.cxx
unreadVariable:Wrapping/PythonCore/PyVTKObject.cxx
unreadVariable:Wrapping/PythonCore/vtkPythonOverload.cxx
// 48 warnings
noOperatorEq
// Many warnings
noCopyConstructor:Common/Core/Testing/Cxx/TestCxxFeatures.cxx
noCopyConstructor:Common/DataModel/vtkDataObjectTreeIterator.cxx
......@@ -606,6 +612,7 @@ uselessAssignmentPtrArg:Wrapping/Tools/vtkParse.tab.c
syntaxError:Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx
arrayIndexOutOfBoundsCond:IO/MINC/vtkMINCImageAttributes.cxx
uninitMemberVar:GUISupport/Qt/QVTKOpenGLWidget.cxx
unusedVariable:IO/SegY/vtkSegYReaderInternal.cxx
// false positive: <https://trac.cppcheck.net/ticket/8346>
syntaxError:Accelerators/Vtkm/vtkmlib/Portals.hxx
......@@ -634,6 +641,7 @@ knownConditionTrueFalse:Filters/Parallel/Testing/Cxx/UnitTestPMaskPoints.cxx
knownConditionTrueFalse:Rendering/OSPRay/vtkOSPRayRendererNode.cxx
nullPointer:Wrapping/Tools/lex.yy.c
passedByValue:Filters/General/vtkYoungsMaterialInterface.cxx
uninitMemberVar:Common/DataModel/vtkStaticPointLocator2D.cxx
// Style, not really problematic:
duplicateAssignExpression:Rendering/Context2D/vtkMarkerUtilities.cxx
......
......@@ -145,7 +145,9 @@ struct vtkBucketList2D
// Utility class to store an array of ij values
struct NeighborBuckets2D
{
// Start with an array to avoid memory allocation overhead
// Start with an array to avoid memory allocation overhead.
// Initially, P will alias InitialBuffer, but could later
// be assigned dynamically allocated memory.
int InitialBuffer[VTK_INITIAL_BUCKET_SIZE*2];
int *P;
vtkIdType Count;
......
......@@ -81,6 +81,7 @@ struct ExchangeBoundsWorker : public WorkerBase
ExchangeBoundsWorker(vtkMPIController* subController) :
WorkerBase(subController)
{
memset(this->Bounds, 0, sizeof(this->Bounds));
}
bool Execute(const double bounds[6], const vtkSmartPointer<vtkDataArray> & allBoundsArray)
......@@ -128,8 +129,9 @@ protected:
struct FindMyNeighborsWorker : public WorkerBase
{
FindMyNeighborsWorker(vtkMPIController* subController) :
WorkerBase(subController)
WorkerBase(subController), MyNeighbors(nullptr)
{
memset(this->Bounds, 0, sizeof(this->Bounds));
}
bool Execute(const double bounds[6],
......@@ -198,7 +200,8 @@ protected:
struct AssemblePointsAndRegionIdsWorker : public WorkerBase
{
AssemblePointsAndRegionIdsWorker(vtkMPIController* subController) :
WorkerBase(subController)
WorkerBase(subController), RegionStarts(nullptr),
PointsForMyNeighbors(nullptr), RegionIdsForMyNeighbors(nullptr)
{
}
......@@ -290,7 +293,8 @@ struct SendReceivePointsWorker : public WorkerBase
{
SendReceivePointsWorker(vtkMPIController* subController) :
WorkerBase(subController)
WorkerBase(subController), PointsFromMyNeighbors(nullptr),
RegionIdsFromMyNeighbors(nullptr)
{
}
......
......@@ -821,6 +821,7 @@ vtkStandardNewMacro(vtkVeraOutReader);
vtkVeraOutReader::vtkVeraOutReader()
{
this->FileName = nullptr;
this->NumberOfTimeSteps = 0;
this->TimeSteps.clear();
this->SetNumberOfInputPorts(0);
this->SetNumberOfOutputPorts(1);
......
......@@ -44,7 +44,7 @@ vtkCxxSetObjectMacro(vtkOrderIndependentTranslucentPass,TranslucentPass,vtkRende
// ----------------------------------------------------------------------------
vtkOrderIndependentTranslucentPass::vtkOrderIndependentTranslucentPass() :
Framebuffer(nullptr)
Framebuffer(nullptr), State(nullptr)
{
this->TranslucentPass=nullptr;
......
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