[Robot etc.] remove superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-18 02:54:09 +02:00
parent c619e7bbda
commit 7b4e014263
5 changed files with 9 additions and 9 deletions

View File

@@ -656,7 +656,7 @@ void PointsGrid::Validate (const PointKernel &rclPoints)
void PointsGrid::Validate ()
{
if (_pclPoints == nullptr)
if (!_pclPoints)
return;
if (_pclPoints->size() != _ulCtElements)

View File

@@ -720,7 +720,7 @@ Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Arra
bool bParaCor,
double fSizeFactor)
{
if (_pvcPoints != nullptr) {
if (_pvcPoints) {
delete _pvcPoints;
_pvcPoints = nullptr;
delete _pvcUVParam;

View File

@@ -113,7 +113,7 @@ int WaypointPy::PyInit(PyObject* args, PyObject* kwd)
else
getWaypointPtr()->Type = Waypoint::UNDEF;
if (vel == nullptr)
if (!vel)
switch (getWaypointPtr()->Type) {
case Waypoint::PTP:
getWaypointPtr()->Velocity = 100;
@@ -132,7 +132,7 @@ int WaypointPy::PyInit(PyObject* args, PyObject* kwd)
getWaypointPtr()->Cont = cont ? true : false;
getWaypointPtr()->Tool = tool;
getWaypointPtr()->Base = base;
if (acc == nullptr)
if (!acc)
getWaypointPtr()->Acceleration = 100;
else
getWaypointPtr()->Acceleration = Base::UnitsApi::toDouble(acc, Base::Unit::Acceleration);

View File

@@ -178,16 +178,16 @@ void CmdRobotInsertWaypointPreselect::activated(int)
Robot::TrajectoryObject *pcTrajectoryObject;
if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
if (Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
pcTrajectoryObject = static_cast<Robot::TrajectoryObject*>(Sel[0].pObject);
else {
else {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select one Trajectory object."));
return;
}
std::string TrakName = pcTrajectoryObject->getNameInDocument();
if(PreSel.pDocName == nullptr){
if (!PreSel.pDocName) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No preselection"),
QObject::tr("You have to hover above a geometry (Preselection) with the mouse to use this command. See documentation for details."));
return;

View File

@@ -94,7 +94,7 @@ void ShapeValidator::checkEdge(const TopoDS_Shape& shape)
void ShapeValidator::checkAndAdd(const TopoDS_Shape &shape, Handle(ShapeExtend_WireData) *aWD)
{
checkEdge(shape);
if (aWD != nullptr) {
if (aWD) {
BRepBuilderAPI_Copy copier(shape);
// make a copy of the shape and the underlying geometry to avoid to affect the input shapes
(*aWD)->Add(TopoDS::Edge(copier.Shape()));
@@ -104,7 +104,7 @@ void ShapeValidator::checkAndAdd(const TopoDS_Shape &shape, Handle(ShapeExtend_W
void ShapeValidator::checkAndAdd(const Part::TopoShape &ts, const char *subName, Handle(ShapeExtend_WireData) *aWD)
{
try {
if (subName != nullptr && *subName != '\0') {
if (subName && *subName != '\0') {
//we want only the subshape which is linked
checkAndAdd(ts.getSubShape(subName), aWD);
}