diff --git a/src/Mod/Mesh/App/Core/Grid.cpp b/src/Mod/Mesh/App/Core/Grid.cpp index 2e8cbe3280..4465cecdb2 100644 --- a/src/Mod/Mesh/App/Core/Grid.cpp +++ b/src/Mod/Mesh/App/Core/Grid.cpp @@ -730,7 +730,7 @@ void MeshFacetGrid::Validate (const MeshKernel &rclMesh) void MeshFacetGrid::Validate () { - if (_pclMesh == nullptr) + if (!_pclMesh) return; if (_pclMesh->CountFacets() != _ulCtElements) @@ -1072,7 +1072,7 @@ void MeshPointGrid::Validate (const MeshKernel &rclMesh) void MeshPointGrid::Validate () { - if (_pclMesh == nullptr) + if (!_pclMesh) return; if (_pclMesh->CountPoints() != _ulCtElements) diff --git a/src/Mod/Mesh/App/Core/MeshIO.cpp b/src/Mod/Mesh/App/Core/MeshIO.cpp index bc7439576f..f68ff3cbc4 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.cpp +++ b/src/Mod/Mesh/App/Core/MeshIO.cpp @@ -262,8 +262,8 @@ bool MeshInput::LoadSTL (std::istream &rstrIn) boost::algorithm::to_upper(szBuf); try { - if ((strstr(szBuf, "SOLID") == nullptr) && (strstr(szBuf, "FACET") == nullptr) && (strstr(szBuf, "NORMAL") == nullptr) && - (strstr(szBuf, "VERTEX") == nullptr) && (strstr(szBuf, "ENDFACET") == nullptr) && (strstr(szBuf, "ENDLOOP") == nullptr)) { + if (!strstr(szBuf, "SOLID") && !strstr(szBuf, "FACET") && !strstr(szBuf, "NORMAL") && + !strstr(szBuf, "VERTEX") && !strstr(szBuf, "ENDFACET") && !strstr(szBuf, "ENDLOOP")) { // probably binary STL buf->pubseekoff(0, std::ios::beg, std::ios::in); return LoadBinarySTL(rstrIn); diff --git a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp index b1879beaa9..1798aaf378 100644 --- a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp @@ -72,7 +72,7 @@ App::DocumentObjectExecReturn *SetOperations::execute() Mesh::Feature *mesh1 = dynamic_cast(Source1.getValue()); Mesh::Feature *mesh2 = dynamic_cast(Source2.getValue()); - if ((mesh1 != nullptr) && (mesh2 != nullptr)) { + if (mesh1 && mesh2) { const MeshObject& meshKernel1 = mesh1->Mesh.getValue(); const MeshObject& meshKernel2 = mesh2->Mesh.getValue(); diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp index 23ad6b15c0..5ab4431ed1 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp @@ -84,7 +84,7 @@ bool DelTriangle::IsInsertionComponent (int i, DelTriangle* pkAdj, { for (j = 0; j < 3; j++) { - if (A[j] != nullptr && A[j] != pkAdj) + if (A[j] && A[j] != pkAdj) { break; } diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp index 00e821e8fb..dc625384b6 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp @@ -632,7 +632,7 @@ const char* System::GetPath (const char* acDirectory, const char* acFilename) //---------------------------------------------------------------------------- void System::Initialize () { - assert(ms_pkDirectories == nullptr); + assert(!ms_pkDirectories); ms_pkDirectories = WM4_NEW std::vector; const char* acWm4Path = GetEnv("WM4_PATH"); @@ -839,7 +839,7 @@ const char* System::GetEnv (const char* acEnvVarName) getenv_s(&uiRequiredSize,ms_acEnvVar,SYSTEM_MAX_ENVVAR,acEnvVarName); #else char* acEnvVar = getenv(acEnvVarName); - if (acEnvVar == nullptr) + if (!acEnvVar) { return nullptr; } diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp index 184f6a7f2c..4c155732ab 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp @@ -1255,7 +1255,7 @@ DockEvaluateMeshImp* DockEvaluateMeshImp::instance() void DockEvaluateMeshImp::destruct () { - if (_instance != nullptr) { + if (_instance) { DockEvaluateMeshImp *pTmp = _instance; _instance = nullptr; delete pTmp; diff --git a/src/Mod/Mesh/Gui/MeshSelection.cpp b/src/Mod/Mesh/Gui/MeshSelection.cpp index a6225086ee..3110521901 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.cpp +++ b/src/Mod/Mesh/Gui/MeshSelection.cpp @@ -540,7 +540,7 @@ void MeshSelection::pickFaceCallback(void * ud, SoEventCallback * n) n->getAction()->setHandled(); if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) { + if (!point) { Base::Console().Message("No facet picked.\n"); return; } diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index 503a7aa736..29807d479e 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -1265,7 +1265,7 @@ std::vector ViewProviderMesh::getFacetsOfRegion(const SbViewpo void ViewProviderMesh::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane, const SbVec2f & currpos, const SbVec2f & prevpos) { - if (cam == nullptr) // can happen for empty scenegraph + if (!cam) // can happen for empty scenegraph return; if (currpos == prevpos) // useless invocation return; @@ -1589,7 +1589,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) { + if (!point) { Base::Console().Message("No facet picked.\n"); return; } @@ -1663,7 +1663,7 @@ void ViewProviderMesh::fillHoleCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) { + if (!point) { Base::Console().Message("No facet picked.\n"); return; } @@ -1730,7 +1730,7 @@ void ViewProviderMesh::markPartCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) { + if (!point) { Base::Console().Message("No facet picked.\n"); return; } diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index 294a71a010..64cb4d5ea7 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -526,7 +526,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) { + if (!point) { Base::Console().Message("No facet picked.\n"); return; } @@ -564,7 +564,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback } else if (ev->getTypeId().isDerivedFrom(SoLocation2Event::getClassTypeId())) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) + if (!point) return; n->setHandled();