Commit 5a55f3a6 authored by Sean McBride's avatar Sean McBride

Updates for new cppcheck 1.82

- fixed one warning about division by 0 from public API:

Rendering/Label/vtkLabeledTreeMapDataMapper.cxx:656: style: Public interface of vtkLabeledTreeMapDataMapper is not safe. When calling vtkLabeledTreeMapDataMapper::SetFontSizeRange(), if parameter delta is 0 that leads to division by zero.

- removed suppressions for false positives that are now fixed
- added suppressions for new false positives
parent 8ca560b3
......@@ -13,7 +13,7 @@
//=========================================================================
// This file contains enough suppressions to result in no cppcheck warnings,
// at least on macOS with cppcheck 1.81.
// at least on macOS with cppcheck 1.82.
// To run:
// cd /path/to/VTK/
......@@ -87,13 +87,13 @@ uselessAssignmentPtrArg:Wrapping/Tools/vtkParse.tab.c
knownConditionTrueFalse:IO/Exodus/vtkExodusIIReader.cxx
knownConditionTrueFalse:IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
// false positive: <http://trac.cppcheck.net/ticket/7889>
knownConditionTrueFalse:IO/Parallel/vtkMultiBlockPLOT3DReader.cxx
knownConditionTrueFalse:Parallel/MPI/Testing/Cxx/ExerciseMultiProcessController.cxx
// false positive: <https://trac.cppcheck.net/ticket/8346>
syntaxError:Accelerators/Vtkm/vtkmlib/Portals.hxx:120,error,syntax error
syntaxError:Common/Math/vtkQuaternion.txx:134,error,syntax error
syntaxError:Rendering/OpenGL2/vtkOpenGLVertexBufferObject.cxx:179,error,syntax error
// false positive: <http://trac.cppcheck.net/ticket/7896>
unassignedVariable:Common/Transforms/vtkHomogeneousTransform.cxx
unassignedVariable:Rendering/Core/vtkCamera.cxx
// false positive: <https://trac.cppcheck.net/ticket/8367>
CastIntegerToAddressAtReturn:Common/ExecutionModel/vtkAlgorithm.h
// Not worth fixing, but not actually false positives.
duplicateExpression:Common/Math/Testing/Cxx/TestPolynomialSolversUnivariate.cxx
......
......@@ -653,13 +653,19 @@ int vtkLabeledTreeMapDataMapper::ConvertToDC(float *binfo, float *newBinfo)
void vtkLabeledTreeMapDataMapper::SetFontSizeRange(int maxSize, int minSize,
int delta)
{
int nLevels = (maxSize - minSize) / delta;
int i, s;
if (nLevels < 0)
if (maxSize < minSize)
{
vtkErrorMacro(<<"maxSize is smaller than minSize");
return;
}
if (delta < 1)
{
vtkErrorMacro(<<"delta must be positive");
return;
}
int nLevels = (maxSize - minSize) / delta;
int i, s;
if ((maxSize - (nLevels * delta)) > minSize)
{
......
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