+ fixes #0002075: Analysis of FreeCAD by PVS-Studio static analyzer

This commit is contained in:
wmayer
2015-05-01 16:56:31 +02:00
parent d8f63bcfd1
commit dd2b39ddd6
21 changed files with 59 additions and 91 deletions

View File

@@ -225,10 +225,11 @@ Py::Int WaypointPy::getTool(void) const
void WaypointPy::setTool(Py::Int arg)
{
if((int)arg.operator long() > 0)
getWaypointPtr()->Tool = (int)arg.operator long();
long value = static_cast<long>(arg);
if (value >= 0)
getWaypointPtr()->Tool = value;
else
Base::Exception("negativ tool not allowed!");
throw Py::ValueError("negative tool not allowed!");
}
Py::Int WaypointPy::getBase(void) const
@@ -238,10 +239,11 @@ Py::Int WaypointPy::getBase(void) const
void WaypointPy::setBase(Py::Int arg)
{
if((int)arg.operator long() > 0)
getWaypointPtr()->Base = (int)arg.operator long();
long value = static_cast<long>(arg);
if (value >= 0)
getWaypointPtr()->Base = value;
else
Base::Exception("negativ base not allowed!");
throw Py::ValueError("negative base not allowed!");
}
PyObject *WaypointPy::getCustomAttributes(const char* /*attr*/) const