[vtk-developers] cppcheck help with: vtkPlanes, vtkX3DExporterFIWriter, vtkXdmfHeavyData, vtkGPUVolumeRayCastMapper, vtkLineWidget
Sean McBride
sean at rogue-research.com
Wed Dec 2 20:31:13 EST 2015
Hi all,
Anyone know these classes? These cppcheck diagnostics are not false positives.
(a)
uselessAssignmentPtrArg,Common/DataModel/vtkPlanes.cxx:341,warning,Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
This is likely copy-paste from method above. Fixing it may require changing the signature of this public API.
(b)
stlcstr,IO/Export/vtkX3DExporterFIWriter.cxx:143,error,Dangerous usage of c_str(). The value returned by c_str() is invalid after this call.
Change return type? Make copy?
(c)
duplicateExpressionTernary,IO/Xdmf2/vtkXdmfHeavyData.cxx:1199,style,Same expression in both branches of ternary operator.
count[0] += (update_extents[5] - update_extents[4] > 0)? 1 : 1;
Clearly odd.
(d)
duplicateExpression,Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx:296,style,Same expression on both sides of '-'.
Copy-paste? Missing +1?
(e)
knownConditionTrueFalse,Interaction/Widgets/vtkLineWidget.cxx:743,style,Condition '!forward' is always true
Copy-paste? or failure to use return value of ForwardEvent()?
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the vtk-developers
mailing list