Commit 21e536fd authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot

Merge topic 'cppcheck-fixes-2016-07'

7cc19500 Fixed/suppressed various cppcheck warnings
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1669
parents 46214aae 7cc19500
Pipeline #19149 running with stage
......@@ -13,7 +13,7 @@
//=========================================================================
// This file contains enough suppressions to result in no cppcheck warnings,
// at least on Mac OS X with cppcheck 1.72.
// at least on Mac OS X with cppcheck 1.74.
// To run:
// cd /path/to/VTK/
......@@ -63,12 +63,17 @@ useInitializationList
assertWithSideEffect
argumentSize
// A regression between 1.73 and 1.74 results in lots of false positives for this warning
// <https://sourceforge.net/p/cppcheck/discussion/general/thread/21296d8f/?limit=25#6cab>
clarifyCondition
// False positives.
argumentSize:Common/DataModel/vtkAMRBox.cxx
argumentSize:Common/DataModel/vtkStructuredGrid.h
arrayIndexOutOfBounds:Common/DataModel/vtkCell.h
assignBoolToPointer:Common/Math/vtkMatrix4x4.h
AssignmentAddressToInteger:Common/Math/vtkPolynomialSolversUnivariate.cxx
CastIntegerToAddressAtReturn:Geovis/Core/vtkGeoTreeNode.h
clarifyCondition:Rendering/Core/Testing/Cxx/TestInteractorStyleImageProperty.cxx
comparisonOfBoolWithInvalidComparator:Rendering/Label/vtkLabeledTreeMapDataMapper.cxx
copyCtorPointerCopying:IO/NetCDF/vtkSLACReader.cxx
......@@ -115,15 +120,15 @@ unsafeClassCanLeak:Filters/General/vtkDensifyPolyData.cxx
unsafeClassCanLeak:GUISupport/Qt/QVTKInteractorInternal.h
unsafeClassCanLeak:Interaction/Widgets/vtkBiDimensionalRepresentation.h
unusedAllocatedMemory:IO/Legacy/vtkDataWriter.cxx
unusedStructMember:Common/Core/vtkTypeList.txx
unusedStructMember:Common/Misc/vtkHeap.cxx
unusedStructMember:IO/Image/vtkMRCReader.cxx
unusedStructMember:IO/Infovis/vtkTulipReader.cxx
uselessAssignmentArg:Common/DataModel/vtkReebGraph.cxx
uselessAssignmentPtrArg:Filters/General/vtkYoungsMaterialInterface.cxx
uselessAssignmentPtrArg:IO/Parallel/vtkPImageWriter.cxx
uselessAssignmentPtrArg:Wrapping/Tools/vtkParse.tab.c
zerodiv:Filters/ParallelFlowPaths/Testing/Cxx/TestPStreamGeometry.cxx
unusedStructMember:Common/Core/vtkTypeList.txx
CastIntegerToAddressAtReturn:Geovis/Core/vtkGeoTreeNode.h
// Not worth fixing, but not actually false positives.
passedByValue:Filters/General/vtkYoungsMaterialInterface.cxx
......
......@@ -949,8 +949,7 @@ vtkCellArray* vtkIntersectionPolyDataFilter::Impl
vtkSmartPointer< vtkDoubleArray > angleList =
vtkSmartPointer< vtkDoubleArray >::New();
angleList->Allocate(points->GetNumberOfPoints());
bool *interPtBool;
interPtBool = new bool[points->GetNumberOfPoints()];
bool *interPtBool = new bool[points->GetNumberOfPoints()];
for (vtkIdType ptId = 0; ptId < points->GetNumberOfPoints(); ptId++)
{
......@@ -1062,6 +1061,7 @@ vtkCellArray* vtkIntersectionPolyDataFilter::Impl
{
splitCells->Delete();
splitCells = NULL;
delete [] interPtBool;
return splitCells;
}
//For each loop, orient and triangulate
......@@ -1076,8 +1076,7 @@ vtkCellArray* vtkIntersectionPolyDataFilter::Impl
vtkSmartPointer<vtkCellArray>::New();
std::list<simPoint>::iterator it;
int ptiter=0;
int *pointMapper;
pointMapper = new int[loops[k].points.size()];
int *pointMapper = new int[loops[k].points.size()];
for (it = loops[k].points.begin(); it != loops[k].points.end(); ++it)
{
if (ptiter < (int) loops[k].points.size()-1)
......@@ -1154,6 +1153,8 @@ vtkCellArray* vtkIntersectionPolyDataFilter::Impl
splitCells->Delete();
splitCells = NULL;
delete [] pointMapper;
delete [] interPtBool;
return splitCells;
}
}
......
......@@ -152,7 +152,7 @@ void vtkOpenGLImageGradient::ThreadedRequestData(
fragShader +=
" float dz = textureOffset(inputTex1, vec3(tcoordVSOutput, zPos), ivec3(0,0,1)).r\n"
" - textureOffset(inputTex1, vec3(tcoordVSOutput, zPos), ivec3(0,0,-1)).r;\n"
" dz = inputScale*0.5*dz/spacing.z;\n";
" dz = inputScale*0.5*dz/spacing.z;\n"
" gl_FragData[0] = vec4(dx, dy, dz, 1.0);\n"
"}\n";
}
......
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