diff --git a/GraspPlanning/ApproachMovementGenerator.cpp b/GraspPlanning/ApproachMovementGenerator.cpp index 70aac39506651d2e1a527c8893d89e013e1a4d47..bb919b1e04a66e7b6a4f63ff4af4180c4020a25d 100644 --- a/GraspPlanning/ApproachMovementGenerator.cpp +++ b/GraspPlanning/ApproachMovementGenerator.cpp @@ -42,8 +42,7 @@ namespace GraspStudio } ApproachMovementGenerator::~ApproachMovementGenerator() - { - } + = default; VirtualRobot::RobotPtr ApproachMovementGenerator::getEEFRobotClone() diff --git a/GraspPlanning/ApproachMovementSurfaceNormal.cpp b/GraspPlanning/ApproachMovementSurfaceNormal.cpp index 723deee3a0c7e4968ad5ef1e450eff877707508f..6e94dc6e66da54056e29bea37446a819710fbdd8 100644 --- a/GraspPlanning/ApproachMovementSurfaceNormal.cpp +++ b/GraspPlanning/ApproachMovementSurfaceNormal.cpp @@ -29,8 +29,7 @@ namespace GraspStudio } ApproachMovementSurfaceNormal::~ApproachMovementSurfaceNormal() - { - } + = default; bool ApproachMovementSurfaceNormal::getPositionOnObject(Eigen::Vector3f& storePos, Eigen::Vector3f& storeApproachDir) { diff --git a/GraspPlanning/ConvexHullGenerator.cpp b/GraspPlanning/ConvexHullGenerator.cpp index 3f030a45dc53788d971ebaf85139bf015c376a20..a6bfd1dbe5737e34a87fdf10004706639c5bcaf4 100644 --- a/GraspPlanning/ConvexHullGenerator.cpp +++ b/GraspPlanning/ConvexHullGenerator.cpp @@ -127,7 +127,7 @@ namespace GraspStudio FILE* outfile = stdout; /* output from qh_produce_output()*/ /* use NULL to skip qh_produce_output() */ # else - FILE* outfile = NULL; /* output from qh_produce_output()*/ + FILE* outfile = nullptr; /* output from qh_produce_output()*/ /* use NULL to skip qh_produce_output() */ #endif FILE* errfile = stderr; /* error messages from qhull code */ @@ -159,11 +159,11 @@ namespace GraspStudio { facetT* facet_list = qh facet_list; //int convexNumFaces = qh num_facets; - /*int convexNumVert =*/ qh_setsize(qh_facetvertices(facet_list, NULL, false)); + /*int convexNumVert =*/ qh_setsize(qh_facetvertices(facet_list, nullptr, false)); qh_triangulate(); // need this for triangulated output! //int convexNumFaces2 = qh num_facets; - /*int convexNumVert2 =*/ qh_setsize(qh_facetvertices(facet_list, NULL, false)); + /*int convexNumVert2 =*/ qh_setsize(qh_facetvertices(facet_list, nullptr, false)); /* cout << "Numfacets1:" << convexNumFaces << endl; cout << "Numvertices1:" << convexNumVert << endl; @@ -319,7 +319,7 @@ namespace GraspStudio FILE* outfile = stdout; /* output from qh_produce_output()*/ /* use NULL to skip qh_produce_output() */ # else - FILE* outfile = NULL; /* output from qh_produce_output()*/ + FILE* outfile = nullptr; /* output from qh_produce_output()*/ /* use NULL to skip qh_produce_output() */ #endif FILE* errfile = stderr; /* error messages from qhull code */ @@ -353,11 +353,11 @@ namespace GraspStudio { facetT* facet_list = qh facet_list; //int convexNumFaces = qh num_facets; - /*int convexNumVert =*/ qh_setsize(qh_facetvertices(facet_list, NULL, false)); + /*int convexNumVert =*/ qh_setsize(qh_facetvertices(facet_list, nullptr, false)); qh_triangulate(); // need this for triangulated output! //int convexNumFaces2 = qh num_facets; - /*int convexNumVert2 =*/ qh_setsize(qh_facetvertices(facet_list, NULL, false)); + /*int convexNumVert2 =*/ qh_setsize(qh_facetvertices(facet_list, nullptr, false)); double pCenter[6]; for (double & u : pCenter) diff --git a/GraspPlanning/GraspPlanner/GenericGraspPlanner.cpp b/GraspPlanning/GraspPlanner/GenericGraspPlanner.cpp index 8983008b0833b36f4d0c306786176fce65254767..b4753b4316ae92478e9dbed587db0e6ec87fe7ab 100644 --- a/GraspPlanning/GraspPlanner/GenericGraspPlanner.cpp +++ b/GraspPlanning/GraspPlanner/GenericGraspPlanner.cpp @@ -34,8 +34,7 @@ namespace GraspStudio } GenericGraspPlanner::~GenericGraspPlanner() - { - } + = default; int GenericGraspPlanner::plan(int nrGrasps, int timeOutMS, VirtualRobot::SceneObjectSetPtr obstacles) { diff --git a/GraspPlanning/GraspPlanner/GraspPlanner.cpp b/GraspPlanning/GraspPlanner/GraspPlanner.cpp index aa7369158c43e4f30f1a2df5f020d3a4365cd332..86a12e21a326a984290afdf9ca629c9e9721d57d 100644 --- a/GraspPlanning/GraspPlanner/GraspPlanner.cpp +++ b/GraspPlanning/GraspPlanner/GraspPlanner.cpp @@ -9,9 +9,7 @@ namespace GraspStudio } GraspPlanner::~GraspPlanner() - { - - } + = default; void GraspPlanner::setVerbose(bool enable) { diff --git a/GraspPlanning/GraspQuality/GraspEvaluationPoseUncertainty.cpp b/GraspPlanning/GraspQuality/GraspEvaluationPoseUncertainty.cpp index c2091b751f7e2ccbc61b8b1c9ec3388d6fde65da..b4b9720c60f795e3c1be45bc9c97c4b4db785446 100644 --- a/GraspPlanning/GraspQuality/GraspEvaluationPoseUncertainty.cpp +++ b/GraspPlanning/GraspQuality/GraspEvaluationPoseUncertainty.cpp @@ -18,9 +18,7 @@ GraspEvaluationPoseUncertainty::GraspEvaluationPoseUncertainty(const PoseUncerta } GraspEvaluationPoseUncertainty::~GraspEvaluationPoseUncertainty() -{ - -} += default; std::vector<Eigen::Matrix4f> GraspEvaluationPoseUncertainty::generatePoses(const Eigen::Matrix4f &objectGP, const Eigen::Matrix4f &graspCenterGP) { diff --git a/GraspPlanning/GraspQuality/GraspQualityMeasure.cpp b/GraspPlanning/GraspQuality/GraspQualityMeasure.cpp index 62d3339bcdfe0e6eb64919c4372d9bc9085f8ef6..6abbfeea8179b0f8dba15b860e73097838c73ba7 100644 --- a/GraspPlanning/GraspQuality/GraspQualityMeasure.cpp +++ b/GraspPlanning/GraspQuality/GraspQualityMeasure.cpp @@ -30,8 +30,7 @@ namespace GraspStudio } GraspQualityMeasure::~GraspQualityMeasure() - { - } + = default; bool GraspQualityMeasure::sampleObjectPoints(int nMaxFaces) { diff --git a/GraspPlanning/GraspQuality/GraspQualityMeasureWrenchSpace.cpp b/GraspPlanning/GraspQuality/GraspQualityMeasureWrenchSpace.cpp index d02c0e2b2b14ef093061e19bef3ec21876adc0f9..86f4408faab7dfcb5d57edd81949097ffbacc808 100644 --- a/GraspPlanning/GraspQuality/GraspQualityMeasureWrenchSpace.cpp +++ b/GraspPlanning/GraspQuality/GraspQualityMeasureWrenchSpace.cpp @@ -39,8 +39,7 @@ namespace GraspStudio } GraspQualityMeasureWrenchSpace::~GraspQualityMeasureWrenchSpace() - { - } + = default; void GraspQualityMeasureWrenchSpace::setContactPoints(const std::vector<VirtualRobot::MathTools::ContactPoint>& contactPoints) diff --git a/GraspPlanning/Visualization/ConvexHullVisualization.cpp b/GraspPlanning/Visualization/ConvexHullVisualization.cpp index 13a0a174c7b120504db255b8fa291c7536c9917d..9247ea7b836b737669f0afba6f6c64ff99315067 100644 --- a/GraspPlanning/Visualization/ConvexHullVisualization.cpp +++ b/GraspPlanning/Visualization/ConvexHullVisualization.cpp @@ -20,7 +20,6 @@ namespace GraspStudio ConvexHullVisualization::~ConvexHullVisualization() - { - } + = default; } // namespace GraspStudio diff --git a/GraspPlanning/examples/GraspPlanner/GraspPlannerWindow.cpp b/GraspPlanning/examples/GraspPlanner/GraspPlannerWindow.cpp index 86df6afe78f3ac8ca701a4f968e0dfcdc7ee93b7..29eff9aea79113e2d4a7f45c532681144a6122ee 100644 --- a/GraspPlanning/examples/GraspPlanner/GraspPlannerWindow.cpp +++ b/GraspPlanning/examples/GraspPlanner/GraspPlannerWindow.cpp @@ -43,7 +43,7 @@ using namespace GraspStudio; float TIMER_MS = 30.0f; GraspPlannerWindow::GraspPlannerWindow(std::string& robFile, std::string& eefName, std::string& preshape, std::string& objFile) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -52,7 +52,7 @@ GraspPlannerWindow::GraspPlannerWindow(std::string& robFile, std::string& eefNam this->objectFile = objFile; this->eefName = eefName; this->preshape = preshape; - eefVisu = NULL; + eefVisu = nullptr; sceneSep = new SoSeparator; sceneSep->ref(); diff --git a/GraspPlanning/examples/GraspQuality/GraspQualityWindow.cpp b/GraspPlanning/examples/GraspQuality/GraspQualityWindow.cpp index a1e4cbffb0e45d99cc631d3a2562c2250eef83e4..3afdf57930ea0633e041959e4159511719cb8972 100644 --- a/GraspPlanning/examples/GraspQuality/GraspQualityWindow.cpp +++ b/GraspPlanning/examples/GraspQuality/GraspQualityWindow.cpp @@ -38,7 +38,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; GraspQualityWindow::GraspQualityWindow(std::string& robFile, std::string& objFile) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; diff --git a/MotionPlanning/ApproachDiscretization.cpp b/MotionPlanning/ApproachDiscretization.cpp index 0ae21624e694dcb43814739ba13821d9b900d37c..e3d399c4249ca6642211cc67c9989f178cd08a22 100644 --- a/MotionPlanning/ApproachDiscretization.cpp +++ b/MotionPlanning/ApproachDiscretization.cpp @@ -24,8 +24,7 @@ namespace Saba } ApproachDiscretization::~ApproachDiscretization() - { - } + = default; /* void ApproachDiscretization::buildIVModel() diff --git a/MotionPlanning/CSpace/CSpaceNode.cpp b/MotionPlanning/CSpace/CSpaceNode.cpp index 6d35b3a092716ee060dd12b78551917b3040d99a..faab447bd30a6355f5dfaec71e7f2339793f5729 100644 --- a/MotionPlanning/CSpace/CSpaceNode.cpp +++ b/MotionPlanning/CSpace/CSpaceNode.cpp @@ -5,11 +5,9 @@ namespace Saba { CSpaceNode::CSpaceNode() - { - } + = default; CSpaceNode::~CSpaceNode() - { - } + = default; } diff --git a/MotionPlanning/CSpace/CSpacePath.cpp b/MotionPlanning/CSpace/CSpacePath.cpp index 22edc4a40020b8d802c073809ab80db94371d96c..411d94721f076291c0b08a44f9c6047f62181e2b 100644 --- a/MotionPlanning/CSpace/CSpacePath.cpp +++ b/MotionPlanning/CSpace/CSpacePath.cpp @@ -318,7 +318,7 @@ namespace Saba { storePathPos = getPoint(0); - if (storeIndex != NULL) + if (storeIndex != nullptr) { *storeIndex = 0; } @@ -329,7 +329,7 @@ namespace Saba { storePathPos = getPoint(getNrOfPoints() - 1); - if (storeIndex != NULL) + if (storeIndex != nullptr) { *storeIndex = (int)path.size(); } @@ -400,7 +400,7 @@ namespace Saba } } - if (storeIndex != NULL) + if (storeIndex != nullptr) { *storeIndex = startIndex; } diff --git a/MotionPlanning/CSpace/CSpaceSampled.cpp b/MotionPlanning/CSpace/CSpaceSampled.cpp index e56814197bde59a5dc4a8e2b8054e5ec13087e11..3ec07330c7411f8cd971f8cd5f60c8e3277e0df0 100644 --- a/MotionPlanning/CSpace/CSpaceSampled.cpp +++ b/MotionPlanning/CSpace/CSpaceSampled.cpp @@ -38,8 +38,7 @@ namespace Saba CSpaceSampled::~CSpaceSampled() - { - } + = default; CSpacePtr CSpaceSampled::clone(VirtualRobot::CollisionCheckerPtr newColChecker, VirtualRobot::RobotPtr newRobot, VirtualRobot::CDManagerPtr newCDM, unsigned int newRandomSeed) { diff --git a/MotionPlanning/CSpace/CSpaceTree.cpp b/MotionPlanning/CSpace/CSpaceTree.cpp index c2ac803f463daf774a96a498dffb304b0fb5dfeb..44b6fb543d15b3830eb7a4a5a269f828c022edd4 100644 --- a/MotionPlanning/CSpace/CSpaceTree.cpp +++ b/MotionPlanning/CSpace/CSpaceTree.cpp @@ -41,9 +41,7 @@ namespace Saba } CSpaceTree::~CSpaceTree() - { - - } + = default; void CSpaceTree::lock() { @@ -323,7 +321,7 @@ namespace Saba } } - if (storeDist != NULL) + if (storeDist != nullptr) { *storeDist = sqrtf(dist2); } diff --git a/MotionPlanning/CSpace/ConfigurationConstraint.cpp b/MotionPlanning/CSpace/ConfigurationConstraint.cpp index 766e5d176e0d15c55030b6e1dd2394de2ea9a35f..fd34b5182619ae036ecaf995cc5262e7c965b927 100644 --- a/MotionPlanning/CSpace/ConfigurationConstraint.cpp +++ b/MotionPlanning/CSpace/ConfigurationConstraint.cpp @@ -10,7 +10,6 @@ namespace Saba } ConfigurationConstraint::~ConfigurationConstraint() - { - } + = default; } diff --git a/MotionPlanning/CSpace/Sampler.cpp b/MotionPlanning/CSpace/Sampler.cpp index e38260743aa988c8734b718e756688d876aa61a6..2ce3810908670678767258ce2360c81c7c19f3f5 100644 --- a/MotionPlanning/CSpace/Sampler.cpp +++ b/MotionPlanning/CSpace/Sampler.cpp @@ -11,8 +11,7 @@ namespace Saba } Sampler::~Sampler() - { - } + = default; void Sampler::getUniformlyRandomConfig(Eigen::VectorXf& stroreConfig, CSpacePtr space) { diff --git a/MotionPlanning/Planner/BiRrt.cpp b/MotionPlanning/Planner/BiRrt.cpp index d0ff13d7ee3a1f36ca1a0e31f8c634f1e7e0c1de..aa666c2f2ff0e337bab353388caca7e9a892ee20 100644 --- a/MotionPlanning/Planner/BiRrt.cpp +++ b/MotionPlanning/Planner/BiRrt.cpp @@ -26,8 +26,7 @@ namespace Saba } BiRrt::~BiRrt() - { - } + = default; bool BiRrt::plan(bool bQuiet) diff --git a/MotionPlanning/Planner/GraspIkRrt.cpp b/MotionPlanning/Planner/GraspIkRrt.cpp index db8f39885097a6d4b73dd6032ad528690c4a794b..2c6b1fdb8b95bcda456accd67cad69ec87d5ae22 100644 --- a/MotionPlanning/Planner/GraspIkRrt.cpp +++ b/MotionPlanning/Planner/GraspIkRrt.cpp @@ -49,8 +49,7 @@ namespace Saba } GraspIkRrt::~GraspIkRrt() - { - } + = default; bool GraspIkRrt::searchNewGoal() { diff --git a/MotionPlanning/Planner/GraspRrt.cpp b/MotionPlanning/Planner/GraspRrt.cpp index 9a284ff05c7142330aeabd8c84b1b7cc53620bb3..48b6a1d5e9c6200baafe98219d96c6bfb4d6794c 100644 --- a/MotionPlanning/Planner/GraspRrt.cpp +++ b/MotionPlanning/Planner/GraspRrt.cpp @@ -80,9 +80,7 @@ namespace Saba } GraspRrt::~GraspRrt() - { - - } + = default; void GraspRrt::reset() diff --git a/MotionPlanning/Planner/Rrt.cpp b/MotionPlanning/Planner/Rrt.cpp index 851c2c04bf877d391d17d69830ac0248e15b245b..1c5ab1e6b58d4b6b5656b94e11f840b8ad27f935 100644 --- a/MotionPlanning/Planner/Rrt.cpp +++ b/MotionPlanning/Planner/Rrt.cpp @@ -44,8 +44,7 @@ namespace Saba } Rrt::~Rrt() - { - } + = default; bool Rrt::plan(bool bQuiet) diff --git a/MotionPlanning/PostProcessing/ElasticBandProcessor.cpp b/MotionPlanning/PostProcessing/ElasticBandProcessor.cpp index c9223888d8b485a5fa5a1079e05684f6fffa79bb..1596a847bed86c52532bdaf1d0f0d270189047ab 100644 --- a/MotionPlanning/PostProcessing/ElasticBandProcessor.cpp +++ b/MotionPlanning/PostProcessing/ElasticBandProcessor.cpp @@ -45,8 +45,7 @@ using namespace VirtualRobot; } ElasticBandProcessor::~ElasticBandProcessor() - { - } + = default; bool ElasticBandProcessor::initSolution() { diff --git a/MotionPlanning/PostProcessing/PathProcessor.cpp b/MotionPlanning/PostProcessing/PathProcessor.cpp index 7df93c8192112331a577a0655e671da7ba0d89b0..56d911c55a4159ee76ac5fb738e3be1d8a123bbf 100644 --- a/MotionPlanning/PostProcessing/PathProcessor.cpp +++ b/MotionPlanning/PostProcessing/PathProcessor.cpp @@ -13,8 +13,7 @@ namespace Saba } PathProcessor::~PathProcessor() - { - } + = default; CSpacePathPtr PathProcessor::getOptimizedPath() { diff --git a/MotionPlanning/PostProcessing/ShortcutProcessor.cpp b/MotionPlanning/PostProcessing/ShortcutProcessor.cpp index 479e79224f6a63d11c1522cef9faf295149de63f..665932febc97a236493a914d5f1f6e40af910f22 100644 --- a/MotionPlanning/PostProcessing/ShortcutProcessor.cpp +++ b/MotionPlanning/PostProcessing/ShortcutProcessor.cpp @@ -15,8 +15,7 @@ namespace Saba } ShortcutProcessor::~ShortcutProcessor() - { - } + = default; diff --git a/MotionPlanning/Visualization/CoinVisualization/CoinRrtWorkspaceVisualization.cpp b/MotionPlanning/Visualization/CoinVisualization/CoinRrtWorkspaceVisualization.cpp index 13474d576b32d52752be58f391ebd37d6694dac3..a84d55c430db5a74c4534df3b0cf31d045d9fe01 100644 --- a/MotionPlanning/Visualization/CoinVisualization/CoinRrtWorkspaceVisualization.cpp +++ b/MotionPlanning/Visualization/CoinVisualization/CoinRrtWorkspaceVisualization.cpp @@ -30,14 +30,14 @@ namespace Saba CoinRrtWorkspaceVisualization::CoinRrtWorkspaceVisualization(VirtualRobot::RobotPtr robot, CSpacePtr cspace, const std::string& TCPName) : RrtWorkspaceVisualization(robot, cspace, TCPName) { - visualization = NULL; + visualization = nullptr; coinInit(); } CoinRrtWorkspaceVisualization::CoinRrtWorkspaceVisualization(VirtualRobot::RobotPtr robot, VirtualRobot::RobotNodeSetPtr robotNodeSet, const std::string& TCPName) : RrtWorkspaceVisualization(robot, robotNodeSet, TCPName) { - visualization = NULL; + visualization = nullptr; coinInit(); } diff --git a/MotionPlanning/Visualization/RrtWorkspaceVisualization.cpp b/MotionPlanning/Visualization/RrtWorkspaceVisualization.cpp index a91354f7141f3a534f5deafa3066b9f43a344d4b..82cbb5eb56e7867e0a733bc3aaa7c71c550c15e4 100644 --- a/MotionPlanning/Visualization/RrtWorkspaceVisualization.cpp +++ b/MotionPlanning/Visualization/RrtWorkspaceVisualization.cpp @@ -31,8 +31,7 @@ namespace Saba } RrtWorkspaceVisualization::~RrtWorkspaceVisualization() - { - } + = default; void RrtWorkspaceVisualization::init() { diff --git a/MotionPlanning/examples/GraspRRT/GraspRrtWindow.cpp b/MotionPlanning/examples/GraspRRT/GraspRrtWindow.cpp index 8b4fba8faf5a6190ae01608c9f43c3c7b187f331..06a05c5b1809f3e365b325660a268218f0fadc52 100644 --- a/MotionPlanning/examples/GraspRRT/GraspRrtWindow.cpp +++ b/MotionPlanning/examples/GraspRRT/GraspRrtWindow.cpp @@ -40,7 +40,7 @@ GraspRrtWindow::GraspRrtWindow(const std::string& sceneFile, const std::string& const std::string& rns, const std::string& rnsB, const std::string& eefName, const std::string& eefNameB, const std::string& colModelRob1, const std::string& colModelRob1B, const std::string& colModelRob2, const std::string& colModelRob2B, const std::string& colModelEnv) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -196,7 +196,7 @@ void GraspRrtWindow::buildVisu() if (scene) { visualization = scene->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/MotionPlanning/examples/IKRRT/IKRRTWindow.cpp b/MotionPlanning/examples/IKRRT/IKRRTWindow.cpp index 685ea80b27007881e52ea5dcf357d351f10757b4..9758d8f3d83db5ea6889d450f5371744c33c2fbe 100644 --- a/MotionPlanning/examples/IKRRT/IKRRTWindow.cpp +++ b/MotionPlanning/examples/IKRRT/IKRRTWindow.cpp @@ -38,7 +38,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; IKRRTWindow::IKRRTWindow(std::string& sceneFile, std::string& reachFile, std::string& rns, std::string& eef, std::string& colModel, std::string& colModelRob) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; diff --git a/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningScenery.cpp b/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningScenery.cpp index 4182a92ff4559f84542e00d1267637cb0a5bf0eb..4a59357fec4cc464a8f05ad6f39c44b2023b4f97 100644 --- a/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningScenery.cpp +++ b/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningScenery.cpp @@ -55,14 +55,14 @@ MTPlanningScenery::MTPlanningScenery() kinChainName = "All"; TCPName = "Visu"; - obstSep = NULL; + obstSep = nullptr; robotFilename = "robots/examples/MultiThreadedPlanning/CartMover.xml"; VirtualRobot::RuntimeEnvironment::getDataFileAbsolute(robotFilename); plannersStarted = false; optimizeStarted = false; - startEndVisu = NULL; + startEndVisu = nullptr; buildScene(); } @@ -127,7 +127,7 @@ void MTPlanningScenery::reset() for (auto & visualisation : visualisations) { - if (visualisation != NULL) + if (visualisation != nullptr) { sceneSep->removeChild(visualisation); } @@ -135,12 +135,12 @@ void MTPlanningScenery::reset() visualisations.clear(); - if (startEndVisu != NULL) + if (startEndVisu != nullptr) { sceneSep->removeChild(startEndVisu); } - startEndVisu = NULL; + startEndVisu = nullptr; ///////////////////////////////////////////////////////////////////////////// @@ -185,7 +185,7 @@ void MTPlanningScenery::buildScene() if (obstSep) { sceneSep->removeChild(obstSep); - obstSep = NULL; + obstSep = nullptr; } float fCubeSize = 50.0f; @@ -213,7 +213,7 @@ void MTPlanningScenery::buildScene() o->setGlobalPose(m); environment->addSceneObject(o); boost::shared_ptr<CoinVisualization> visualization = o->getVisualization<CoinVisualization>(); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { @@ -361,9 +361,9 @@ void MTPlanningScenery::buildPlanningThread(bool bMultiCollisionCheckers, int id solutions.push_back(CSpacePathPtr()); optiSolutions.push_back(CSpacePathPtr()); optimizeThreads.push_back(PathProcessingThreadPtr()); - visualisations.push_back(NULL); + visualisations.push_back(nullptr); - if (startEndVisu == NULL) + if (startEndVisu == nullptr) { startEndVisu = new SoSeparator(); sceneSep->addChild(startEndVisu); diff --git a/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningWindow.cpp b/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningWindow.cpp index c4c3eda10d767b4c3d862dbdecfa28b601fd58ec..d2c6dfdd999549b9633c2791c04ec30a05f6ae87 100644 --- a/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningWindow.cpp +++ b/MotionPlanning/examples/MultiThreadedPlanning/MTPlanningWindow.cpp @@ -31,14 +31,14 @@ bool runtimeDisplayed = false; bool optiTimeDisplayed = false; MTPlanningWindow::MTPlanningWindow() - : QMainWindow(NULL) + : QMainWindow(nullptr) { //resize(1100, 768); - graspObjectSep = NULL; - robotSep = NULL; + graspObjectSep = nullptr; + robotSep = nullptr; - scene = NULL; + scene = nullptr; scene = new MTPlanningScenery(); sceneSep = scene->getScene(); @@ -58,7 +58,7 @@ MTPlanningWindow::MTPlanningWindow() MTPlanningWindow::~MTPlanningWindow() { - if (scene != NULL) + if (scene != nullptr) { delete scene; } diff --git a/MotionPlanning/examples/PlatformDemo/PlatformWindow.cpp b/MotionPlanning/examples/PlatformDemo/PlatformWindow.cpp index 9e47e8b328733bc6894959bb446df07f2d9d20dd..0b30535b93820de944e8ceb0b00b963cba831389 100644 --- a/MotionPlanning/examples/PlatformDemo/PlatformWindow.cpp +++ b/MotionPlanning/examples/PlatformDemo/PlatformWindow.cpp @@ -42,7 +42,7 @@ PlatformWindow::PlatformWindow(const std::string& sceneFile, const std::string& rns, const std::string& colModelRob, const std::string& colModelEnv) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -146,7 +146,7 @@ void PlatformWindow::buildVisu() if (scene) { visualization = scene->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/MotionPlanning/examples/RRT/RRTdemo.cpp b/MotionPlanning/examples/RRT/RRTdemo.cpp index bbf178cef018a266a11f7f9c9f11a3d1731be562..f5b97682e927b218bfeb653bf25f385e0290ad53 100644 --- a/MotionPlanning/examples/RRT/RRTdemo.cpp +++ b/MotionPlanning/examples/RRT/RRTdemo.cpp @@ -30,7 +30,7 @@ QWidget* win; void show(SoNode* n) { - if (win == NULL) + if (win == nullptr) { printf("Could not create window.\n"); exit(-3); @@ -175,7 +175,7 @@ void startRRTVisualization() SceneObject::VisualizationType colModel = SceneObject::Full; boost::shared_ptr<CoinVisualization> visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/MotionPlanning/examples/RrtGui/RrtGuiWindow.cpp b/MotionPlanning/examples/RrtGui/RrtGuiWindow.cpp index 52c5777da1354952081827252b49aee2ab929311..1d6713fba61ed8a846ccdaf27bd16b5bb8009b2e 100644 --- a/MotionPlanning/examples/RrtGui/RrtGuiWindow.cpp +++ b/MotionPlanning/examples/RrtGui/RrtGuiWindow.cpp @@ -37,7 +37,7 @@ float TIMER_MS = 200.0f; RrtGuiWindow::RrtGuiWindow(const std::string& sceneFile, const std::string& sConf, const std::string& gConf, const std::string& rns, const std::string& colModelRob1, const std::string& colModelRob2, const std::string& colModelEnv) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -188,7 +188,7 @@ void RrtGuiWindow::buildVisu() if (scene) { visualization = scene->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletCoinQtViewer.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletCoinQtViewer.cpp index 05748484c82d6d1e335c46398f524d857a976b7b..5346d5ffc2d6546b6d489e88b5393c6cfa5cdf7d 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletCoinQtViewer.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletCoinQtViewer.cpp @@ -48,7 +48,7 @@ namespace SimDynamics //SoSelection *selection = new SoSelection(); //sceneGraph->addChild( selection ); - viewer = NULL; + viewer = nullptr; // register callback SoSensorManager* sensor_mgr = SoDB::getSensorManager(); @@ -65,7 +65,7 @@ namespace SimDynamics { stopCB(); sceneGraphRoot->unref(); - sceneGraphRoot = NULL; + sceneGraphRoot = nullptr; } void BulletCoinQtViewer::selectionCB(void* userdata, SoPath* path) @@ -414,7 +414,7 @@ namespace SimDynamics SoSensorManager* sensor_mgr = SoDB::getSensorManager(); sensor_mgr->removeTimerSensor(timerSensor); delete timerSensor; - timerSensor = NULL; + timerSensor = nullptr; } if (sceneGraph) diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp index cb39d31b3cd763e414fdc1e0c504027852acc2e0..7fa7948710311425a751154660c942539d60d0dd 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp @@ -33,11 +33,11 @@ namespace SimDynamics BulletEngine::BulletEngine(boost::shared_ptr <boost::recursive_mutex> engineMutex) : DynamicsEngine(engineMutex) { - collision_config = NULL; - dispatcher = NULL; - overlappingPairCache = NULL; - constraintSolver = NULL; - dynamicsWorld = NULL; + collision_config = nullptr; + dispatcher = nullptr; + overlappingPairCache = nullptr; + constraintSolver = nullptr; + dynamicsWorld = nullptr; simTime = 0; } @@ -141,17 +141,17 @@ namespace SimDynamics } delete dynamicsWorld; - dynamicsWorld = NULL; + dynamicsWorld = nullptr; delete collision_config; - collision_config = NULL; + collision_config = nullptr; delete dispatcher; - dispatcher = NULL; + dispatcher = nullptr; delete overlappingPairCache; - overlappingPairCache = NULL; + overlappingPairCache = nullptr; delete constraintSolver; - constraintSolver = NULL; + constraintSolver = nullptr; delete collisionFilterCallback; - collisionFilterCallback = NULL; + collisionFilterCallback = nullptr; return true; } @@ -256,7 +256,7 @@ namespace SimDynamics } dynamicsWorld->removeRigidBody(btObject->getRigidBody().get()); - btObject->getRigidBody()->setBroadphaseHandle(NULL); + btObject->getRigidBody()->setBroadphaseHandle(nullptr); return DynamicsEngine::removeObject(o); } diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletEngineFactory.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletEngineFactory.cpp index 0946703a7a3f3179ad74519390189b2d994efc7e..2984161d0fb577131c8cd5dd987776825ac5c319 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletEngineFactory.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletEngineFactory.cpp @@ -7,13 +7,11 @@ namespace SimDynamics { BulletEngineFactory::BulletEngineFactory() - { - } + = default; BulletEngineFactory::~BulletEngineFactory() - { - } + = default; /** diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp index c0e7e55e362a9ddf905e423e2deeb8d34d861bbe..cc9f63da38f6fb92316df07fed97d7b399eeacfd 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp @@ -58,9 +58,9 @@ extern int gTotalBytesAlignedAllocs; DemoApplication::DemoApplication() //see btIDebugDraw.h for modes : - m_dynamicsWorld(0), - m_pickConstraint(0), - m_shootBoxShape(0), + m_dynamicsWorld(nullptr), + m_pickConstraint(nullptr), + m_shootBoxShape(nullptr), m_cameraDistance(15.0), m_debugMode(0), m_ele(20.f), @@ -772,7 +772,7 @@ int gPickingConstraintId = 0; btVector3 gOldPickingPos; btVector3 gHitPos(-1, -1, -1); btScalar gOldPickingDist = 0.f; -btRigidBody* pickedBody = 0;//for deactivation state +btRigidBody* pickedBody = nullptr;//for deactivation state btVector3 DemoApplication::getRayTo(int x, int y) @@ -1070,10 +1070,10 @@ void DemoApplication::removePickingConstraint() m_dynamicsWorld->removeConstraint(m_pickConstraint); delete m_pickConstraint; //printf("removed constraint %i",gPickingConstraintId); - m_pickConstraint = 0; + m_pickConstraint = nullptr; pickedBody->forceActivationState(ACTIVE_TAG); pickedBody->setDeactivationTime(0.f); - pickedBody = 0; + pickedBody = nullptr; } } diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GLDebugDrawer.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GLDebugDrawer.cpp index ba0e9ced76dcc1a5cea7fad82776a78425b8c37d..2a3375169dbe3277c07077d25ac185ec56bcca23 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GLDebugDrawer.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GLDebugDrawer.cpp @@ -13,8 +13,7 @@ GLDebugDrawer::GLDebugDrawer() } GLDebugDrawer::~GLDebugDrawer() -{ -} += default; void GLDebugDrawer::drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor) { diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogDynamicsWorld.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogDynamicsWorld.cpp index 365653bb5f81a980b276a6a56bd9fb4a0f9141ef..ccd7cfbd16991b2cbf2ddb826b5ddee6487c87a6 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogDynamicsWorld.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogDynamicsWorld.cpp @@ -25,10 +25,10 @@ subject to the following restrictions: GL_DialogDynamicsWorld::GL_DialogDynamicsWorld() { - m_upperBorder = 0; - m_lowerBorder = 0; + m_upperBorder = nullptr; + m_lowerBorder = nullptr; - m_pickConstraint = 0; + m_pickConstraint = nullptr; m_screenWidth = 0; m_screenHeight = 0; @@ -196,7 +196,7 @@ GL_DialogWindow* GL_DialogDynamicsWorld::createDialog(int horPos, int vertPos btScalar mass = 100.f; btVector3 localInertia; boxShape->calculateLocalInertia(mass, localInertia); - btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, 0, boxShape, localInertia); + btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, nullptr, boxShape, localInertia); btRigidBody* body = new btRigidBody(rbInfo); btTransform trans; trans.setIdentity(); @@ -227,7 +227,7 @@ GL_SliderControl* GL_DialogDynamicsWorld::createSlider(GL_DialogWindow* dialog, btScalar mass = .1f; btVector3 localInertia; boxShape->calculateLocalInertia(mass, localInertia); - btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, 0, boxShape, localInertia); + btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, nullptr, boxShape, localInertia); btRigidBody* body = new btRigidBody(rbInfo); btTransform trans; trans.setIdentity(); @@ -306,7 +306,7 @@ GL_ToggleControl* GL_DialogDynamicsWorld::createToggle(GL_DialogWindow* dialog, btScalar mass = 0.1f; btVector3 localInertia; boxShape->calculateLocalInertia(mass, localInertia); - btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, 0, boxShape, localInertia); + btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, nullptr, boxShape, localInertia); btRigidBody* body = new btRigidBody(rbInfo); btTransform trans; trans.setIdentity(); @@ -366,7 +366,7 @@ void GL_DialogDynamicsWorld::draw(btScalar timeStep) } } -static btRigidBody* pickedBody = 0;//for deactivation state +static btRigidBody* pickedBody = nullptr;//for deactivation state static btScalar mousePickClamping = 111130.f; //static int gPickingConstraintId = 0; @@ -455,7 +455,7 @@ bool GL_DialogDynamicsWorld::mouseFunc(int button, int state, int x, int y) btVector3 rayFrom; - if (1)//m_ortho) + if (true)//m_ortho) { rayFrom = rayTo; rayFrom.setZ(-100.f); @@ -565,7 +565,7 @@ bool GL_DialogDynamicsWorld::mouseFunc(int button, int state, int x, int y) m_dynamicsWorld->removeConstraint(m_pickConstraint); delete m_pickConstraint; //printf("removed constraint %i",gPickingConstraintId); - m_pickConstraint = 0; + m_pickConstraint = nullptr; pickedBody->forceActivationState(ACTIVE_TAG); pickedBody->setDeactivationTime(0.f); @@ -579,7 +579,7 @@ bool GL_DialogDynamicsWorld::mouseFunc(int button, int state, int x, int y) { GL_SliderControl* sliderControl = (GL_SliderControl*) ctrl; - btSliderConstraint* slider = 0; + btSliderConstraint* slider = nullptr; btTypedConstraint* constraint = sliderControl->getConstraint(); if (constraint->getConstraintType() == SLIDER_CONSTRAINT_TYPE) @@ -614,7 +614,7 @@ bool GL_DialogDynamicsWorld::mouseFunc(int button, int state, int x, int y) } - pickedBody = 0; + pickedBody = nullptr; } @@ -643,7 +643,7 @@ btVector3 GL_DialogDynamicsWorld::getRayTo(int x, int y) btVector3 cameraTargetPosition(0, 0, 0); btVector3 cameraUp(0, -1, 0); - if (1)//_ortho) + if (true)//_ortho) { btScalar aspect; @@ -754,7 +754,7 @@ void GL_DialogDynamicsWorld::mouseMotionFunc(int x, int y) btVector3 oldPivotInB = p2p->getPivotInB(); btVector3 newPivotB; - if (1)//_ortho) + if (true)//_ortho) { newPivotB = oldPivotInB; newPivotB.setX(newRayTo.getX()); diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogWindow.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogWindow.cpp index 68df1a62bc5e01a179b27d399d7a82c172a792a4..1c5d188f7b4f3308b71ec0bef3af736d84d8c9c0 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogWindow.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_DialogWindow.cpp @@ -45,9 +45,7 @@ void GL_DialogWindow::setScreenSize(int width, int height) m_screenHeight = height; } GL_DialogWindow::~GL_DialogWindow() -{ - -} += default; diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_ShapeDrawer.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_ShapeDrawer.cpp index 52e085d47deab9bae2207bb5186631ea16bc6077..c8d55bce48264eea8259b9e900cd3f7895d83cca 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_ShapeDrawer.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_ShapeDrawer.cpp @@ -776,7 +776,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons { if (shape->isConvex()) { - const btConvexPolyhedron* poly = shape->isPolyhedral() ? ((btPolyhedralConvexShape*) shape)->getConvexPolyhedron() : 0; + const btConvexPolyhedron* poly = shape->isPolyhedral() ? ((btPolyhedralConvexShape*) shape)->getConvexPolyhedron() : nullptr; if (poly) { diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_Simplex1to4.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_Simplex1to4.cpp index 75a00b66da2303e2848be5a4cf93f1fd0e99a3ab..18d8a9f148d52ee1ee56359d380ef803189b0058 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_Simplex1to4.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GL_Simplex1to4.cpp @@ -30,13 +30,12 @@ subject to the following restrictions: #include "LinearMath/btTransform.h" GL_Simplex1to4::GL_Simplex1to4() - : m_simplexSolver(0) + : m_simplexSolver(nullptr) { } GL_Simplex1to4::~GL_Simplex1to4() -{ -} += default; /// /// Debugging method calcClosest calculates the closest point to the origin, using m_simplexSolver diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GlutStuff.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GlutStuff.cpp index c150cb230b14d2b1c99c28db90e8d4a6d9e2b045..bf74c7a8fa7cb63abee7a075c81ebeab99d8df0f 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GlutStuff.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/GlutStuff.cpp @@ -18,7 +18,7 @@ subject to the following restrictions: #include "DemoApplication.h" //glut is C code, this global gDemoApplication links glut to the C++ demo -static DemoApplication* gDemoApplication = 0; +static DemoApplication* gDemoApplication = nullptr; #include "GlutStuff.h" diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/stb_image.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/stb_image.cpp index f5b40913ba74baa1031fbe314225c07786ec0c02..7a0c7d067fa8cf4f8f331b140cb46e2bddf813e8 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/stb_image.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/stb_image.cpp @@ -81,7 +81,7 @@ static void refill_buffer(stbi* s); // initialize a memory-decode context static void start_mem(stbi* s, uint8 const* buffer, int len) { - s->io.read = NULL; + s->io.read = nullptr; s->read_from_callbacks = 0; s->img_buffer = s->img_buffer_original = (uint8*) buffer; s->img_buffer_end = (uint8*) buffer + len; @@ -604,7 +604,7 @@ assert(req_comp >= 1 && req_comp <= 4); good = (unsigned char*) malloc(req_comp * x * y); -if (good == NULL) +if (good == nullptr) { free(data); return epuc("outofmem", "Out of memory"); @@ -664,7 +664,7 @@ static float* ldr_to_hdr(stbi_uc* data, int x, int y, int comp) int i, k, n; float* output = (float*) malloc(x * y * comp * sizeof(float)); -if (output == NULL) +if (output == nullptr) { free(data); return epf("outofmem", "Out of memory"); @@ -703,7 +703,7 @@ static stbi_uc* hdr_to_ldr(float* data, int x, int y, int comp) int i, k, n; stbi_uc* output = (stbi_uc*) malloc(x * y * comp); -if (output == NULL) +if (output == nullptr) { free(data); return epuc("outofmem", "Out of memory"); @@ -1647,8 +1647,8 @@ s->img_n = c; for (i = 0; i < c; ++i) { - z->img_comp[i].data = NULL; - z->img_comp[i].linebuf = NULL; + z->img_comp[i].data = nullptr; + z->img_comp[i].linebuf = nullptr; } if (Lf != 8 + 3 * s->img_n) @@ -1733,12 +1733,12 @@ for (i = 0; i < s->img_n; ++i) z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; z->img_comp[i].raw_data = malloc(z->img_comp[i].w2 * z->img_comp[i].h2 + 15); - if (z->img_comp[i].raw_data == NULL) + if (z->img_comp[i].raw_data == nullptr) { for (--i; i >= 0; --i) { free(z->img_comp[i].raw_data); - z->img_comp[i].data = NULL; + z->img_comp[i].data = nullptr; } return e("outofmem", "Out of memory"); @@ -1746,7 +1746,7 @@ for (i = 0; i < s->img_n; ++i) // align blocks for installable-idct using mmx/sse z->img_comp[i].data = (uint8*)(((size_t) z->img_comp[i].raw_data + 15) & ~15); - z->img_comp[i].linebuf = NULL; + z->img_comp[i].linebuf = nullptr; } return 1; @@ -2058,13 +2058,13 @@ for (i = 0; i < j->s->img_n; ++i) if (j->img_comp[i].data) { free(j->img_comp[i].raw_data); - j->img_comp[i].data = NULL; + j->img_comp[i].data = nullptr; } if (j->img_comp[i].linebuf) { free(j->img_comp[i].linebuf); - j->img_comp[i].linebuf = NULL; + j->img_comp[i].linebuf = nullptr; } } } @@ -2095,7 +2095,7 @@ z->s->img_n = 0; if (!decode_jpeg_image(z)) { cleanup_jpeg(z); - return NULL; + return nullptr; } // determine actual number of components to generate @@ -2526,7 +2526,7 @@ while (cur + n > limit) q = (char*) realloc(z->zout_start, limit); -if (q == NULL) +if (q == nullptr) { return e("outofmem", "Out of memory"); } @@ -2901,9 +2901,9 @@ char* stbi_zlib_decode_malloc_guesssize(const char* buffer, int len, int initial zbuf a; char* p = (char*) malloc(initial_size); -if (p == NULL) +if (p == nullptr) { - return NULL; + return nullptr; } a.zbuffer = (uint8*) buffer; @@ -2921,7 +2921,7 @@ if (do_zlib(&a, p, initial_size, 1, 1)) else { free(a.zout_start); - return NULL; + return nullptr; } } @@ -2935,9 +2935,9 @@ char* stbi_zlib_decode_malloc_guesssize_headerflag(const char* buffer, int len, zbuf a; char* p = (char*) malloc(initial_size); -if (p == NULL) +if (p == nullptr) { - return NULL; + return nullptr; } a.zbuffer = (uint8*) buffer; @@ -2955,7 +2955,7 @@ if (do_zlib(&a, p, initial_size, 1, parse_header)) else { free(a.zout_start); - return NULL; + return nullptr; } } @@ -2980,9 +2980,9 @@ char* stbi_zlib_decode_noheader_malloc(char const* buffer, int len, int* outlen) zbuf a; char* p = (char*) malloc(16384); -if (p == NULL) +if (p == nullptr) { - return NULL; + return nullptr; } a.zbuffer = (uint8*) buffer; @@ -3000,7 +3000,7 @@ if (do_zlib(&a, p, 16384, 1, 0)) else { free(a.zout_start); - return NULL; + return nullptr; } } @@ -3354,7 +3354,7 @@ uint8* p, *temp_out, *orig = a->out; p = (uint8*) malloc(pixel_count * pal_img_n); -if (p == NULL) +if (p == nullptr) { return e("outofmem", "Out of memory"); } @@ -3471,9 +3471,9 @@ uint32 ioff = 0, idata_limit = 0, i, pal_len = 0; int first = 1, k, interlace = 0, iphone = 0; stbi* s = z->s; -z->expanded = NULL; -z->idata = NULL; -z->out = NULL; +z->expanded = nullptr; +z->idata = nullptr; +z->out = nullptr; if (!check_png_header(s)) { @@ -3730,7 +3730,7 @@ for (;;) p = (uint8*) realloc(z->idata, idata_limit); - if (p == NULL) + if (p == nullptr) { return e("outofmem", "Out of memory"); } @@ -3761,20 +3761,20 @@ for (;;) return 1; } - if (z->idata == NULL) + if (z->idata == nullptr) { return e("no IDAT", "Corrupt PNG"); } z->expanded = (uint8*) stbi_zlib_decode_malloc_guesssize_headerflag((char*) z->idata, ioff, 16384, (int*) &raw_len, !iphone); - if (z->expanded == NULL) + if (z->expanded == nullptr) { return 0; // zlib should set error } free(z->idata); - z->idata = NULL; + z->idata = nullptr; if ((req_comp == s->img_n + 1 && req_comp != 3 && !pal_img_n) || has_trans) { @@ -3819,7 +3819,7 @@ for (;;) } free(z->expanded); - z->expanded = NULL; + z->expanded = nullptr; return 1; } @@ -3855,7 +3855,7 @@ for (;;) static unsigned char* do_png(png* p, int* x, int* y, int* n, int req_comp) { -unsigned char* result = NULL; +unsigned char* result = nullptr; if (req_comp < 0 || req_comp > 4) { @@ -3865,14 +3865,14 @@ if (req_comp < 0 || req_comp > 4) if (parse_png_file(p, SCAN_load, req_comp)) { result = p->out; - p->out = NULL; + p->out = nullptr; if (req_comp && req_comp != p->s->img_out_n) { result = convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); p->s->img_out_n = req_comp; - if (result == NULL) + if (result == nullptr) { return result; } @@ -3888,11 +3888,11 @@ if (parse_png_file(p, SCAN_load, req_comp)) } free(p->out); -p->out = NULL; +p->out = nullptr; free(p->expanded); -p->expanded = NULL; +p->expanded = nullptr; free(p->idata); -p->idata = NULL; +p->idata = nullptr; return result; } @@ -4415,7 +4415,7 @@ if (req_comp && req_comp != target) { out = convert_format(out, target, req_comp, s->img_x, s->img_y); - if (out == NULL) + if (out == nullptr) { return out; // convert_format frees input on failure } @@ -4582,7 +4582,7 @@ int tga_bits_per_pixel = get8u(s); int tga_inverted = get8u(s); // image data unsigned char* tga_data; -unsigned char* tga_palette = NULL; +unsigned char* tga_palette = nullptr; int i, j; unsigned char raw_data[4]; unsigned char trans_data[4]; @@ -4608,7 +4608,7 @@ if ( //(tga_indexed) || (tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32)) ) { - return NULL; // we don't report this as a bad TGA because we don't even know if it's TGA + return nullptr; // we don't report this as a bad TGA because we don't even know if it's TGA } // If I'm paletted, then I'll use the number of bits from the palette @@ -4815,7 +4815,7 @@ if (tga_inverted) } // clear my palette, if I had one -if (tga_palette != NULL) +if (tga_palette != nullptr) { free(tga_palette); } @@ -5058,7 +5058,7 @@ if (req_comp && req_comp != 4) { out = convert_format(out, 4, req_comp, w, h); - if (out == NULL) + if (out == nullptr) { return out; // convert_format frees input on failure } @@ -5218,7 +5218,7 @@ for (y = 0; y < height; ++y) for (x = 0; x < width; ++x, dest += 4) if (!pic_readval(s, packet->channel, dest)) { - return 0; + return nullptr; } break; @@ -5246,7 +5246,7 @@ for (y = 0; y < height; ++y) if (!pic_readval(s, packet->channel, value)) { - return 0; + return nullptr; } for (i = 0; i < count; ++i, dest += 4) @@ -5293,7 +5293,7 @@ for (y = 0; y < height; ++y) if (!pic_readval(s, packet->channel, value)) { - return 0; + return nullptr; } for (i = 0; i < count; ++i, dest += 4) @@ -5313,7 +5313,7 @@ for (y = 0; y < height; ++y) for (i = 0; i < count; ++i, dest += 4) if (!pic_readval(s, packet->channel, dest)) { - return 0; + return nullptr; } } @@ -5363,7 +5363,7 @@ memset(result, 0xff, x * y * 4); if (!pic_load2(s, x, y, comp, result)) { free(result); - result = 0; + result = nullptr; } *px = x; @@ -5490,7 +5490,7 @@ g->bgindex = get8(s); g->ratio = get8(s); g->transparent = -1; -if (comp != 0) +if (comp != nullptr) { *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments } @@ -5710,18 +5710,18 @@ for (i = 0; i < g->w * g->h * 4; i += 4) static uint8* stbi_gif_load_next(stbi* s, stbi_gif* g, int* comp, int req_comp) { int i; -uint8* old_out = 0; +uint8* old_out = nullptr; -if (g->out == 0) +if (g->out == nullptr) { if (!stbi_gif_header(s, g, comp, 0)) { - return 0; // failure_reason set by stbi_gif_header + return nullptr; // failure_reason set by stbi_gif_header } g->out = (uint8*) malloc(4 * g->w * g->h); - if (g->out == 0) + if (g->out == nullptr) { return epuc("outofmem", "Out of memory"); } @@ -5736,7 +5736,7 @@ else old_out = g->out; g->out = (uint8*) malloc(4 * g->w * g->h); - if (g->out == 0) + if (g->out == nullptr) { return epuc("outofmem", "Out of memory"); } @@ -5811,9 +5811,9 @@ for (;;) o = stbi_process_gif_raster(s, g); - if (o == NULL) + if (o == nullptr) { - return NULL; + return nullptr; } if (req_comp && req_comp != 4) @@ -5864,14 +5864,14 @@ for (;;) static stbi_uc* stbi_gif_load(stbi* s, int* x, int* y, int* comp, int req_comp) { -uint8* u = 0; +uint8* u = nullptr; stbi_gif g = {0}; u = stbi_gif_load_next(s, &g, comp, req_comp); if (u == (void*) 1) { - u = 0; // end of animated gif marker + u = nullptr; // end of animated gif marker } if (u) @@ -6055,7 +6055,7 @@ if (strncmp(token, "+X ", 3)) } token += 3; -width = strtol(token, NULL, 10); +width = strtol(token, nullptr, 10); *x = width; *y = height; @@ -6089,7 +6089,7 @@ main_decode_loop: else { // Read RLE-encoded data - scanline = NULL; + scanline = nullptr; for (j = 0; j < height; ++j) { @@ -6123,7 +6123,7 @@ else return epf("invalid decoded scanline length", "corrupt HDR"); } - if (scanline == NULL) + if (scanline == nullptr) { scanline = (stbi_uc*) malloc(width * 4); } @@ -6231,7 +6231,7 @@ if (strncmp(token, "+X ", 3)) } token += 3; -*x = strtol(token, NULL, 10); +*x = strtol(token, nullptr, 10); *comp = 3; return 1; } diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp index f259464ea465acc25dd180c268e7724e93c3b516..7c6ce736290aed31ec2915a55ba248d85c5c6419 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp @@ -91,9 +91,7 @@ namespace SimDynamics } BulletOpenGLViewer::~BulletOpenGLViewer() - { - - } + = default; void BulletOpenGLViewer::initPhysics() { diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp index 019669871074a940775af92c3817dc65abfd2f38..1e65be5bd56b6947861d98f2ff2af39e6d751526 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp @@ -58,8 +58,7 @@ namespace SimDynamics } BulletRobot::~BulletRobot() - { - } + = default; diff --git a/SimDynamics/DynamicsEngine/BulletEngine/SimoxCollisionDispatcher.cpp b/SimDynamics/DynamicsEngine/BulletEngine/SimoxCollisionDispatcher.cpp index 2a8019e06a3173cbe8d90992554b4dbd7ab0dc31..d18fbf9ef4797b11077f585924f20fe6856c22ec 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/SimoxCollisionDispatcher.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/SimoxCollisionDispatcher.cpp @@ -15,9 +15,7 @@ namespace SimDynamics } SimoxCollisionDispatcher::~SimoxCollisionDispatcher() - { - - } + = default; bool SimoxCollisionDispatcher::needsCollision(const btCollisionObject* body0, const btCollisionObject* body1) { SimDynamics::BulletObject* o0 = static_cast<SimDynamics::BulletObject*>(body0->getUserPointer()); diff --git a/SimDynamics/DynamicsEngine/BulletEngine/SimoxMotionState.cpp b/SimDynamics/DynamicsEngine/BulletEngine/SimoxMotionState.cpp index 04b53c60e9b27549af27b358becb1bb2ef2be94c..ce9f4a0bc3c0cd470bb257729dac2a8207e7ee41 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/SimoxMotionState.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/SimoxMotionState.cpp @@ -49,9 +49,7 @@ namespace SimDynamics } SimoxMotionState::~SimoxMotionState() - { - - } + = default; void SimoxMotionState::setWorldTransform(const btTransform& worldPose) { diff --git a/SimDynamics/DynamicsEngine/DynamicsObject.cpp b/SimDynamics/DynamicsEngine/DynamicsObject.cpp index c7be1b796e81325050c71bf7fb353b8c631c704b..d0b0b1fdb5d560e38c994a6f15f42d335ef2c9e8 100644 --- a/SimDynamics/DynamicsEngine/DynamicsObject.cpp +++ b/SimDynamics/DynamicsEngine/DynamicsObject.cpp @@ -13,8 +13,7 @@ namespace SimDynamics } DynamicsObject::~DynamicsObject() - { - } + = default; std::string DynamicsObject::getName() const { diff --git a/SimDynamics/DynamicsEngine/DynamicsRobot.cpp b/SimDynamics/DynamicsEngine/DynamicsRobot.cpp index a8a9aa52e397abfc209d1396ff858efaa13069e7..ad3ac8b517fedf0fe75eaecb3a25e4e7c7493f2d 100644 --- a/SimDynamics/DynamicsEngine/DynamicsRobot.cpp +++ b/SimDynamics/DynamicsEngine/DynamicsRobot.cpp @@ -15,8 +15,7 @@ namespace SimDynamics } DynamicsRobot::~DynamicsRobot() - { - } + = default; std::string DynamicsRobot::getName() const { diff --git a/SimDynamics/DynamicsWorld.cpp b/SimDynamics/DynamicsWorld.cpp index ee67afd882860a72c1c94fca73b90aade02c20bf..9d4f99b603de0e0ce92f2f549c3b70571c75531d 100644 --- a/SimDynamics/DynamicsWorld.cpp +++ b/SimDynamics/DynamicsWorld.cpp @@ -81,8 +81,7 @@ namespace SimDynamics } DynamicsWorld::~DynamicsWorld() - { - } + = default; bool DynamicsWorld::addObject(DynamicsObjectPtr o) { diff --git a/SimDynamics/examples/SimDynamicsViewer/simDynamicsWindow.cpp b/SimDynamics/examples/SimDynamicsViewer/simDynamicsWindow.cpp index a9455f3378bb58fa8d832aaecc5f3eb2de299c3b..dc8ad157274b15d993ffb1e834288ddb5bc78a8a 100644 --- a/SimDynamics/examples/SimDynamicsViewer/simDynamicsWindow.cpp +++ b/SimDynamics/examples/SimDynamicsViewer/simDynamicsWindow.cpp @@ -28,7 +28,7 @@ using namespace VirtualRobot; using namespace SimDynamics; SimDynamicsWindow::SimDynamicsWindow(std::string& sRobotFilename) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; //this->setCaption(QString("ShowRobot - KIT - Humanoids Group")); @@ -811,7 +811,7 @@ void SimDynamicsWindow::stopCB() SoSensorManager* sensor_mgr = SoDB::getSensorManager(); sensor_mgr->removeTimerSensor(timerSensor); delete timerSensor; - timerSensor = NULL; + timerSensor = nullptr; } viewer.reset(); diff --git a/VirtualRobot/CollisionDetection/CDManager.cpp b/VirtualRobot/CollisionDetection/CDManager.cpp index be21d421d3e8ac0dd50c0e4d4e0d64aa4d37d27c..aa854b6945dee20acdb94613ab1cf9437bfd9874 100644 --- a/VirtualRobot/CollisionDetection/CDManager.cpp +++ b/VirtualRobot/CollisionDetection/CDManager.cpp @@ -16,7 +16,7 @@ namespace VirtualRobot CDManager::CDManager(CollisionCheckerPtr colChecker) { - if (colChecker == NULL) + if (colChecker == nullptr) { this->colChecker = VirtualRobot::CollisionChecker::getGlobalCollisionChecker(); } @@ -27,8 +27,7 @@ namespace VirtualRobot } CDManager::~CDManager() - { - } + = default; void CDManager::addCollisionModel(SceneObjectSetPtr m) { diff --git a/VirtualRobot/CollisionDetection/CollisionChecker.cpp b/VirtualRobot/CollisionDetection/CollisionChecker.cpp index 24ca3f860bef47bc31a3b1755fc2c6d9377c91eb..c6756425908b6000255e662cd5b660e8388d3fef 100644 --- a/VirtualRobot/CollisionDetection/CollisionChecker.cpp +++ b/VirtualRobot/CollisionDetection/CollisionChecker.cpp @@ -71,26 +71,25 @@ namespace VirtualRobot // class CollisionChecker destructor //---------------------------------------------------------------------- CollisionChecker::~CollisionChecker() - { - } + = default; float CollisionChecker::calculateDistance(SceneObjectSetPtr model1, SceneObjectSetPtr model2) { VR_ASSERT(model1 && model2); - return calculateDistance(model1, model2, tmpV1, tmpV2, NULL, NULL); + return calculateDistance(model1, model2, tmpV1, tmpV2, nullptr, nullptr); } float CollisionChecker::calculateDistance(CollisionModelPtr model1, SceneObjectSetPtr model2) { VR_ASSERT(model1 && model2); - return calculateDistance(model1, model2, tmpV1, tmpV2, NULL, NULL); + return calculateDistance(model1, model2, tmpV1, tmpV2, nullptr, nullptr); } float CollisionChecker::calculateDistance(CollisionModelPtr model1, CollisionModelPtr model2) { VR_ASSERT(model1 && model2); - return calculateDistance(model1, model2, tmpV1, tmpV2, NULL, NULL); + return calculateDistance(model1, model2, tmpV1, tmpV2, nullptr, nullptr); } @@ -106,7 +105,7 @@ namespace VirtualRobot } else { - return calculateDistance(model1->getCollisionModel(), model2, tmpV1, tmpV2, NULL, NULL); + return calculateDistance(model1->getCollisionModel(), model2, tmpV1, tmpV2, nullptr, nullptr); } } @@ -134,7 +133,7 @@ namespace VirtualRobot } else { - return calculateDistance(model1->getCollisionModel(), model2->getCollisionModel(), tmpV1, tmpV2, NULL, NULL); + return calculateDistance(model1->getCollisionModel(), model2->getCollisionModel(), tmpV1, tmpV2, nullptr, nullptr); } } diff --git a/VirtualRobot/CollisionDetection/PQP/CollisionCheckerPQP.cpp b/VirtualRobot/CollisionDetection/PQP/CollisionCheckerPQP.cpp index 6bb10f4fc9bc524ade1d1709f71c9cd10322a86c..23bd8cd0609144ce6d3faebbe3500dae48f8913d 100644 --- a/VirtualRobot/CollisionDetection/PQP/CollisionCheckerPQP.cpp +++ b/VirtualRobot/CollisionDetection/PQP/CollisionCheckerPQP.cpp @@ -35,7 +35,7 @@ namespace VirtualRobot CollisionCheckerPQP::~CollisionCheckerPQP() { delete pqpChecker; - pqpChecker = NULL; + pqpChecker = nullptr; } diff --git a/VirtualRobot/CollisionDetection/PQP/CollisionModelPQP.cpp b/VirtualRobot/CollisionDetection/PQP/CollisionModelPQP.cpp index c7d8a4e34fc98fbd3df5dc62187abdd59ccf2250..e7a4c6911e9bb871e492b5c1e9960d8d63b97a83 100644 --- a/VirtualRobot/CollisionDetection/PQP/CollisionModelPQP.cpp +++ b/VirtualRobot/CollisionDetection/PQP/CollisionModelPQP.cpp @@ -29,15 +29,14 @@ namespace VirtualRobot } CollisionModelPQP::CollisionModelPQP(const CollisionModelPQP &orig) : - CollisionModelImplementation(orig.modelData, NULL, orig.id) + CollisionModelImplementation(orig.modelData, nullptr, orig.id) { pqpModel = orig.pqpModel; } CollisionModelPQP::~CollisionModelPQP() - { - } + = default; void CollisionModelPQP::destroyData() diff --git a/VirtualRobot/CollisionDetection/PQP/PQP++/PQP.cpp b/VirtualRobot/CollisionDetection/PQP/PQP++/PQP.cpp index e6102b949d97a1f44d7911ded11baf1e8d5d6a4c..6a8ef8f31635fc9d0003a61c6fbecbc0594fc9c6 100644 --- a/VirtualRobot/CollisionDetection/PQP/PQP++/PQP.cpp +++ b/VirtualRobot/CollisionDetection/PQP/PQP++/PQP.cpp @@ -63,29 +63,29 @@ namespace PQP { // no bounding volume tree yet - b = 0; + b = nullptr; num_bvs_alloced = 0; num_bvs = 0; // no tri list yet - tris = 0; + tris = nullptr; num_tris = 0; num_tris_alloced = 0; - last_tri = 0; + last_tri = nullptr; build_state = PQP_BUILD_STATE_EMPTY; } PQP_Model::~PQP_Model() { - if (b != NULL) + if (b != nullptr) { delete [] b; } - if (tris != NULL) + if (tris != nullptr) { delete [] tris; } @@ -287,7 +287,7 @@ namespace PQP PQP_CollideResult::PQP_CollideResult() { - pairs = 0; + pairs = nullptr; num_pairs = num_pairs_alloced = 0; num_bv_tests = 0; num_tri_tests = 0; @@ -303,7 +303,7 @@ namespace PQP { num_pairs = num_pairs_alloced = 0; delete [] pairs; - pairs = 0; + pairs = nullptr; } // may increase OR reduce mem usage @@ -961,7 +961,7 @@ namespace PQP pqp_math.McM(min_test.R, R); pqp_math.VcV(min_test.T, T); - while (1) + while (true) { int l1 = o1->child(min_test.b1)->Leaf(); int l2 = o2->child(min_test.b2)->Leaf(); @@ -1378,7 +1378,7 @@ namespace PQP pqp_math.McM(min_test.R, R); pqp_math.VcV(min_test.T, T); - while (1) + while (true) { int l1 = o1->child(min_test.b1)->Leaf(); int l2 = o2->child(min_test.b2)->Leaf(); diff --git a/VirtualRobot/Compression/CompressionBZip2.cpp b/VirtualRobot/Compression/CompressionBZip2.cpp index cb595e06c2a16c148b638f8db2ed4e9ce0db7153..74a0604d7917f8eb81298cf1eaa9b03f7573a077 100644 --- a/VirtualRobot/Compression/CompressionBZip2.cpp +++ b/VirtualRobot/Compression/CompressionBZip2.cpp @@ -366,10 +366,10 @@ namespace VirtualRobot { this->mode = eCompress; this->ofs = ofs; - ifs = NULL; + ifs = nullptr; THROW_VR_EXCEPTION_IF(!ofs, "Stream NULL"); THROW_VR_EXCEPTION_IF(!this->ofs->good(), "Stream not good"); - bzFileData = NULL; + bzFileData = nullptr; bzFileData = BZ2_bzWriteOpen(¤tError, this->ofs); THROW_VR_EXCEPTION_IF(!bzFileData, "Could not initialize compression..."); } @@ -378,11 +378,11 @@ namespace VirtualRobot { this->mode = eUncompress; this->ifs = ifs; - ofs = NULL; + ofs = nullptr; THROW_VR_EXCEPTION_IF(!ifs, "Stream NULL"); THROW_VR_EXCEPTION_IF(!this->ifs->good(), "Stream not good"); - bzFileData = NULL; - bzFileData = BZ2_bzReadOpen(¤tError, this->ifs, 0, 0, NULL, 0); + bzFileData = nullptr; + bzFileData = BZ2_bzReadOpen(¤tError, this->ifs, 0, 0, nullptr, 0); THROW_VR_EXCEPTION_IF(!bzFileData, "Could not initialize compression..."); } @@ -398,10 +398,10 @@ namespace VirtualRobot { if (mode == eCompress && bzFileData && ofs) { - BZ2_bzWriteClose(¤tError, bzFileData, 0, NULL, NULL); + BZ2_bzWriteClose(¤tError, bzFileData, 0, nullptr, nullptr); //ofs->close(); //fclose (dataFile); - bzFileData = NULL; + bzFileData = nullptr; if (currentError < 0) //== BZ_IO_ERROR) { { @@ -412,7 +412,7 @@ namespace VirtualRobot else if (mode == eUncompress && bzFileData && ifs) { BZ2_bzReadClose(¤tError, bzFileData); - bzFileData = NULL; + bzFileData = nullptr; //fclose (dataFile); } @@ -2685,7 +2685,7 @@ zero: /*-- the log(N) loop --*/ H = 1; - while (1) + while (true) { if (verb >= 4) @@ -2715,7 +2715,7 @@ zero: nNotDone = 0; r = -1; - while (1) + while (true) { /*-- find the next non-singleton bucket --*/ @@ -2966,9 +2966,9 @@ zero: unLo = ltLo = lo; unHi = gtHi = hi; - while (1) + while (true) { - while (1) + while (true) { if (unLo > unHi) { @@ -2993,7 +2993,7 @@ zero: unLo++; } - while (1) + while (true) { if (unLo > unHi) { @@ -3204,9 +3204,9 @@ case lll: s->state = lll; \ s->save_zj = 0; s->save_gSel = 0; s->save_gMinlen = 0; - s->save_gLimit = NULL; - s->save_gBase = NULL; - s->save_gPerm = NULL; + s->save_gLimit = nullptr; + s->save_gBase = nullptr; + s->save_gPerm = nullptr; } /*restore from the save area*/ @@ -3278,7 +3278,7 @@ case lll: s->state = lll; \ ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) ); - if (s->ll16 == NULL || s->ll4 == NULL) + if (s->ll16 == nullptr || s->ll4 == nullptr) { RETURN(BZ_MEM_ERROR); } @@ -3287,7 +3287,7 @@ case lll: s->state = lll; \ { s->tt = (UInt32*)BZALLOC(s->blockSize100k * 100000 * sizeof(Int32)); - if (s->tt == NULL) + if (s->tt == nullptr) { RETURN(BZ_MEM_ERROR); } @@ -3993,31 +3993,31 @@ save_state_and_return: int workFactor) { Int32 ret; - bzFile* bzf = NULL; + bzFile* bzf = nullptr; BZ_SETERR(BZ_OK); - if (f == NULL || + if (f == nullptr || (blockSize100k < 1 || blockSize100k > 9) || (workFactor < 0 || workFactor > 250) || (verbosity < 0 || verbosity > 4)) { BZ_SETERR(BZ_PARAM_ERROR); - return NULL; + return nullptr; }; if (!f || f->bad()) { BZ_SETERR(BZ_IO_ERROR); - return NULL; + return nullptr; }; bzf = (bzFile*)malloc(sizeof(bzFile)); - if (bzf == NULL) + if (bzf == nullptr) { BZ_SETERR(BZ_MEM_ERROR); - return NULL; + return nullptr; }; BZ_SETERR(BZ_OK); @@ -4026,17 +4026,17 @@ save_state_and_return: bzf->bufN = 0; - bzf->handleIn = NULL; + bzf->handleIn = nullptr; bzf->handleOut = f; bzf->writing = BZ_True; - bzf->strm.bzalloc = NULL; + bzf->strm.bzalloc = nullptr; - bzf->strm.bzfree = NULL; + bzf->strm.bzfree = nullptr; - bzf->strm.opaque = NULL; + bzf->strm.opaque = nullptr; if (workFactor == 0) { @@ -4050,7 +4050,7 @@ save_state_and_return: { BZ_SETERR(ret); free(bzf); - return NULL; + return nullptr; }; bzf->strm.avail_in = 0; @@ -4075,7 +4075,7 @@ save_state_and_return: return BZ_CONFIG_ERROR; } - if (strm == NULL || + if (strm == nullptr || blockSize100k < 1 || blockSize100k > 9 || workFactor < 0 || workFactor > 250) { @@ -4087,52 +4087,52 @@ save_state_and_return: workFactor = 30; } - if (strm->bzalloc == NULL) + if (strm->bzalloc == nullptr) { strm->bzalloc = default_bzalloc; } - if (strm->bzfree == NULL) + if (strm->bzfree == nullptr) { strm->bzfree = default_bzfree; } s = (EState*)BZALLOC(sizeof(EState)); - if (s == NULL) + if (s == nullptr) { return BZ_MEM_ERROR; } s->strm = strm; - s->arr1 = NULL; - s->arr2 = NULL; - s->ftab = NULL; + s->arr1 = nullptr; + s->arr2 = nullptr; + s->ftab = nullptr; n = 100000 * blockSize100k; s->arr1 = (UInt32*)BZALLOC(n * sizeof(UInt32)); s->arr2 = (UInt32*)BZALLOC((n + BZ_N_OVERSHOOT) * sizeof(UInt32)); s->ftab = (UInt32*)BZALLOC(65537 * sizeof(UInt32)); - if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) + if (s->arr1 == nullptr || s->arr2 == nullptr || s->ftab == nullptr) { - if (s->arr1 != NULL) + if (s->arr1 != nullptr) { BZFREE(s->arr1); } - if (s->arr2 != NULL) + if (s->arr2 != nullptr) { BZFREE(s->arr2); } - if (s->ftab != NULL) + if (s->ftab != nullptr) { BZFREE(s->ftab); } - if (s != NULL) + if (s != nullptr) { BZFREE(s); } @@ -4151,7 +4151,7 @@ save_state_and_return: s->block = (UChar*)s->arr2; s->mtfv = (UInt16*)s->arr1; - s->zbits = NULL; + s->zbits = nullptr; s->ptr = (UInt32*)s->arr1; strm->state = s; @@ -4235,7 +4235,7 @@ save_state_and_return: BZ_SETERR(BZ_OK); - if (bzf == NULL || buf == NULL || len < 0) + if (bzf == nullptr || buf == nullptr || len < 0) { BZ_SETERR(BZ_PARAM_ERROR); return; @@ -4308,7 +4308,7 @@ save_state_and_return: unsigned int* nbytes_out) { BZ2_bzWriteClose64(bzerror, b, abandon, - nbytes_in, NULL, nbytes_out, NULL); + nbytes_in, nullptr, nbytes_out, nullptr); } @@ -4324,7 +4324,7 @@ save_state_and_return: Int32 n, ret; bzFile* bzf = (bzFile*)b; - if (bzf == NULL) + if (bzf == nullptr) { BZ_SETERR(BZ_OK); return; @@ -4343,22 +4343,22 @@ save_state_and_return: return; }; - if (nbytes_in_lo32 != NULL) + if (nbytes_in_lo32 != nullptr) { *nbytes_in_lo32 = 0; } - if (nbytes_in_hi32 != NULL) + if (nbytes_in_hi32 != nullptr) { *nbytes_in_hi32 = 0; } - if (nbytes_out_lo32 != NULL) + if (nbytes_out_lo32 != nullptr) { *nbytes_out_lo32 = 0; } - if (nbytes_out_hi32 != NULL) + if (nbytes_out_hi32 != nullptr) { *nbytes_out_hi32 = 0; } @@ -4408,22 +4408,22 @@ save_state_and_return: }; } - if (nbytes_in_lo32 != NULL) + if (nbytes_in_lo32 != nullptr) { *nbytes_in_lo32 = bzf->strm.total_in_lo32; } - if (nbytes_in_hi32 != NULL) + if (nbytes_in_hi32 != nullptr) { *nbytes_in_hi32 = bzf->strm.total_in_hi32; } - if (nbytes_out_lo32 != NULL) + if (nbytes_out_lo32 != nullptr) { *nbytes_out_lo32 = bzf->strm.total_out_lo32; } - if (nbytes_out_hi32 != NULL) + if (nbytes_out_hi32 != nullptr) { *nbytes_out_hi32 = bzf->strm.total_out_hi32; } @@ -4438,14 +4438,14 @@ save_state_and_return: { EState* s; - if (strm == NULL) + if (strm == nullptr) { return BZ_PARAM_ERROR; } s = (EState*)strm->state; - if (s == NULL) + if (s == nullptr) { return BZ_PARAM_ERROR; } @@ -4455,24 +4455,24 @@ save_state_and_return: return BZ_PARAM_ERROR; } - if (s->arr1 != NULL) + if (s->arr1 != nullptr) { BZFREE(s->arr1); } - if (s->arr2 != NULL) + if (s->arr2 != nullptr) { BZFREE(s->arr2); } - if (s->ftab != NULL) + if (s->ftab != nullptr) { BZFREE(s->ftab); } BZFREE(strm->state); - strm->state = NULL; + strm->state = nullptr; return BZ_OK; } @@ -4482,14 +4482,14 @@ save_state_and_return: { DState* s; - if (strm == NULL) + if (strm == nullptr) { return BZ_PARAM_ERROR; } s = (DState*)strm->state; - if (s == NULL) + if (s == nullptr) { return BZ_PARAM_ERROR; } @@ -4499,23 +4499,23 @@ save_state_and_return: return BZ_PARAM_ERROR; } - if (s->tt != NULL) + if (s->tt != nullptr) { BZFREE(s->tt); } - if (s->ll16 != NULL) + if (s->ll16 != nullptr) { BZFREE(s->ll16); } - if (s->ll4 != NULL) + if (s->ll4 != nullptr) { BZFREE(s->ll4); } BZFREE(strm->state); - strm->state = NULL; + strm->state = nullptr; return BZ_OK; } @@ -4526,14 +4526,14 @@ save_state_and_return: Bool progress; EState* s; - if (strm == NULL) + if (strm == nullptr) { return BZ_PARAM_ERROR; } s = (EState*)strm->state; - if (s == NULL) + if (s == nullptr) { return BZ_PARAM_ERROR; } @@ -4878,34 +4878,34 @@ preswitch: void* unused, int nUnused) { - bzFile* bzf = NULL; + bzFile* bzf = nullptr; int ret; BZ_SETERR(BZ_OK); - if (f == NULL || + if (f == nullptr || (smallValue != 0 && smallValue != 1) || (verbosity < 0 || verbosity > 4) || - (unused == NULL && nUnused != 0) || - (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) + (unused == nullptr && nUnused != 0) || + (unused != nullptr && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) { BZ_SETERR(BZ_PARAM_ERROR); - return NULL; + return nullptr; }; // if (ferror(f)) if (!f->good()) { BZ_SETERR(BZ_IO_ERROR); - return NULL; + return nullptr; }; bzf = (CompressionBZip2::bzFile*)malloc(sizeof(bzFile)); - if (bzf == NULL) + if (bzf == nullptr) { BZ_SETERR(BZ_MEM_ERROR); - return NULL; + return nullptr; }; BZ_SETERR(BZ_OK); @@ -4914,17 +4914,17 @@ preswitch: bzf->handleIn = f; - bzf->handleOut = NULL; + bzf->handleOut = nullptr; bzf->bufN = 0; bzf->writing = BZ_False; - bzf->strm.bzalloc = NULL; + bzf->strm.bzalloc = nullptr; - bzf->strm.bzfree = NULL; + bzf->strm.bzfree = nullptr; - bzf->strm.opaque = NULL; + bzf->strm.opaque = nullptr; while (nUnused > 0) { @@ -4940,7 +4940,7 @@ preswitch: { BZ_SETERR(ret); free(bzf); - return NULL; + return nullptr; }; bzf->strm.avail_in = bzf->bufN; @@ -4960,7 +4960,7 @@ preswitch: BZ_SETERR(BZ_OK); - if (bzf == NULL) + if (bzf == nullptr) { BZ_SETERR(BZ_OK); return; @@ -5018,7 +5018,7 @@ preswitch: BZ_SETERR(BZ_OK); - if (bzf == NULL || buf == NULL || len < 0) + if (bzf == nullptr || buf == nullptr || len < 0) { BZ_SETERR(BZ_PARAM_ERROR); return 0; @@ -5129,14 +5129,14 @@ preswitch: Bool corrupt; DState* s; - if (strm == NULL) + if (strm == nullptr) { return BZ_PARAM_ERROR; } s = (DState*)strm->state; - if (s == NULL) + if (s == nullptr) { return BZ_PARAM_ERROR; } @@ -5776,7 +5776,7 @@ return_notr: return BZ_CONFIG_ERROR; } - if (strm == NULL) + if (strm == nullptr) { return BZ_PARAM_ERROR; } @@ -5791,19 +5791,19 @@ return_notr: return BZ_PARAM_ERROR; } - if (strm->bzalloc == NULL) + if (strm->bzalloc == nullptr) { strm->bzalloc = default_bzalloc; } - if (strm->bzfree == NULL) + if (strm->bzfree == nullptr) { strm->bzfree = default_bzfree; } s = (DState*)BZALLOC(sizeof(DState)); - if (s == NULL) + if (s == nullptr) { return BZ_MEM_ERROR; } @@ -5819,9 +5819,9 @@ return_notr: strm->total_out_lo32 = 0; strm->total_out_hi32 = 0; s->smallDecompress = (Bool)smallValue; - s->ll4 = NULL; - s->ll16 = NULL; - s->tt = NULL; + s->ll4 = nullptr; + s->ll16 = nullptr; + s->tt = nullptr; s->currBlockNo = 0; s->verbosity = verbosity; @@ -5866,7 +5866,7 @@ return_notr: void CompressionBZip2::default_bzfree(void* /*opaque*/, void* addr) { - if (addr != NULL) + if (addr != nullptr) { free(addr); } diff --git a/VirtualRobot/Compression/tests/CompressionBZip2Test.cpp b/VirtualRobot/Compression/tests/CompressionBZip2Test.cpp index 703281f944e9f7dd242d40260b7a85fafeaf9baa..9b51d0a26e38452bb72d272d66bc7de889d63aa1 100644 --- a/VirtualRobot/Compression/tests/CompressionBZip2Test.cpp +++ b/VirtualRobot/Compression/tests/CompressionBZip2Test.cpp @@ -19,8 +19,8 @@ BOOST_AUTO_TEST_SUITE(Compression) BOOST_AUTO_TEST_CASE(testInvalidCreation) { - std::istream* is = NULL; - std::ostream* os = NULL; + std::istream* is = nullptr; + std::ostream* os = nullptr; BOOST_CHECK_THROW(new VirtualRobot::CompressionBZip2(is), VirtualRobot::VirtualRobotException); BOOST_CHECK_THROW(new VirtualRobot::CompressionBZip2(os), VirtualRobot::VirtualRobotException); } @@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(testNullBlock) std::stringstream ios; unsigned char blockN[BLOCK_SIZE_COMPRESSION_TEST]; memset(blockN, 0, sizeof(unsigned char)*BLOCK_SIZE_COMPRESSION_TEST); - VirtualRobot::CompressionBZip2* bzip2 = NULL; + VirtualRobot::CompressionBZip2* bzip2 = nullptr; BOOST_CHECK_NO_THROW(bzip2 = new VirtualRobot::CompressionBZip2((std::ostream*)(&ios))); bool ok = false; @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(testNullBlock) ios.seekg(0); unsigned char blockN2[BLOCK_SIZE_COMPRESSION_TEST]; memset(blockN2, 1, sizeof(unsigned char)*BLOCK_SIZE_COMPRESSION_TEST); - VirtualRobot::CompressionBZip2* bzip2b = NULL; + VirtualRobot::CompressionBZip2* bzip2b = nullptr; BOOST_CHECK_NO_THROW(bzip2b = new VirtualRobot::CompressionBZip2((std::istream*)(&ios))); ok = false; @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(testMultipleRandomBlocks) } } - VirtualRobot::CompressionBZip2* bzip2 = NULL; + VirtualRobot::CompressionBZip2* bzip2 = nullptr; BOOST_CHECK_NO_THROW(bzip2 = new VirtualRobot::CompressionBZip2((std::ostream*)(&ios))); bool ok = false; @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(testMultipleRandomBlocks) // set position to start ios.seekg(0); - VirtualRobot::CompressionBZip2* bzip2b = NULL; + VirtualRobot::CompressionBZip2* bzip2b = nullptr; BOOST_CHECK_NO_THROW(bzip2b = new VirtualRobot::CompressionBZip2((std::istream*)(&ios))); ok = false; @@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(testCorrectEnding) std::stringstream ios; unsigned char blockN[sizeSmall]; memset(blockN, 0, sizeof(unsigned char)*sizeSmall); - VirtualRobot::CompressionBZip2* bzip2 = NULL; + VirtualRobot::CompressionBZip2* bzip2 = nullptr; BOOST_CHECK_NO_THROW(bzip2 = new VirtualRobot::CompressionBZip2((std::ostream*)(&ios))); bool ok = false; @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(testCorrectEnding) ios.seekg(0); unsigned char blockN2[sizeSmall]; memset(blockN2, 1, sizeof(unsigned char)*sizeSmall); - VirtualRobot::CompressionBZip2* bzip2b = NULL; + VirtualRobot::CompressionBZip2* bzip2b = nullptr; BOOST_CHECK_NO_THROW(bzip2b = new VirtualRobot::CompressionBZip2((std::istream*)(&ios))); ok = false; diff --git a/VirtualRobot/EndEffector/EndEffector.cpp b/VirtualRobot/EndEffector/EndEffector.cpp index 2dfac2961a2d288cae9fa505aa3d889ff4148da3..b2b45c6d6cda387e54de5d011fcf14115c7033e3 100644 --- a/VirtualRobot/EndEffector/EndEffector.cpp +++ b/VirtualRobot/EndEffector/EndEffector.cpp @@ -45,9 +45,7 @@ namespace VirtualRobot } EndEffector::~EndEffector() - { - - } + = default; EndEffectorPtr EndEffector::clone(RobotPtr newRobot) { diff --git a/VirtualRobot/Grasping/BasicGraspQualityMeasure.cpp b/VirtualRobot/Grasping/BasicGraspQualityMeasure.cpp index fb24cba436df699aae87bd44f86ca0718c456527..e39d7baa4647ce9b65217e4aeba169cf9b600d79 100644 --- a/VirtualRobot/Grasping/BasicGraspQualityMeasure.cpp +++ b/VirtualRobot/Grasping/BasicGraspQualityMeasure.cpp @@ -68,8 +68,7 @@ namespace VirtualRobot } BasicGraspQualityMeasure::~BasicGraspQualityMeasure() - { - } + = default; void BasicGraspQualityMeasure::setContactPoints(const std::vector<VirtualRobot::MathTools::ContactPoint>& /*contactPoints6d*/) { diff --git a/VirtualRobot/Grasping/Grasp.cpp b/VirtualRobot/Grasping/Grasp.cpp index c91db04cebb86f113214b686c8db7b45bb0f94e5..e5150396b10ca75a52bb5e64f1586aad73b329ff 100644 --- a/VirtualRobot/Grasping/Grasp.cpp +++ b/VirtualRobot/Grasping/Grasp.cpp @@ -15,8 +15,7 @@ namespace VirtualRobot } Grasp::~Grasp() - { - } + = default; void Grasp::print(bool printDecoration /*= true*/) { diff --git a/VirtualRobot/Grasping/GraspEditor/GraspEditorWindow.cpp b/VirtualRobot/Grasping/GraspEditor/GraspEditorWindow.cpp index 50bd252ba723974dfc3683111db027cc0d488019..a3005f9dd79542efca86f045de47cf2b084999fb 100644 --- a/VirtualRobot/Grasping/GraspEditor/GraspEditorWindow.cpp +++ b/VirtualRobot/Grasping/GraspEditor/GraspEditorWindow.cpp @@ -40,7 +40,7 @@ namespace VirtualRobot GraspEditorWindow::GraspEditorWindow(std::string& objFile, std::string& robotFile, bool embeddedGraspEditor) - : QMainWindow(NULL), UI(new Ui::MainWindowGraspEditor) + : QMainWindow(nullptr), UI(new Ui::MainWindowGraspEditor) { VR_INFO << " start " << endl; @@ -280,7 +280,7 @@ namespace VirtualRobot if (object) { - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; boost::shared_ptr<VirtualRobot::CoinVisualization> visualizationObject = object->getVisualization<CoinVisualization>(colModel); if (visualizationObject) visualisationNode = visualizationObject->getCoinVisualization(); diff --git a/VirtualRobot/Grasping/GraspSet.cpp b/VirtualRobot/Grasping/GraspSet.cpp index 8c9ec2b73c044157dd7550ccf7e810ca7ebfdc87..0b741dffb8eaaa90dabe021abca436c2f764adba 100644 --- a/VirtualRobot/Grasping/GraspSet.cpp +++ b/VirtualRobot/Grasping/GraspSet.cpp @@ -18,8 +18,7 @@ namespace VirtualRobot } GraspSet::~GraspSet() - { - } + = default; void GraspSet::addGrasp(GraspPtr grasp) { diff --git a/VirtualRobot/IK/FeetPosture.cpp b/VirtualRobot/IK/FeetPosture.cpp index c8c0eaa9d2adfb41000ceb3d84dca3dfa5d3b73a..3b3b02d3e1a82ff1cabebd65a4a0f9a1646ad21c 100644 --- a/VirtualRobot/IK/FeetPosture.cpp +++ b/VirtualRobot/IK/FeetPosture.cpp @@ -41,9 +41,7 @@ namespace VirtualRobot } FeetPosture::~FeetPosture() - { - - } + = default; RobotNodeSetPtr FeetPosture::getLeftLeg() { diff --git a/VirtualRobot/IK/HierarchicalIK.cpp b/VirtualRobot/IK/HierarchicalIK.cpp index 8c24d07677fbae1dab647e5d1f480caf7620ec6e..233c0ba70d265e1e7819f9c1da903e9f07d02000 100644 --- a/VirtualRobot/IK/HierarchicalIK.cpp +++ b/VirtualRobot/IK/HierarchicalIK.cpp @@ -15,9 +15,7 @@ namespace VirtualRobot } HierarchicalIK::~HierarchicalIK() - { - - } + = default; void HierarchicalIK::setVerbose(bool v) { diff --git a/VirtualRobot/IK/IKSolver.cpp b/VirtualRobot/IK/IKSolver.cpp index 29359e68c19d27d27d87fd668bf6f2a5c06590b8..3720d663ba58d435d5dc23f2416f6b282c6b8584 100644 --- a/VirtualRobot/IK/IKSolver.cpp +++ b/VirtualRobot/IK/IKSolver.cpp @@ -3,7 +3,6 @@ namespace VirtualRobot { IKSolver::IKSolver() - { - } + = default; } // namespace VirtualRobot diff --git a/VirtualRobot/IK/JacobiProvider.cpp b/VirtualRobot/IK/JacobiProvider.cpp index 6d1a2d410683185702e14232ce8815ca7e0c7f57..5ae8f2dd633623e98d53dfa5472d6767a7b51ad3 100644 --- a/VirtualRobot/IK/JacobiProvider.cpp +++ b/VirtualRobot/IK/JacobiProvider.cpp @@ -22,8 +22,7 @@ namespace VirtualRobot } JacobiProvider::~JacobiProvider() - { - } + = default; MatrixXd JacobiProvider::getJacobianMatrixD() { diff --git a/VirtualRobot/IK/PoseQualityExtendedManipulability.cpp b/VirtualRobot/IK/PoseQualityExtendedManipulability.cpp index 8002e89d2282d1e485a6b7776a6a301c1e329b53..e886a5c6e3054b21886b50753151c88f992a617f 100644 --- a/VirtualRobot/IK/PoseQualityExtendedManipulability.cpp +++ b/VirtualRobot/IK/PoseQualityExtendedManipulability.cpp @@ -28,8 +28,7 @@ namespace VirtualRobot } PoseQualityExtendedManipulability::~PoseQualityExtendedManipulability() - { - } + = default; float PoseQualityExtendedManipulability::getPoseQuality() { diff --git a/VirtualRobot/IK/PoseQualityManipulability.cpp b/VirtualRobot/IK/PoseQualityManipulability.cpp index 6a098301cec81903fc8444891915e75ede95f71d..5b9cbbd9c2b6701f89a68c8c34674dbcd1fb97ea 100644 --- a/VirtualRobot/IK/PoseQualityManipulability.cpp +++ b/VirtualRobot/IK/PoseQualityManipulability.cpp @@ -21,8 +21,7 @@ namespace VirtualRobot PoseQualityManipulability::~PoseQualityManipulability() - { - } + = default; Eigen::MatrixXf PoseQualityManipulability::getSingularVectorCartesian() diff --git a/VirtualRobot/IK/PoseQualityMeasurement.cpp b/VirtualRobot/IK/PoseQualityMeasurement.cpp index 687bb2e3c132b5b93a388059863c386c0e6beea3..fa1d0116d0aeee89cdbd14ba3bab189c91efad66 100644 --- a/VirtualRobot/IK/PoseQualityMeasurement.cpp +++ b/VirtualRobot/IK/PoseQualityMeasurement.cpp @@ -21,8 +21,7 @@ namespace VirtualRobot PoseQualityMeasurement::~PoseQualityMeasurement() - { - } + = default; float PoseQualityMeasurement::getPoseQuality() { diff --git a/VirtualRobot/IK/StackedIK.cpp b/VirtualRobot/IK/StackedIK.cpp index 1330b50b2e47be5cf2240492f1d4a18e2614db80..2ab7969f17eff6c638cbd16774a6362f0da57978 100644 --- a/VirtualRobot/IK/StackedIK.cpp +++ b/VirtualRobot/IK/StackedIK.cpp @@ -36,8 +36,7 @@ namespace VirtualRobot } StackedIK::~StackedIK() - { - } + = default; void StackedIK::setVerbose(bool v) { diff --git a/VirtualRobot/IK/constraints/CoMConstraint.cpp b/VirtualRobot/IK/constraints/CoMConstraint.cpp index 982efbd9de3383b88196266cacca51d35c685f89..debe401019e49482c98bdede6c3097669c83d03e 100644 --- a/VirtualRobot/IK/constraints/CoMConstraint.cpp +++ b/VirtualRobot/IK/constraints/CoMConstraint.cpp @@ -116,5 +116,5 @@ bool CoMConstraint::checkTolerances() return d.norm() <= tolerance; } - return 0; + return false; } diff --git a/VirtualRobot/Import/COLLADA-light/pugixml/pugixml.cpp b/VirtualRobot/Import/COLLADA-light/pugixml/pugixml.cpp index e420b994a638a273c6a5832eea9392adb0ffe875..8f9eb1012619264adbcf39d4e9b31645208044cd 100644 --- a/VirtualRobot/Import/COLLADA-light/pugixml/pugixml.cpp +++ b/VirtualRobot/Import/COLLADA-light/pugixml/pugixml.cpp @@ -250,7 +250,7 @@ PUGI__NS_BEGIN T* release() { T* result = data; - data = 0; + data = nullptr; return result; } }; @@ -443,9 +443,9 @@ PUGI__NS_BEGIN { xml_memory_page* result = static_cast<xml_memory_page*>(memory); - result->allocator = 0; - result->prev = 0; - result->next = 0; + result->allocator = nullptr; + result->prev = nullptr; + result->next = nullptr; result->busy_size = 0; result->freed_size = 0; @@ -494,7 +494,7 @@ PUGI__NS_BEGIN // allocate block with some alignment, leaving memory for worst-case padding void* memory = xml_memory::allocate(size); - if (!memory) return 0; + if (!memory) return nullptr; // prepare page structure xml_memory_page* page = xml_memory_page::construct(memory); @@ -576,7 +576,7 @@ PUGI__NS_BEGIN if (page->freed_size == page->busy_size) { - if (page->next == 0) + if (page->next == nullptr) { assert(_root == page); @@ -623,7 +623,7 @@ PUGI__NS_BEGIN xml_memory_page* page; xml_memory_string_header* header = static_cast<xml_memory_string_header*>(allocate_memory(full_size, page)); - if (!header) return 0; + if (!header) return nullptr; // setup header ptrdiff_t page_offset = reinterpret_cast<char*>(header) - reinterpret_cast<char*>(page) - sizeof(xml_memory_page); @@ -685,7 +685,7 @@ PUGI__NS_BEGIN xml_memory_page* page = allocate_page(size <= large_allocation_threshold ? xml_memory_page_size : size); out_page = page; - if (!page) return 0; + if (!page) return nullptr; if (size <= large_allocation_threshold) { @@ -1067,7 +1067,7 @@ namespace pugi { struct xml_attribute_struct { - xml_attribute_struct(impl::xml_memory_page* page): name(0), value(0), prev_attribute_c(0), next_attribute(0) + xml_attribute_struct(impl::xml_memory_page* page): name(nullptr), value(nullptr), prev_attribute_c(nullptr), next_attribute(nullptr) { header = PUGI__GETHEADER_IMPL(this, page, 0); } @@ -1083,7 +1083,7 @@ namespace pugi struct xml_node_struct { - xml_node_struct(impl::xml_memory_page* page, xml_node_type type): name(0), value(0), parent(0), first_child(0), prev_sibling_c(0), next_sibling(0), first_attribute(0) + xml_node_struct(impl::xml_memory_page* page, xml_node_type type): name(nullptr), value(nullptr), parent(nullptr), first_child(nullptr), prev_sibling_c(nullptr), next_sibling(nullptr), first_attribute(nullptr) { header = PUGI__GETHEADER_IMPL(this, page, type); } @@ -1114,7 +1114,7 @@ PUGI__NS_BEGIN struct xml_document_struct: public xml_node_struct, public xml_allocator { - xml_document_struct(xml_memory_page* page): xml_node_struct(page, node_document), xml_allocator(page), buffer(0), extra_buffers(0) + xml_document_struct(xml_memory_page* page): xml_node_struct(page, node_document), xml_allocator(page), buffer(nullptr), extra_buffers(nullptr) { #ifdef PUGIXML_COMPACT _hash = &hash; @@ -1151,7 +1151,7 @@ PUGI__NS_BEGIN { xml_memory_page* page; void* memory = alloc.allocate_object(sizeof(xml_attribute_struct), page); - if (!memory) return 0; + if (!memory) return nullptr; return new (memory) xml_attribute_struct(page); } @@ -1160,7 +1160,7 @@ PUGI__NS_BEGIN { xml_memory_page* page; void* memory = alloc.allocate_object(sizeof(xml_node_struct), page); - if (!memory) return 0; + if (!memory) return nullptr; return new (memory) xml_node_struct(page, type); } @@ -1292,9 +1292,9 @@ PUGI__NS_BEGIN else parent->first_child = node->next_sibling; - node->parent = 0; - node->prev_sibling_c = 0; - node->next_sibling = 0; + node->parent = nullptr; + node->prev_sibling_c = nullptr; + node->next_sibling = nullptr; } inline void append_attribute(xml_attribute_struct* attr, xml_node_struct* node) @@ -1368,16 +1368,16 @@ PUGI__NS_BEGIN else node->first_attribute = attr->next_attribute; - attr->prev_attribute_c = 0; - attr->next_attribute = 0; + attr->prev_attribute_c = nullptr; + attr->next_attribute = nullptr; } PUGI__FN_NO_INLINE xml_node_struct* append_new_node(xml_node_struct* node, xml_allocator& alloc, xml_node_type type = node_element) { - if (!alloc.reserve()) return 0; + if (!alloc.reserve()) return nullptr; xml_node_struct* child = allocate_node(alloc, type); - if (!child) return 0; + if (!child) return nullptr; append_node(child, node); @@ -1386,10 +1386,10 @@ PUGI__NS_BEGIN PUGI__FN_NO_INLINE xml_attribute_struct* append_new_attribute(xml_node_struct* node, xml_allocator& alloc) { - if (!alloc.reserve()) return 0; + if (!alloc.reserve()) return nullptr; xml_attribute_struct* attr = allocate_attribute(alloc); - if (!attr) return 0; + if (!attr) return nullptr; append_attribute(attr, node); @@ -2310,7 +2310,7 @@ PUGI__NS_BEGIN char_t* end; size_t size; - gap(): end(0), size(0) + gap(): end(nullptr), size(0) { } @@ -2522,7 +2522,7 @@ PUGI__NS_BEGIN } else if (*s == 0) { - return 0; + return nullptr; } else ++s; } @@ -2550,7 +2550,7 @@ PUGI__NS_BEGIN } else if (*s == 0) { - return 0; + return nullptr; } else ++s; } @@ -2623,7 +2623,7 @@ PUGI__NS_BEGIN case 5: return strconv_pcdata_impl<opt_true, opt_false, opt_true>::parse; case 6: return strconv_pcdata_impl<opt_true, opt_true, opt_false>::parse; case 7: return strconv_pcdata_impl<opt_true, opt_true, opt_true>::parse; - default: assert(false); return 0; // should not get here + default: assert(false); return nullptr; // should not get here } } @@ -2677,7 +2677,7 @@ PUGI__NS_BEGIN } else if (!*s) { - return 0; + return nullptr; } else ++s; } @@ -2713,7 +2713,7 @@ PUGI__NS_BEGIN } else if (!*s) { - return 0; + return nullptr; } else ++s; } @@ -2745,7 +2745,7 @@ PUGI__NS_BEGIN } else if (!*s) { - return 0; + return nullptr; } else ++s; } @@ -2771,7 +2771,7 @@ PUGI__NS_BEGIN } else if (!*s) { - return 0; + return nullptr; } else ++s; } @@ -2800,7 +2800,7 @@ PUGI__NS_BEGIN case 13: return strconv_attribute_impl<opt_true>::parse_wnorm; case 14: return strconv_attribute_impl<opt_false>::parse_wnorm; case 15: return strconv_attribute_impl<opt_true>::parse_wnorm; - default: assert(false); return 0; // should not get here + default: assert(false); return nullptr; // should not get here } } @@ -2820,7 +2820,7 @@ PUGI__NS_BEGIN char_t* error_offset; xml_parse_status error_status; - xml_parser(xml_allocator* alloc_): alloc(*alloc_), alloc_state(alloc_), error_offset(0), error_status(status_ok) + xml_parser(xml_allocator* alloc_): alloc(*alloc_), alloc_state(alloc_), error_offset(nullptr), error_status(status_ok) { } @@ -3417,7 +3417,7 @@ PUGI__NS_BEGIN return make_parse_result(PUGI__OPTSET(parse_fragment) ? status_ok : status_no_document_element); // get last child of the root before parsing - xml_node_struct* last_root_child = root->first_child ? root->first_child->prev_sibling_c + 0 : 0; + xml_node_struct* last_root_child = root->first_child ? root->first_child->prev_sibling_c + 0 : nullptr; // create parser on stack xml_parser parser(static_cast<xml_allocator*>(xmldoc)); @@ -3599,8 +3599,8 @@ PUGI__NS_BEGIN class xml_buffered_writer { - xml_buffered_writer(const xml_buffered_writer&); - xml_buffered_writer& operator=(const xml_buffered_writer&); + xml_buffered_writer(const xml_buffered_writer&) = delete; + xml_buffered_writer& operator=(const xml_buffered_writer&) = delete; public: xml_buffered_writer(xml_writer& writer_, xml_encoding user_encoding): writer(writer_), bufsize(0), encoding(get_write_encoding(user_encoding)) @@ -4308,7 +4308,7 @@ PUGI__NS_BEGIN PUGI__FN void node_copy_tree(xml_node_struct* dn, xml_node_struct* sn) { xml_allocator& alloc = get_allocator(dn); - xml_allocator* shared_alloc = (&alloc == &get_allocator(sn)) ? &alloc : 0; + xml_allocator* shared_alloc = (&alloc == &get_allocator(sn)) ? &alloc : nullptr; node_copy_contents(dn, sn, shared_alloc); @@ -4353,7 +4353,7 @@ PUGI__NS_BEGIN PUGI__FN void node_copy_attribute(xml_attribute_struct* da, xml_attribute_struct* sa) { xml_allocator& alloc = get_allocator(da); - xml_allocator* shared_alloc = (&alloc == &get_allocator(sa)) ? &alloc : 0; + xml_allocator* shared_alloc = (&alloc == &get_allocator(sa)) ? &alloc : nullptr; node_copy_string(da->name, da->header, xml_memory_page_name_allocated_mask, sa->name, sa->header, shared_alloc); node_copy_string(da->value, da->header, xml_memory_page_value_allocated_mask, sa->value, sa->header, shared_alloc); @@ -4457,7 +4457,7 @@ PUGI__NS_BEGIN #ifdef PUGIXML_WCHAR_MODE return wcstod(value, 0); #else - return strtod(value, 0); + return strtod(value, nullptr); #endif } @@ -4466,7 +4466,7 @@ PUGI__NS_BEGIN #ifdef PUGIXML_WCHAR_MODE return static_cast<float>(wcstod(value, 0)); #else - return static_cast<float>(strtod(value, 0)); + return static_cast<float>(strtod(value, nullptr)); #endif } @@ -4588,7 +4588,7 @@ PUGI__NS_BEGIN xml_encoding buffer_encoding = impl::get_buffer_encoding(encoding, contents, size); // get private buffer - char_t* buffer = 0; + char_t* buffer = nullptr; size_t length = 0; if (!impl::convert_buffer(buffer, length, buffer_encoding, contents, size, is_mutable)) return impl::make_parse_result(status_out_of_memory); @@ -4711,7 +4711,7 @@ PUGI__NS_BEGIN static xml_stream_chunk* create() { void* memory = xml_memory::allocate(sizeof(xml_stream_chunk)); - if (!memory) return 0; + if (!memory) return nullptr; return new (memory) xml_stream_chunk(); } @@ -4729,7 +4729,7 @@ PUGI__NS_BEGIN } } - xml_stream_chunk(): next(0), size(0) + xml_stream_chunk(): next(nullptr), size(0) { } @@ -4741,11 +4741,11 @@ PUGI__NS_BEGIN template <typename T> PUGI__FN xml_parse_status load_stream_data_noseek(std::basic_istream<T>& stream, void** out_buffer, size_t* out_size) { - auto_deleter<xml_stream_chunk<T> > chunks(0, xml_stream_chunk<T>::destroy); + auto_deleter<xml_stream_chunk<T> > chunks(nullptr, xml_stream_chunk<T>::destroy); // read file to a chunk list size_t total = 0; - xml_stream_chunk<T>* last = 0; + xml_stream_chunk<T>* last = nullptr; while (!stream.eof()) { @@ -4831,7 +4831,7 @@ PUGI__NS_BEGIN template <typename T> PUGI__FN xml_parse_result load_stream_impl(xml_document_struct* doc, std::basic_istream<T>& stream, unsigned int options, xml_encoding encoding, char_t** out_buffer) { - void* buffer = 0; + void* buffer = nullptr; size_t size = 0; xml_parse_status status = status_ok; @@ -4871,7 +4871,7 @@ PUGI__NS_BEGIN // allocate resulting string char* result = static_cast<char*>(xml_memory::allocate(size + 1)); - if (!result) return 0; + if (!result) return nullptr; // second pass: convert to utf8 as_utf8_end(result, size, str, length); @@ -4886,7 +4886,7 @@ PUGI__NS_BEGIN { // there is no standard function to open wide paths, so our best bet is to try utf8 path char* path_utf8 = convert_path_heap(path); - if (!path_utf8) return 0; + if (!path_utf8) return nullptr; // convert mode to ASCII (we mirror _wfopen interface) char mode_ascii[4] = {0}; @@ -4919,7 +4919,7 @@ PUGI__NS_BEGIN name_null_sentry(xml_node_struct* node_): node(node_), name(node_->name) { - node->name = 0; + node->name = nullptr; } ~name_null_sentry() @@ -4942,11 +4942,11 @@ namespace pugi } #ifndef PUGIXML_NO_STL - PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream): narrow_stream(&stream), wide_stream(0) + PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream): narrow_stream(&stream), wide_stream(nullptr) { } - PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream): narrow_stream(0), wide_stream(&stream) + PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream): narrow_stream(nullptr), wide_stream(&stream) { } @@ -4972,8 +4972,7 @@ namespace pugi } PUGI__FN xml_tree_walker::~xml_tree_walker() - { - } + = default; PUGI__FN int xml_tree_walker::depth() const { @@ -4990,7 +4989,7 @@ namespace pugi return true; } - PUGI__FN xml_attribute::xml_attribute(): _attr(0) + PUGI__FN xml_attribute::xml_attribute(): _attr(nullptr) { } @@ -5004,7 +5003,7 @@ namespace pugi PUGI__FN xml_attribute::operator xml_attribute::unspecified_bool_type() const { - return _attr ? unspecified_bool_xml_attribute : 0; + return _attr ? unspecified_bool_xml_attribute : nullptr; } PUGI__FN bool xml_attribute::operator!() const @@ -5272,7 +5271,7 @@ namespace pugi } #endif - PUGI__FN xml_node::xml_node(): _root(0) + PUGI__FN xml_node::xml_node(): _root(nullptr) { } @@ -5286,7 +5285,7 @@ namespace pugi PUGI__FN xml_node::operator xml_node::unspecified_bool_type() const { - return _root ? unspecified_bool_xml_node : 0; + return _root ? unspecified_bool_xml_node : nullptr; } PUGI__FN bool xml_node::operator!() const @@ -5296,22 +5295,22 @@ namespace pugi PUGI__FN xml_node::iterator xml_node::begin() const { - return iterator(_root ? _root->first_child + 0 : 0, _root); + return iterator(_root ? _root->first_child + 0 : nullptr, _root); } PUGI__FN xml_node::iterator xml_node::end() const { - return iterator(0, _root); + return iterator(nullptr, _root); } PUGI__FN xml_node::attribute_iterator xml_node::attributes_begin() const { - return attribute_iterator(_root ? _root->first_attribute + 0 : 0, _root); + return attribute_iterator(_root ? _root->first_attribute + 0 : nullptr, _root); } PUGI__FN xml_node::attribute_iterator xml_node::attributes_end() const { - return attribute_iterator(0, _root); + return attribute_iterator(nullptr, _root); } PUGI__FN xml_object_range<xml_node_iterator> xml_node::children() const @@ -5321,7 +5320,7 @@ namespace pugi PUGI__FN xml_object_range<xml_named_node_iterator> xml_node::children(const char_t* name_) const { - return xml_object_range<xml_named_node_iterator>(xml_named_node_iterator(child(name_)._root, _root, name_), xml_named_node_iterator(0, _root, name_)); + return xml_object_range<xml_named_node_iterator>(xml_named_node_iterator(child(name_)._root, _root, name_), xml_named_node_iterator(nullptr, _root, name_)); } PUGI__FN xml_object_range<xml_attribute_iterator> xml_node::attributes() const @@ -5974,14 +5973,14 @@ namespace pugi doc->header |= impl::xml_memory_page_contents_shared_mask; // get extra buffer element (we'll store the document fragment buffer there so that we can deallocate it later) - impl::xml_memory_page* page = 0; + impl::xml_memory_page* page = nullptr; impl::xml_extra_buffer* extra = static_cast<impl::xml_extra_buffer*>(doc->allocate_memory(sizeof(impl::xml_extra_buffer), page)); (void)page; if (!extra) return impl::make_parse_result(status_out_of_memory); // add extra buffer to the list - extra->buffer = 0; + extra->buffer = nullptr; extra->next = doc->extra_buffers; doc->extra_buffers = extra; @@ -6244,7 +6243,7 @@ namespace pugi if (impl::is_text_node(node)) return node; - return 0; + return nullptr; } PUGI__FN xml_node_struct* xml_text::_data_new() @@ -6255,7 +6254,7 @@ namespace pugi return xml_node(_root).append_child(node_pcdata).internal_object(); } - PUGI__FN xml_text::xml_text(): _root(0) + PUGI__FN xml_text::xml_text(): _root(nullptr) { } @@ -6265,7 +6264,7 @@ namespace pugi PUGI__FN xml_text::operator xml_text::unspecified_bool_type() const { - return _data() ? unspecified_bool_xml_text : 0; + return _data() ? unspecified_bool_xml_text : nullptr; } PUGI__FN bool xml_text::operator!() const @@ -6275,7 +6274,7 @@ namespace pugi PUGI__FN bool xml_text::empty() const { - return _data() == 0; + return _data() == nullptr; } PUGI__FN const char_t* xml_text::get() const @@ -6495,8 +6494,7 @@ namespace pugi #endif PUGI__FN xml_node_iterator::xml_node_iterator() - { - } + = default; PUGI__FN xml_node_iterator::xml_node_iterator(const xml_node& node): _wrap(node), _parent(node.parent()) { @@ -6556,8 +6554,7 @@ namespace pugi } PUGI__FN xml_attribute_iterator::xml_attribute_iterator() - { - } + = default; PUGI__FN xml_attribute_iterator::xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent): _wrap(attr), _parent(parent) { @@ -6616,7 +6613,7 @@ namespace pugi return temp; } - PUGI__FN xml_named_node_iterator::xml_named_node_iterator(): _name(0) + PUGI__FN xml_named_node_iterator::xml_named_node_iterator(): _name(nullptr) { } @@ -6726,7 +6723,7 @@ namespace pugi } } - PUGI__FN xml_document::xml_document(): _buffer(0) + PUGI__FN xml_document::xml_document(): _buffer(nullptr) { create(); } @@ -6795,7 +6792,7 @@ namespace pugi if (_buffer) { impl::xml_memory::deallocate(_buffer); - _buffer = 0; + _buffer = nullptr; } // destroy extra buffers (note: no need to destroy linked list nodes, they're allocated using document allocator) @@ -6823,7 +6820,7 @@ namespace pugi static_cast<impl::xml_document_struct*>(_root)->hash.clear(); #endif - _root = 0; + _root = nullptr; } #ifndef PUGIXML_NO_STL @@ -7350,7 +7347,7 @@ PUGI__NS_BEGIN size_t block_size = block_capacity + offsetof(xpath_memory_block, data); xpath_memory_block* block = static_cast<xpath_memory_block*>(xml_memory::allocate(block_size)); - if (!block) return 0; + if (!block) return nullptr; block->next = _root; block->capacity = block_capacity; @@ -7386,7 +7383,7 @@ PUGI__NS_BEGIN new_size = (new_size + xpath_memory_block_alignment - 1) & ~(xpath_memory_block_alignment - 1); // we can only reallocate the last object - assert(ptr == 0 || static_cast<char*>(ptr) + old_size == &_root->data[0] + _root_size); + assert(ptr == nullptr || static_cast<char*>(ptr) + old_size == &_root->data[0] + _root_size); // adjust root size so that we have not allocated the object at all bool only_object = (_root_size == old_size); @@ -7493,7 +7490,7 @@ PUGI__NS_BEGIN xpath_stack_data(): result(blocks + 0), temp(blocks + 1) { - blocks[0].next = blocks[1].next = 0; + blocks[0].next = blocks[1].next = nullptr; blocks[0].capacity = blocks[1].capacity = sizeof(blocks[0].data); stack.result = &result; @@ -7579,7 +7576,7 @@ PUGI__NS_BEGIN size_t result_length = target_length + source_length; // allocate new buffer - char_t* result = static_cast<char_t*>(alloc->reallocate(_uses_heap ? const_cast<char_t*>(_buffer) : 0, (target_length + 1) * sizeof(char_t), (result_length + 1) * sizeof(char_t))); + char_t* result = static_cast<char_t*>(alloc->reallocate(_uses_heap ? const_cast<char_t*>(_buffer) : nullptr, (target_length + 1) * sizeof(char_t), (result_length + 1) * sizeof(char_t))); assert(result); // append first string to the new buffer in case there was no reallocation @@ -7820,7 +7817,7 @@ PUGI__NS_BEGIN if (node->value && (node->header & impl::xml_memory_page_value_allocated_or_shared_mask) == 0) return node->value; } - return 0; + return nullptr; } xml_attribute_struct* attr = xnode.attribute().internal_object(); @@ -7833,10 +7830,10 @@ PUGI__NS_BEGIN if ((attr->header & impl::xml_memory_page_value_allocated_or_shared_mask) == 0) return attr->value; } - return 0; + return nullptr; } - return 0; + return nullptr; } struct document_order_comparator @@ -7958,7 +7955,7 @@ PUGI__NS_BEGIN if (v == 0) return PUGIXML_TEXT("0"); if (v != v) return PUGIXML_TEXT("NaN"); if (v * 2 == v) return value > 0 ? PUGIXML_TEXT("Infinity") : PUGIXML_TEXT("-Infinity"); - return 0; + return nullptr; #endif } @@ -8127,7 +8124,7 @@ PUGI__NS_BEGIN #ifdef PUGIXML_WCHAR_MODE return wcstod(string, 0); #else - return strtod(string, 0); + return strtod(string, nullptr); #endif } @@ -8189,7 +8186,7 @@ PUGI__NS_BEGIN { const char_t* pos = find_char(name, ':'); - prefix = pos ? name : 0; + prefix = pos ? name : nullptr; prefix_length = pos ? static_cast<size_t>(pos - name) : 0; } @@ -8307,7 +8304,7 @@ PUGI__NS_BEGIN unsigned int tc = static_cast<unsigned int>(*to); if (fc >= 128 || tc >= 128) - return 0; + return nullptr; // code=128 means "skip character" if (!table[fc]) @@ -8388,7 +8385,7 @@ PUGI__NS_BEGIN struct xpath_variable_string: xpath_variable { - xpath_variable_string(): xpath_variable(xpath_type_string), value(0) + xpath_variable_string(): xpath_variable(xpath_type_string), value(nullptr) { } @@ -8435,11 +8432,11 @@ PUGI__NS_BEGIN template <typename T> PUGI__FN T* new_xpath_variable(const char_t* name) { size_t length = strlength(name); - if (length == 0) return 0; // empty variable names are invalid + if (length == 0) return nullptr; // empty variable names are invalid // $$ we can't use offsetof(T, name) because T is non-POD, so we just allocate additional length characters void* memory = xml_memory::allocate(sizeof(T) + length * sizeof(char_t)); - if (!memory) return 0; + if (!memory) return nullptr; T* result = new (memory) T(); @@ -8465,7 +8462,7 @@ PUGI__NS_BEGIN return new_xpath_variable<xpath_variable_boolean>(name); default: - return 0; + return nullptr; } } @@ -8618,7 +8615,7 @@ PUGI__NS_BEGIN xpath_node* _eos; public: - xpath_node_set_raw(): _type(xpath_node_set::type_unsorted), _begin(0), _end(0), _eos(0) + xpath_node_set_raw(): _type(xpath_node_set::type_unsorted), _begin(nullptr), _end(nullptr), _eos(nullptr) { } @@ -8780,7 +8777,7 @@ PUGI__NS_BEGIN const char_t* begin; const char_t* end; - xpath_lexer_string(): begin(0), end(0) + xpath_lexer_string(): begin(nullptr), end(nullptr) { } @@ -9247,8 +9244,8 @@ PUGI__NS_BEGIN const unsigned char* table; } _data; - xpath_ast_node(const xpath_ast_node&); - xpath_ast_node& operator=(const xpath_ast_node&); + xpath_ast_node(const xpath_ast_node&) = delete; + xpath_ast_node& operator=(const xpath_ast_node&) = delete; template <class Comp> static bool compare_eq(xpath_ast_node* lhs, xpath_ast_node* rhs, const xpath_context& c, const xpath_stack& stack, const Comp& comp) { @@ -9966,40 +9963,40 @@ PUGI__NS_BEGIN public: xpath_ast_node(ast_type_t type, xpath_value_type rettype_, const char_t* value): - _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(0), _right(0), _next(0) + _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(nullptr), _right(nullptr), _next(nullptr) { assert(type == ast_string_constant); _data.string = value; } xpath_ast_node(ast_type_t type, xpath_value_type rettype_, double value): - _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(0), _right(0), _next(0) + _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(nullptr), _right(nullptr), _next(nullptr) { assert(type == ast_number_constant); _data.number = value; } xpath_ast_node(ast_type_t type, xpath_value_type rettype_, xpath_variable* value): - _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(0), _right(0), _next(0) + _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(nullptr), _right(nullptr), _next(nullptr) { assert(type == ast_variable); _data.variable = value; } - xpath_ast_node(ast_type_t type, xpath_value_type rettype_, xpath_ast_node* left = 0, xpath_ast_node* right = 0): - _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(left), _right(right), _next(0) + xpath_ast_node(ast_type_t type, xpath_value_type rettype_, xpath_ast_node* left = nullptr, xpath_ast_node* right = nullptr): + _type(static_cast<char>(type)), _rettype(static_cast<char>(rettype_)), _axis(0), _test(0), _left(left), _right(right), _next(nullptr) { } xpath_ast_node(ast_type_t type, xpath_ast_node* left, axis_t axis, nodetest_t test, const char_t* contents): - _type(static_cast<char>(type)), _rettype(xpath_type_node_set), _axis(static_cast<char>(axis)), _test(static_cast<char>(test)), _left(left), _right(0), _next(0) + _type(static_cast<char>(type)), _rettype(xpath_type_node_set), _axis(static_cast<char>(axis)), _test(static_cast<char>(test)), _left(left), _right(nullptr), _next(nullptr) { assert(type == ast_step); _data.nodetest = contents; } xpath_ast_node(ast_type_t type, xpath_ast_node* left, xpath_ast_node* right, predicate_t test): - _type(static_cast<char>(type)), _rettype(xpath_type_node_set), _axis(0), _test(static_cast<char>(test)), _left(left), _right(right), _next(0) + _type(static_cast<char>(type)), _rettype(xpath_type_node_set), _axis(0), _test(static_cast<char>(test)), _left(left), _right(right), _next(nullptr) { assert(type == ast_filter || type == ast_predicate); } @@ -10059,7 +10056,7 @@ PUGI__NS_BEGIN xpath_string lr = _left->eval_string(c, stack); xpath_string rr = _right->eval_string(c, stack); - return find_substring(lr.c_str(), rr.c_str()) != 0; + return find_substring(lr.c_str(), rr.c_str()) != nullptr; } case ast_func_boolean: @@ -10881,7 +10878,7 @@ PUGI__NS_BEGIN return c; } - else return 0; + else return nullptr; } xpath_ast_node* parse_function_helper(ast_type_t type0, ast_type_t type1, size_t argc, xpath_ast_node* args[2]) @@ -11003,7 +11000,7 @@ PUGI__NS_BEGIN throw_error("Unrecognized function or wrong parameter count"); - return 0; + return nullptr; } axis_t parse_axis_name(const xpath_lexer_string& name, bool& specified) @@ -11121,7 +11118,7 @@ PUGI__NS_BEGIN if (!_variables) throw_error("Unknown variable: variable set is not provided"); - xpath_variable* var = 0; + xpath_variable* var = nullptr; if (!get_variable_scratch(_scratch, _variables, name.begin, name.end, &var)) throw_error_oom(); @@ -11172,13 +11169,13 @@ PUGI__NS_BEGIN case lex_string: { - xpath_ast_node* args[2] = {0}; + xpath_ast_node* args[2] = {nullptr}; size_t argc = 0; xpath_lexer_string function = _lexer.contents(); _lexer.next(); - xpath_ast_node* last_arg = 0; + xpath_ast_node* last_arg = nullptr; if (_lexer.current() != lex_open_brace) throw_error("Unrecognized function call"); @@ -11210,7 +11207,7 @@ PUGI__NS_BEGIN default: throw_error("Unrecognizable primary expression"); - return 0; + return nullptr; } } @@ -11264,13 +11261,13 @@ PUGI__NS_BEGIN { _lexer.next(); - return new (alloc_node()) xpath_ast_node(ast_step, set, axis_self, nodetest_type_node, 0); + return new (alloc_node()) xpath_ast_node(ast_step, set, axis_self, nodetest_type_node, nullptr); } else if (_lexer.current() == lex_double_dot) { _lexer.next(); - return new (alloc_node()) xpath_ast_node(ast_step, set, axis_parent, nodetest_type_node, 0); + return new (alloc_node()) xpath_ast_node(ast_step, set, axis_parent, nodetest_type_node, nullptr); } nodetest_t nt_type = nodetest_none; @@ -11365,7 +11362,7 @@ PUGI__NS_BEGIN xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step, set, axis, nt_type, alloc_string(nt_name)); - xpath_ast_node* last = 0; + xpath_ast_node* last = nullptr; while (_lexer.current() == lex_open_square_brace) { @@ -11373,7 +11370,7 @@ PUGI__NS_BEGIN xpath_ast_node* expr = parse_expression(); - xpath_ast_node* pred = new (alloc_node()) xpath_ast_node(ast_predicate, 0, expr, predicate_default); + xpath_ast_node* pred = new (alloc_node()) xpath_ast_node(ast_predicate, nullptr, expr, predicate_default); if (_lexer.current() != lex_close_square_brace) throw_error("Unmatched square brace"); @@ -11399,7 +11396,7 @@ PUGI__NS_BEGIN _lexer.next(); if (l == lex_double_slash) - n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); + n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, nullptr); n = parse_step(n); } @@ -11430,13 +11427,13 @@ PUGI__NS_BEGIN _lexer.next(); xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step_root, xpath_type_node_set); - n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); + n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, nullptr); return parse_relative_location_path(n); } // else clause moved outside of if because of bogus warning 'control may reach end of non-void function being inlined' in gcc 4.0.1 - return parse_relative_location_path(0); + return parse_relative_location_path(nullptr); } // PathExpr ::= LocationPath @@ -11482,7 +11479,7 @@ PUGI__NS_BEGIN { if (n->rettype() != xpath_type_node_set) throw_error("Step has to be applied to node set"); - n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); + n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, nullptr); } // select from location path @@ -11659,7 +11656,7 @@ PUGI__NS_BEGIN static xpath_query_impl* create() { void* memory = xml_memory::allocate(sizeof(xpath_query_impl)); - if (!memory) return 0; + if (!memory) return nullptr; return new (memory) xpath_query_impl(); } @@ -11673,9 +11670,9 @@ PUGI__NS_BEGIN xml_memory::deallocate(impl); } - xpath_query_impl(): root(0), alloc(&block) + xpath_query_impl(): root(nullptr), alloc(&block) { - block.next = 0; + block.next = nullptr; block.capacity = sizeof(block.data); } @@ -11699,7 +11696,7 @@ PUGI__NS_BEGIN PUGI__FN impl::xpath_ast_node* evaluate_node_set_prepare(xpath_query_impl* impl) { - if (!impl) return 0; + if (!impl) return nullptr; if (impl->root->rettype() != xpath_type_node_set) { @@ -11737,8 +11734,7 @@ namespace pugi #endif PUGI__FN xpath_node::xpath_node() - { - } + = default; PUGI__FN xpath_node::xpath_node(const xml_node& node_): _node(node_) { @@ -11769,7 +11765,7 @@ namespace pugi PUGI__FN xpath_node::operator xpath_node::unspecified_bool_type() const { - return (_node || _attribute) ? unspecified_bool_xpath_node : 0; + return (_node || _attribute) ? unspecified_bool_xpath_node : nullptr; } PUGI__FN bool xpath_node::operator!() const @@ -11952,7 +11948,7 @@ namespace pugi PUGI__FN xpath_parse_result::operator bool() const { - return error == 0; + return error == nullptr; } PUGI__FN const char* xpath_parse_result::description() const @@ -11960,7 +11956,7 @@ namespace pugi return error ? error : "No error"; } - PUGI__FN xpath_variable::xpath_variable(xpath_value_type type_): _type(type_), _next(0) + PUGI__FN xpath_variable::xpath_variable(xpath_value_type type_): _type(type_), _next(nullptr) { } @@ -11982,7 +11978,7 @@ namespace pugi default: assert(false && "Invalid variable type"); - return 0; + return nullptr; } } @@ -12003,7 +11999,7 @@ namespace pugi PUGI__FN const char_t* xpath_variable::get_string() const { - const char_t* value = (_type == xpath_type_string) ? static_cast<const impl::xpath_variable_string*>(this)->value : 0; + const char_t* value = (_type == xpath_type_string) ? static_cast<const impl::xpath_variable_string*>(this)->value : nullptr; return value ? value : PUGIXML_TEXT(""); } @@ -12060,7 +12056,7 @@ namespace pugi PUGI__FN xpath_variable_set::xpath_variable_set() { for (auto & i : _data) - i = 0; + i = nullptr; } PUGI__FN xpath_variable_set::~xpath_variable_set() @@ -12072,7 +12068,7 @@ namespace pugi PUGI__FN xpath_variable_set::xpath_variable_set(const xpath_variable_set& rhs) { for (auto & i : _data) - i = 0; + i = nullptr; _assign(rhs); } @@ -12092,7 +12088,7 @@ namespace pugi for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i) { _data[i] = rhs._data[i]; - rhs._data[i] = 0; + rhs._data[i] = nullptr; } } @@ -12103,7 +12099,7 @@ namespace pugi _destroy(_data[i]); _data[i] = rhs._data[i]; - rhs._data[i] = 0; + rhs._data[i] = nullptr; } return *this; @@ -12142,12 +12138,12 @@ namespace pugi if (impl::strequal(var->name(), name)) return var; - return 0; + return nullptr; } PUGI__FN bool xpath_variable_set::_clone(xpath_variable* var, xpath_variable** out_result) { - xpath_variable* last = 0; + xpath_variable* last = nullptr; while (var) { @@ -12192,7 +12188,7 @@ namespace pugi // look for existing variable for (xpath_variable* var = _data[hash]; var; var = var->_next) if (impl::strequal(var->name(), name)) - return var->type() == type ? var : 0; + return var->type() == type ? var : nullptr; // add new variable xpath_variable* result = impl::new_xpath_variable(type, name); @@ -12241,7 +12237,7 @@ namespace pugi return _find(name); } - PUGI__FN xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables): _impl(0) + PUGI__FN xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables): _impl(nullptr) { impl::xpath_query_impl* qimpl = impl::xpath_query_impl::create(); @@ -12265,12 +12261,12 @@ namespace pugi qimpl->root->optimize(&qimpl->alloc); _impl = impl.release(); - _result.error = 0; + _result.error = nullptr; } } } - PUGI__FN xpath_query::xpath_query(): _impl(0) + PUGI__FN xpath_query::xpath_query(): _impl(nullptr) { } @@ -12285,7 +12281,7 @@ namespace pugi { _impl = rhs._impl; _result = rhs._result; - rhs._impl = 0; + rhs._impl = nullptr; rhs._result = xpath_parse_result(); } @@ -12298,7 +12294,7 @@ namespace pugi _impl = rhs._impl; _result = rhs._result; - rhs._impl = 0; + rhs._impl = nullptr; rhs._result = xpath_parse_result(); return *this; @@ -12416,7 +12412,7 @@ namespace pugi PUGI__FN xpath_query::operator xpath_query::unspecified_bool_type() const { - return _impl ? unspecified_bool_xpath_query : 0; + return _impl ? unspecified_bool_xpath_query : nullptr; } PUGI__FN bool xpath_query::operator!() const diff --git a/VirtualRobot/Import/SimoxCOLLADAFactory.cpp b/VirtualRobot/Import/SimoxCOLLADAFactory.cpp index 83b541557df9d08d06886fcb8c8ec3b8ac0fb5d0..49329820e2effae86c54e264bfd8104c72cf7c86 100644 --- a/VirtualRobot/Import/SimoxCOLLADAFactory.cpp +++ b/VirtualRobot/Import/SimoxCOLLADAFactory.cpp @@ -8,13 +8,11 @@ namespace VirtualRobot { SimoxCOLLADAFactory::SimoxCOLLADAFactory() - { - } + = default; SimoxCOLLADAFactory::~SimoxCOLLADAFactory() - { - } + = default; RobotPtr SimoxCOLLADAFactory::loadFromFile(const std::string& filename, RobotIO::RobotDescription /*loadMode*/) diff --git a/VirtualRobot/Import/SimoxXMLFactory.cpp b/VirtualRobot/Import/SimoxXMLFactory.cpp index e70a8fca71a15e5db1bd6faf6971f2ff62f6019c..15028dfb933c6e3256e4c60153048ad0cfbb055b 100644 --- a/VirtualRobot/Import/SimoxXMLFactory.cpp +++ b/VirtualRobot/Import/SimoxXMLFactory.cpp @@ -9,13 +9,11 @@ namespace VirtualRobot { SimoxXMLFactory::SimoxXMLFactory() - { - } + = default; SimoxXMLFactory::~SimoxXMLFactory() - { - } + = default; RobotPtr SimoxXMLFactory::loadFromFile(const std::string& filename, RobotIO::RobotDescription loadMode) diff --git a/VirtualRobot/KinematicChain.cpp b/VirtualRobot/KinematicChain.cpp index 01004f559b4dfa3e6b0ddde1ef202609d89d3d17..c933d7516b14eeb077d18b598d60c636b8836261 100644 --- a/VirtualRobot/KinematicChain.cpp +++ b/VirtualRobot/KinematicChain.cpp @@ -45,9 +45,7 @@ namespace VirtualRobot KinematicChain::~KinematicChain() - { - - } + = default; diff --git a/VirtualRobot/LinkedCoordinate.cpp b/VirtualRobot/LinkedCoordinate.cpp index e0e1082a58007da18ed805c9e306b7f6cbb9bdfa..7e66fb4d56808544c75a891c079536bc37860f78 100644 --- a/VirtualRobot/LinkedCoordinate.cpp +++ b/VirtualRobot/LinkedCoordinate.cpp @@ -16,12 +16,7 @@ LinkedCoordinate::LinkedCoordinate(const LinkedCoordinate& other) } LinkedCoordinate& LinkedCoordinate::operator=(const LinkedCoordinate& other) -{ - robot = other.robot; - pose = other.pose; - frame = other.frame; - return *this; -} += default; LinkedCoordinate::~LinkedCoordinate() { diff --git a/VirtualRobot/ManipulationObject.cpp b/VirtualRobot/ManipulationObject.cpp index dc25836f055f8dd54c2b5e1cdf31d731c300c260..813efeb31923353499e0bdb999ac4158edf6bcf3 100644 --- a/VirtualRobot/ManipulationObject.cpp +++ b/VirtualRobot/ManipulationObject.cpp @@ -14,8 +14,7 @@ namespace VirtualRobot } ManipulationObject::~ManipulationObject() - { - } + = default; void ManipulationObject::print(bool printDecoration) { diff --git a/VirtualRobot/Nodes/CameraSensor.cpp b/VirtualRobot/Nodes/CameraSensor.cpp index 530cc5a4eaf090b48fd634763d29245d765e8bce..5f8a6f1038d20422c303165bb8dc5581b183f386 100644 --- a/VirtualRobot/Nodes/CameraSensor.cpp +++ b/VirtualRobot/Nodes/CameraSensor.cpp @@ -18,8 +18,7 @@ namespace VirtualRobot CameraSensor::~CameraSensor() - { - } + = default; diff --git a/VirtualRobot/Nodes/CameraSensorFactory.cpp b/VirtualRobot/Nodes/CameraSensorFactory.cpp index 265250e0020f6cfc0afaf77bf8029158c1a2acc1..a667d1e2e718876251b80b6d580375faf36cfd55 100644 --- a/VirtualRobot/Nodes/CameraSensorFactory.cpp +++ b/VirtualRobot/Nodes/CameraSensorFactory.cpp @@ -11,13 +11,11 @@ namespace VirtualRobot { CameraSensorFactory::CameraSensorFactory() - { - } + = default; CameraSensorFactory::~CameraSensorFactory() - { - } + = default; /** diff --git a/VirtualRobot/Nodes/ContactSensor.cpp b/VirtualRobot/Nodes/ContactSensor.cpp index 98d3873bcfdc06543ffe5a47ef6a673dd42a46a5..5f78e2ab576bb22c72da12b95e73622d73a9f31e 100644 --- a/VirtualRobot/Nodes/ContactSensor.cpp +++ b/VirtualRobot/Nodes/ContactSensor.cpp @@ -17,8 +17,7 @@ namespace VirtualRobot ContactSensor::~ContactSensor() - { - } + = default; void ContactSensor::print(bool printChildren, bool printDecoration) const { diff --git a/VirtualRobot/Nodes/ContactSensorFactory.cpp b/VirtualRobot/Nodes/ContactSensorFactory.cpp index 2af149f3fe0e52568ed06826920f5fab4326556f..1b1fac58d67ca595f92e16c7fa5150de57ff9b25 100644 --- a/VirtualRobot/Nodes/ContactSensorFactory.cpp +++ b/VirtualRobot/Nodes/ContactSensorFactory.cpp @@ -11,13 +11,11 @@ namespace VirtualRobot { ContactSensorFactory::ContactSensorFactory() - { - } + = default; ContactSensorFactory::~ContactSensorFactory() - { - } + = default; /** diff --git a/VirtualRobot/Nodes/ForceTorqueSensor.cpp b/VirtualRobot/Nodes/ForceTorqueSensor.cpp index 6785283a5990a3a782db1664ea302c6d4debba3c..67d1be48e9e2dbca10986aad8f81674caf790b7d 100644 --- a/VirtualRobot/Nodes/ForceTorqueSensor.cpp +++ b/VirtualRobot/Nodes/ForceTorqueSensor.cpp @@ -19,8 +19,7 @@ namespace VirtualRobot ForceTorqueSensor::~ForceTorqueSensor() - { - } + = default; Eigen::Vector3f ForceTorqueSensor::getForce() const { diff --git a/VirtualRobot/Nodes/ForceTorqueSensorFactory.cpp b/VirtualRobot/Nodes/ForceTorqueSensorFactory.cpp index d1aba5324ae6c87122dce67daa5dcf0855224a4f..4958aed4b1fff7a27b8173886c9e9cafbfca95fc 100644 --- a/VirtualRobot/Nodes/ForceTorqueSensorFactory.cpp +++ b/VirtualRobot/Nodes/ForceTorqueSensorFactory.cpp @@ -11,13 +11,11 @@ namespace VirtualRobot { ForceTorqueSensorFactory::ForceTorqueSensorFactory() - { - } + = default; ForceTorqueSensorFactory::~ForceTorqueSensorFactory() - { - } + = default; /** diff --git a/VirtualRobot/Nodes/PositionSensor.cpp b/VirtualRobot/Nodes/PositionSensor.cpp index cdf4d044fd6099643968e92cd5a87e2494489a17..136581a49e129a32e0e635c8eac359d189469866 100644 --- a/VirtualRobot/Nodes/PositionSensor.cpp +++ b/VirtualRobot/Nodes/PositionSensor.cpp @@ -19,8 +19,7 @@ namespace VirtualRobot PositionSensor::~PositionSensor() - { - } + = default; diff --git a/VirtualRobot/Nodes/PositionSensorFactory.cpp b/VirtualRobot/Nodes/PositionSensorFactory.cpp index 3f908106cb128efd03bbeb94e71bd51c20274ca0..532bb418bbcbe99641231100ea6bbb28a4c5a065 100644 --- a/VirtualRobot/Nodes/PositionSensorFactory.cpp +++ b/VirtualRobot/Nodes/PositionSensorFactory.cpp @@ -11,13 +11,11 @@ namespace VirtualRobot { PositionSensorFactory::PositionSensorFactory() - { - } + = default; PositionSensorFactory::~PositionSensorFactory() - { - } + = default; /** diff --git a/VirtualRobot/Nodes/RobotNodeActuator.cpp b/VirtualRobot/Nodes/RobotNodeActuator.cpp index 4f10f65ef88546b8cee84a3b8bc0fa2d6601e6d4..8276bf130e88043551cbf95028642c77d72edad8 100644 --- a/VirtualRobot/Nodes/RobotNodeActuator.cpp +++ b/VirtualRobot/Nodes/RobotNodeActuator.cpp @@ -11,8 +11,7 @@ namespace VirtualRobot } RobotNodeActuator::~RobotNodeActuator() - { - } + = default; void RobotNodeActuator::updateVisualizationPose(const Eigen::Matrix4f& pose, bool updateChildren) { diff --git a/VirtualRobot/Nodes/RobotNodeFixed.cpp b/VirtualRobot/Nodes/RobotNodeFixed.cpp index 513726f9b6ab6f90559e33878112ec7aaa9a953f..b7306251f0756553b32b292835acd02684518ea2 100644 --- a/VirtualRobot/Nodes/RobotNodeFixed.cpp +++ b/VirtualRobot/Nodes/RobotNodeFixed.cpp @@ -63,8 +63,7 @@ namespace VirtualRobot } RobotNodeFixed::~RobotNodeFixed() - { - } + = default; bool RobotNodeFixed::initialize(SceneObjectPtr parent, const std::vector<SceneObjectPtr>& children) { diff --git a/VirtualRobot/Nodes/RobotNodeFixedFactory.cpp b/VirtualRobot/Nodes/RobotNodeFixedFactory.cpp index 7f996c28f1a0609ed2ce8a70b2dc1f40211a80e2..f6cef81580920d66abaffada7410c3434ba78a28 100644 --- a/VirtualRobot/Nodes/RobotNodeFixedFactory.cpp +++ b/VirtualRobot/Nodes/RobotNodeFixedFactory.cpp @@ -13,13 +13,11 @@ namespace VirtualRobot { RobotNodeFixedFactory::RobotNodeFixedFactory() - { - } + = default; RobotNodeFixedFactory::~RobotNodeFixedFactory() - { - } + = default; /** * This method creates a VirtualRobot::RobotNodeFixed. diff --git a/VirtualRobot/Nodes/RobotNodePrismatic.cpp b/VirtualRobot/Nodes/RobotNodePrismatic.cpp index 5e26ae82b3755ce992f6970135b9bcdc17f7d731..b5b86fda3aa7cde71bf22f819b910c38707ce751 100644 --- a/VirtualRobot/Nodes/RobotNodePrismatic.cpp +++ b/VirtualRobot/Nodes/RobotNodePrismatic.cpp @@ -77,8 +77,7 @@ namespace VirtualRobot } RobotNodePrismatic::~RobotNodePrismatic() - { - } + = default; bool RobotNodePrismatic::initialize(SceneObjectPtr parent, const std::vector<SceneObjectPtr>& children) diff --git a/VirtualRobot/Nodes/RobotNodePrismaticFactory.cpp b/VirtualRobot/Nodes/RobotNodePrismaticFactory.cpp index 49907e65184b5f4f880cab7adbb5dc8ac9b9cbcd..4bb87ebdccb2c39e974d142d85716db8096e124a 100644 --- a/VirtualRobot/Nodes/RobotNodePrismaticFactory.cpp +++ b/VirtualRobot/Nodes/RobotNodePrismaticFactory.cpp @@ -13,13 +13,11 @@ namespace VirtualRobot { RobotNodePrismaticFactory::RobotNodePrismaticFactory() - { - } + = default; RobotNodePrismaticFactory::~RobotNodePrismaticFactory() - { - } + = default; /** diff --git a/VirtualRobot/Nodes/RobotNodeRevolute.cpp b/VirtualRobot/Nodes/RobotNodeRevolute.cpp index ba8e6c7715b629dcd17b1ab7635b2c559d1f168b..4547b8475ebc0be7a0073e40a609dc3ffa3484cd 100644 --- a/VirtualRobot/Nodes/RobotNodeRevolute.cpp +++ b/VirtualRobot/Nodes/RobotNodeRevolute.cpp @@ -79,8 +79,7 @@ namespace VirtualRobot RobotNodeRevolute::~RobotNodeRevolute() - { - } + = default; bool RobotNodeRevolute::initialize(SceneObjectPtr parent, const std::vector<SceneObjectPtr>& children) { diff --git a/VirtualRobot/Nodes/RobotNodeRevoluteFactory.cpp b/VirtualRobot/Nodes/RobotNodeRevoluteFactory.cpp index bba865f1431b4ac9bea8163190d9ee1d80aa64f6..40e79deda46c94fa0cd3e7bda1f04e511379562c 100644 --- a/VirtualRobot/Nodes/RobotNodeRevoluteFactory.cpp +++ b/VirtualRobot/Nodes/RobotNodeRevoluteFactory.cpp @@ -13,13 +13,11 @@ namespace VirtualRobot { RobotNodeRevoluteFactory::RobotNodeRevoluteFactory() - { - } + = default; RobotNodeRevoluteFactory::~RobotNodeRevoluteFactory() - { - } + = default; /** diff --git a/VirtualRobot/Nodes/Sensor.cpp b/VirtualRobot/Nodes/Sensor.cpp index 9bb817af10d94d271cc3f9ef224bb735f41e2354..5dd29e474b7cabb222666602e811faa54d600a58 100644 --- a/VirtualRobot/Nodes/Sensor.cpp +++ b/VirtualRobot/Nodes/Sensor.cpp @@ -25,8 +25,7 @@ namespace VirtualRobot Sensor::~Sensor() - { - } + = default; bool Sensor::initialize(SceneObjectPtr parent, const std::vector<SceneObjectPtr>& children) diff --git a/VirtualRobot/Obstacle.cpp b/VirtualRobot/Obstacle.cpp index 6df92ebece934a395fbe63e502f4bce1dd7a06cb..94dbaea9fbf0347313c217de0c5ebf83559ea891 100644 --- a/VirtualRobot/Obstacle.cpp +++ b/VirtualRobot/Obstacle.cpp @@ -41,8 +41,7 @@ namespace VirtualRobot } Obstacle::~Obstacle() - { - } + = default; int Obstacle::getID() { diff --git a/VirtualRobot/Robot.cpp b/VirtualRobot/Robot.cpp index 2ff32e7afa2f9fd00c62fefdf01f1edcfa5f78bf..6775ce8da804b26a450098a908b05d4a8eca8d6c 100644 --- a/VirtualRobot/Robot.cpp +++ b/VirtualRobot/Robot.cpp @@ -20,12 +20,10 @@ namespace VirtualRobot } Robot::Robot() - { - } + = default; Robot::~Robot() - { - } + = default; LocalRobot::~LocalRobot() { @@ -611,7 +609,7 @@ namespace VirtualRobot while (robotNodes.end() != iterator) { - (*iterator)->showCoordinateSystem(enable, 1.0f, NULL, type); + (*iterator)->showCoordinateSystem(enable, 1.0f, nullptr, type); ++iterator; } } diff --git a/VirtualRobot/RobotFactory.cpp b/VirtualRobot/RobotFactory.cpp index 6ad59db47cfc89a1753c173651e4a6be0658abf5..00c2270b613d9d42fa89e3e27a278915d8d33894 100644 --- a/VirtualRobot/RobotFactory.cpp +++ b/VirtualRobot/RobotFactory.cpp @@ -20,12 +20,10 @@ namespace VirtualRobot RobotFactory::RobotFactory() - { - } + = default; RobotFactory::~RobotFactory() - { - } + = default; RobotPtr RobotFactory::createRobot(const std::string& name, const std::string& type) @@ -305,7 +303,7 @@ namespace VirtualRobot c = o->getCollisionModel(); } - auto rnf = RobotNodeFixedFactory::createInstance(NULL); + auto rnf = RobotNodeFixedFactory::createInstance(nullptr); RobotNodePtr newRN = rnf->createRobotNode(robot, name, v, c, 0, 0, 0, transformation, Eigen::Vector3f::Zero(), Eigen::Vector3f::Zero(), p); rn->attachChild(newRN); newRN->initialize(rn); @@ -644,7 +642,7 @@ namespace VirtualRobot { THROW_VR_EXCEPTION_IF(!robot, "NULL data"); THROW_VR_EXCEPTION_IF(!nodeA, "NULL data"); - auto rnf = RobotNodeFixedFactory::createInstance(NULL); + auto rnf = RobotNodeFixedFactory::createInstance(nullptr); SceneObject::Physics p; VisualizationNodePtr v; CollisionModelPtr c; @@ -684,7 +682,7 @@ namespace VirtualRobot { THROW_VR_EXCEPTION_IF(!robot, "NULL data"); - auto rnf = RobotNodeFixedFactory::createInstance(NULL); + auto rnf = RobotNodeFixedFactory::createInstance(nullptr); SceneObject::Physics p; VisualizationNodePtr v; CollisionModelPtr c; diff --git a/VirtualRobot/RobotNodeSet.cpp b/VirtualRobot/RobotNodeSet.cpp index dd0384187bc013213d06476a1a4669f002c4d2c8..38cc155eca8bdaff7133ca297b4826dd770a2f8a 100644 --- a/VirtualRobot/RobotNodeSet.cpp +++ b/VirtualRobot/RobotNodeSet.cpp @@ -86,7 +86,7 @@ namespace VirtualRobot const std::string& tcpName, bool registerToRobot) { - VR_ASSERT(robot != NULL); + VR_ASSERT(robot != nullptr); std::vector< RobotNodePtr > robotNodes; if (robotNodeNames.empty()) @@ -147,7 +147,7 @@ namespace VirtualRobot const RobotNodePtr tcp, bool registerToRobot) { - VR_ASSERT(robot != NULL); + VR_ASSERT(robot != nullptr); if (robotNodes.empty() || !robotNodes[0]) { diff --git a/VirtualRobot/TimeOptimalTrajectory/TimeOptimalTrajectory.cpp b/VirtualRobot/TimeOptimalTrajectory/TimeOptimalTrajectory.cpp index 4e595bf1924a2df451159bb46783d7ff0204210b..bfbd33daa8691eb7bf731c786faa1d9869047bbe 100644 --- a/VirtualRobot/TimeOptimalTrajectory/TimeOptimalTrajectory.cpp +++ b/VirtualRobot/TimeOptimalTrajectory/TimeOptimalTrajectory.cpp @@ -91,8 +91,7 @@ namespace VirtualRobot } } - TimeOptimalTrajectory::~TimeOptimalTrajectory() { - } + TimeOptimalTrajectory::~TimeOptimalTrajectory() = default; void TimeOptimalTrajectory::outputPhasePlaneTrajectory() const { ofstream file1("maxVelocity.txt"); diff --git a/VirtualRobot/Tools/Gravity.cpp b/VirtualRobot/Tools/Gravity.cpp index b6c8d44fface6ffee21eb5500d4ab9beac4356c4..8bd7663285d3baf0e00a5fb6f356b2100b09893e 100644 --- a/VirtualRobot/Tools/Gravity.cpp +++ b/VirtualRobot/Tools/Gravity.cpp @@ -41,8 +41,7 @@ Gravity::Gravity(VirtualRobot::RobotPtr robot, VirtualRobot::RobotNodeSetPtr rns } Gravity::~Gravity() -{ -} += default; @@ -107,12 +106,7 @@ std::map<std::string, float> Gravity::computeGravityTorque() } Gravity::GravityData::GravityData() -{ - - - - -} += default; Gravity::GravityDataPtr Gravity::GravityData::create(SceneObjectPtr node, const std::vector<RobotNodePtr> &joints, const std::vector<RobotNodePtr> &bodies, std::vector<Gravity::GravityDataPtr> &dataVec) { diff --git a/VirtualRobot/Trajectory.cpp b/VirtualRobot/Trajectory.cpp index ff632f9ecaeeb5640063d16b49d5887d0b373418..976896e517af646bc6679796e109312effb181b0 100644 --- a/VirtualRobot/Trajectory.cpp +++ b/VirtualRobot/Trajectory.cpp @@ -252,7 +252,7 @@ namespace VirtualRobot { storePathPos = getPoint(0); - if (storeIndex != NULL) + if (storeIndex != nullptr) { *storeIndex = 0; } @@ -263,7 +263,7 @@ namespace VirtualRobot { storePathPos = getPoint(getNrOfPoints() - 1); - if (storeIndex != NULL) + if (storeIndex != nullptr) { *storeIndex = (int)path.size() - 1; } @@ -312,7 +312,7 @@ namespace VirtualRobot storePathPos = c1 + (c2 - c1) * factor; // storePos = startPos + factor*segment - if (storeIndex != NULL) + if (storeIndex != nullptr) { *storeIndex = startIndex; } diff --git a/VirtualRobot/Util/xml/tinyxml2.cpp b/VirtualRobot/Util/xml/tinyxml2.cpp index 8fff487289802cddc4924c9f6973cdb72c0924bb..69760a4909a539eca5da6ff4aba54c6a21508885 100644 --- a/VirtualRobot/Util/xml/tinyxml2.cpp +++ b/VirtualRobot/Util/xml/tinyxml2.cpp @@ -93,7 +93,7 @@ distribution. #define TIXML_VSNPRINTF vsnprintf static inline int TIXML_VSCPRINTF( const char* format, va_list va ) { - int len = vsnprintf( 0, 0, format, va ); + int len = vsnprintf( nullptr, 0, format, va ); TIXMLASSERT( len >= 0 ); return len; } @@ -149,10 +149,10 @@ void StrPair::TransferTo( StrPair* other ) // This in effect implements the assignment operator by "moving" // ownership (as in auto_ptr). - TIXMLASSERT( other != 0 ); + TIXMLASSERT( other != nullptr ); TIXMLASSERT( other->_flags == 0 ); - TIXMLASSERT( other->_start == 0 ); - TIXMLASSERT( other->_end == 0 ); + TIXMLASSERT( other->_start == nullptr ); + TIXMLASSERT( other->_end == nullptr ); other->Reset(); @@ -161,8 +161,8 @@ void StrPair::TransferTo( StrPair* other ) other->_end = _end; _flags = 0; - _start = 0; - _end = 0; + _start = nullptr; + _end = nullptr; } @@ -172,8 +172,8 @@ void StrPair::Reset() delete [] _start; } _flags = 0; - _start = 0; - _end = 0; + _start = nullptr; + _end = nullptr; } @@ -182,7 +182,7 @@ void StrPair::SetStr( const char* str, int flags ) TIXMLASSERT( str ); Reset(); size_t len = strlen( str ); - TIXMLASSERT( _start == 0 ); + TIXMLASSERT( _start == nullptr ); _start = new char[ len+1 ]; memcpy( _start, str, len+1 ); _end = _start + len; @@ -211,17 +211,17 @@ char* StrPair::ParseText( char* p, const char* endTag, int strFlags, int* curLin ++p; TIXMLASSERT( p ); } - return 0; + return nullptr; } char* StrPair::ParseName( char* p ) { if ( !p || !(*p) ) { - return 0; + return nullptr; } if ( !XMLUtil::IsNameStartChar( *p ) ) { - return 0; + return nullptr; } char* const start = p; @@ -240,7 +240,7 @@ void StrPair::CollapseWhitespace() // Adjusting _start would cause undefined behavior on delete[] TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 ); // Trim leading space. - _start = XMLUtil::SkipWhiteSpace( _start, 0 ); + _start = XMLUtil::SkipWhiteSpace( _start, nullptr ); if ( *_start ) { const char* p = _start; // the read pointer @@ -248,7 +248,7 @@ void StrPair::CollapseWhitespace() while( *p ) { if ( XMLUtil::IsWhiteSpace( *p )) { - p = XMLUtil::SkipWhiteSpace( p, 0 ); + p = XMLUtil::SkipWhiteSpace( p, nullptr ); if ( *p == 0 ) { break; // don't write to q; this trims the trailing space. } @@ -311,7 +311,7 @@ const char* StrPair::GetStr() char buf[buflen] = { 0 }; int len = 0; char* adjusted = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) ); - if ( adjusted == 0 ) { + if ( adjusted == nullptr ) { *q = *p; ++p; ++q; @@ -468,13 +468,13 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) // Hexadecimal. const char* q = p+3; if ( !(*q) ) { - return 0; + return nullptr; } q = strchr( q, SEMICOLON ); if ( !q ) { - return 0; + return nullptr; } TIXMLASSERT( *q == SEMICOLON ); @@ -494,7 +494,7 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) digit = *q - 'A' + 10; } else { - return 0; + return nullptr; } TIXMLASSERT( digit < 16 ); TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit ); @@ -510,13 +510,13 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) // Decimal. const char* q = p+2; if ( !(*q) ) { - return 0; + return nullptr; } q = strchr( q, SEMICOLON ); if ( !q ) { - return 0; + return nullptr; } TIXMLASSERT( *q == SEMICOLON ); @@ -533,7 +533,7 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) ucs += digitScaled; } else { - return 0; + return nullptr; } TIXMLASSERT( mult <= UINT_MAX / 10 ); mult *= 10; @@ -660,7 +660,7 @@ char* XMLDocument::Identify( char* p, XMLNode** node ) int const startLine = _parseCurLineNum; p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); if( !*p ) { - *node = 0; + *node = nullptr; TIXMLASSERT( p ); return p; } @@ -680,7 +680,7 @@ char* XMLDocument::Identify( char* p, XMLNode** node ) TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) ); // use same memory pool TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) ); // use same memory pool - XMLNode* returnNode = 0; + XMLNode* returnNode = nullptr; if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) { returnNode = CreateUnlinkedNode<XMLDeclaration>( _commentPool ); returnNode->_parseLineNum = _parseCurLineNum; @@ -740,13 +740,13 @@ bool XMLDocument::Accept( XMLVisitor* visitor ) const XMLNode::XMLNode( XMLDocument* doc ) : _document( doc ), - _parent( 0 ), + _parent( nullptr ), _value(), _parseLineNum( 0 ), - _firstChild( 0 ), _lastChild( 0 ), - _prev( 0 ), _next( 0 ), - _userData( 0 ), - _memPool( 0 ) + _firstChild( nullptr ), _lastChild( nullptr ), + _prev( nullptr ), _next( nullptr ), + _userData( nullptr ), + _memPool( nullptr ) { } @@ -763,7 +763,7 @@ const char* XMLNode::Value() const { // Edge case: XMLDocuments don't have a Value. Return null. if ( this->ToDocument() ) - return 0; + return nullptr; return _value.GetStr(); } @@ -780,7 +780,7 @@ void XMLNode::SetValue( const char* str, bool staticMem ) XMLNode* XMLNode::DeepClone(XMLDocument* target) const { XMLNode* clone = this->ShallowClone(target); - if (!clone) return 0; + if (!clone) return nullptr; for (const XMLNode* child = this->FirstChild(); child; child = child->NextSibling()) { XMLNode* childClone = child->DeepClone(target); @@ -796,7 +796,7 @@ void XMLNode::DeleteChildren() TIXMLASSERT( _lastChild ); DeleteChild( _firstChild ); } - _firstChild = _lastChild = 0; + _firstChild = _lastChild = nullptr; } @@ -818,9 +818,9 @@ void XMLNode::Unlink( XMLNode* child ) if ( child->_next ) { child->_next->_prev = child->_prev; } - child->_next = 0; - child->_prev = 0; - child->_parent = 0; + child->_next = nullptr; + child->_prev = nullptr; + child->_parent = nullptr; } @@ -830,9 +830,9 @@ void XMLNode::DeleteChild( XMLNode* node ) TIXMLASSERT( node->_document == _document ); TIXMLASSERT( node->_parent == this ); Unlink( node ); - TIXMLASSERT(node->_prev == 0); - TIXMLASSERT(node->_next == 0); - TIXMLASSERT(node->_parent == 0); + TIXMLASSERT(node->_prev == nullptr); + TIXMLASSERT(node->_next == nullptr); + TIXMLASSERT(node->_parent == nullptr); DeleteNode( node ); } @@ -842,25 +842,25 @@ XMLNode* XMLNode::InsertEndChild( XMLNode* addThis ) TIXMLASSERT( addThis ); if ( addThis->_document != _document ) { TIXMLASSERT( false ); - return 0; + return nullptr; } InsertChildPreamble( addThis ); if ( _lastChild ) { TIXMLASSERT( _firstChild ); - TIXMLASSERT( _lastChild->_next == 0 ); + TIXMLASSERT( _lastChild->_next == nullptr ); _lastChild->_next = addThis; addThis->_prev = _lastChild; _lastChild = addThis; - addThis->_next = 0; + addThis->_next = nullptr; } else { - TIXMLASSERT( _firstChild == 0 ); + TIXMLASSERT( _firstChild == nullptr ); _firstChild = _lastChild = addThis; - addThis->_prev = 0; - addThis->_next = 0; + addThis->_prev = nullptr; + addThis->_next = nullptr; } addThis->_parent = this; return addThis; @@ -872,26 +872,26 @@ XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis ) TIXMLASSERT( addThis ); if ( addThis->_document != _document ) { TIXMLASSERT( false ); - return 0; + return nullptr; } InsertChildPreamble( addThis ); if ( _firstChild ) { TIXMLASSERT( _lastChild ); - TIXMLASSERT( _firstChild->_prev == 0 ); + TIXMLASSERT( _firstChild->_prev == nullptr ); _firstChild->_prev = addThis; addThis->_next = _firstChild; _firstChild = addThis; - addThis->_prev = 0; + addThis->_prev = nullptr; } else { - TIXMLASSERT( _lastChild == 0 ); + TIXMLASSERT( _lastChild == nullptr ); _firstChild = _lastChild = addThis; - addThis->_prev = 0; - addThis->_next = 0; + addThis->_prev = nullptr; + addThis->_next = nullptr; } addThis->_parent = this; return addThis; @@ -903,14 +903,14 @@ XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ) TIXMLASSERT( addThis ); if ( addThis->_document != _document ) { TIXMLASSERT( false ); - return 0; + return nullptr; } TIXMLASSERT( afterThis ); if ( afterThis->_parent != this ) { TIXMLASSERT( false ); - return 0; + return nullptr; } if ( afterThis == addThis ) { // Current state: BeforeThis -> AddThis -> OneAfterAddThis @@ -920,7 +920,7 @@ XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ) return addThis; } - if ( afterThis->_next == 0 ) { + if ( afterThis->_next == nullptr ) { // The last node or the only node. return InsertEndChild( addThis ); } @@ -944,7 +944,7 @@ const XMLElement* XMLNode::FirstChildElement( const char* name ) const return element; } } - return 0; + return nullptr; } @@ -956,7 +956,7 @@ const XMLElement* XMLNode::LastChildElement( const char* name ) const return element; } } - return 0; + return nullptr; } @@ -968,7 +968,7 @@ const XMLElement* XMLNode::NextSiblingElement( const char* name ) const return element; } } - return 0; + return nullptr; } @@ -980,7 +980,7 @@ const XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const return element; } } - return 0; + return nullptr; } @@ -1005,14 +1005,14 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) XMLDocument::DepthTracker tracker(_document); if (_document->Error()) - return 0; + return nullptr; while( p && *p ) { - XMLNode* node = 0; + XMLNode* node = nullptr; p = _document->Identify( p, &node ); TIXMLASSERT( p ); - if ( node == 0 ) { + if ( node == nullptr ) { break; } @@ -1023,7 +1023,7 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) if ( !p ) { DeleteNode( node ); if ( !_document->Error() ) { - _document->SetError( XML_ERROR_PARSING, initialLineNum, 0); + _document->SetError( XML_ERROR_PARSING, initialLineNum, nullptr); } break; } @@ -1095,12 +1095,12 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) } InsertEndChild( node ); } - return 0; + return nullptr; } /*static*/ void XMLNode::DeleteNode( XMLNode* node ) { - if ( node == 0 ) { + if ( node == nullptr ) { return; } TIXMLASSERT(node->_document); @@ -1130,16 +1130,16 @@ void XMLNode::InsertChildPreamble( XMLNode* insertThis ) const const XMLElement* XMLNode::ToElementWithName( const char* name ) const { const XMLElement* element = this->ToElement(); - if ( element == 0 ) { - return 0; + if ( element == nullptr ) { + return nullptr; } - if ( name == 0 ) { + if ( name == nullptr ) { return element; } if ( XMLUtil::StringEqual( element->Name(), name ) ) { return element; } - return 0; + return nullptr; } // --------- XMLText ---------- // @@ -1148,7 +1148,7 @@ char* XMLText::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) if ( this->CData() ) { p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); if ( !p ) { - _document->SetError( XML_ERROR_PARSING_CDATA, _parseLineNum, 0 ); + _document->SetError( XML_ERROR_PARSING_CDATA, _parseLineNum, nullptr ); } return p; } @@ -1163,10 +1163,10 @@ char* XMLText::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) return p-1; } if ( !p ) { - _document->SetError( XML_ERROR_PARSING_TEXT, _parseLineNum, 0 ); + _document->SetError( XML_ERROR_PARSING_TEXT, _parseLineNum, nullptr ); } } - return 0; + return nullptr; } @@ -1204,16 +1204,15 @@ XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc ) XMLComment::~XMLComment() -{ -} += default; char* XMLComment::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) { // Comment parses as text. p = _value.ParseText( p, "-->", StrPair::COMMENT, curLineNumPtr ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_COMMENT, _parseLineNum, 0 ); + if ( p == nullptr ) { + _document->SetError( XML_ERROR_PARSING_COMMENT, _parseLineNum, nullptr ); } return p; } @@ -1261,8 +1260,8 @@ char* XMLDeclaration::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) { // Declaration parses as text. p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_DECLARATION, _parseLineNum, 0 ); + if ( p == nullptr ) { + _document->SetError( XML_ERROR_PARSING_DECLARATION, _parseLineNum, nullptr ); } return p; } @@ -1301,8 +1300,7 @@ XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc ) XMLUnknown::~XMLUnknown() -{ -} += default; char* XMLUnknown::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) @@ -1310,7 +1308,7 @@ char* XMLUnknown::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) // Unknown parses as text. p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); if ( !p ) { - _document->SetError( XML_ERROR_PARSING_UNKNOWN, _parseLineNum, 0 ); + _document->SetError( XML_ERROR_PARSING_UNKNOWN, _parseLineNum, nullptr ); } return p; } @@ -1357,19 +1355,19 @@ char* XMLAttribute::ParseDeep( char* p, bool processEntities, int* curLineNumPtr // Parse using the name rules: bug fix, was using ParseText before p = _name.ParseName( p ); if ( !p || !*p ) { - return 0; + return nullptr; } // Skip white space before = p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); if ( *p != '=' ) { - return 0; + return nullptr; } ++p; // move up to opening quote p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); if ( *p != '\"' && *p != '\'' ) { - return 0; + return nullptr; } char endTag[2] = { *p, 0 }; @@ -1496,7 +1494,7 @@ void XMLAttribute::SetAttribute( float v ) // --------- XMLElement ---------- // XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), _closingType( OPEN ), - _rootAttribute( 0 ) + _rootAttribute( nullptr ) { } @@ -1518,7 +1516,7 @@ const XMLAttribute* XMLElement::FindAttribute( const char* name ) const return a; } } - return 0; + return nullptr; } @@ -1526,12 +1524,12 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const { const XMLAttribute* a = FindAttribute( name ); if ( !a ) { - return 0; + return nullptr; } if ( !value || XMLUtil::StringEqual( a->Value(), value )) { return a->Value(); } - return 0; + return nullptr; } int XMLElement::IntAttribute(const char* name, int defaultValue) const @@ -1581,7 +1579,7 @@ const char* XMLElement::GetText() const if ( FirstChild() && FirstChild()->ToText() ) { return FirstChild()->Value(); } - return 0; + return nullptr; } @@ -1766,8 +1764,8 @@ float XMLElement::FloatText(float defaultValue) const XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) { - XMLAttribute* last = 0; - XMLAttribute* attrib = 0; + XMLAttribute* last = nullptr; + XMLAttribute* attrib = nullptr; for( attrib = _rootAttribute; attrib; last = attrib, attrib = attrib->_next ) { @@ -1779,11 +1777,11 @@ XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) attrib = CreateAttribute(); TIXMLASSERT( attrib ); if ( last ) { - TIXMLASSERT( last->_next == 0 ); + TIXMLASSERT( last->_next == nullptr ); last->_next = attrib; } else { - TIXMLASSERT( _rootAttribute == 0 ); + TIXMLASSERT( _rootAttribute == nullptr ); _rootAttribute = attrib; } attrib->SetName( name ); @@ -1794,7 +1792,7 @@ XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) void XMLElement::DeleteAttribute( const char* name ) { - XMLAttribute* prev = 0; + XMLAttribute* prev = nullptr; for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) { if ( XMLUtil::StringEqual( name, a->Name() ) ) { if ( prev ) { @@ -1813,14 +1811,14 @@ void XMLElement::DeleteAttribute( const char* name ) char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) { - XMLAttribute* prevAttribute = 0; + XMLAttribute* prevAttribute = nullptr; // Read the attributes. while( p ) { p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); if ( !(*p) ) { _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, "XMLElement name=%s", Name() ); - return 0; + return nullptr; } // attribute. @@ -1835,7 +1833,7 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) if ( !p || Attribute( attrib->Name() ) ) { DeleteAttribute( attrib ); _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, attrLineNum, "XMLElement name=%s", Name() ); - return 0; + return nullptr; } // There is a minor bug here: if the attribute in the source xml // document is duplicated, it will not be detected and the @@ -1843,11 +1841,11 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) // avoids re-scanning the attribute list. Preferring performance for // now, may reconsider in the future. if ( prevAttribute ) { - TIXMLASSERT( prevAttribute->_next == 0 ); + TIXMLASSERT( prevAttribute->_next == nullptr ); prevAttribute->_next = attrib; } else { - TIXMLASSERT( _rootAttribute == 0 ); + TIXMLASSERT( _rootAttribute == nullptr ); _rootAttribute = attrib; } prevAttribute = attrib; @@ -1863,8 +1861,8 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) return p+2; // done; sealed element. } else { - _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, 0 ); - return 0; + _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, nullptr ); + return nullptr; } } return p; @@ -1872,7 +1870,7 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) void XMLElement::DeleteAttribute( XMLAttribute* attribute ) { - if ( attribute == 0 ) { + if ( attribute == nullptr ) { return; } MemPool* pool = attribute->_memPool; @@ -1909,7 +1907,7 @@ char* XMLElement::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr p = _value.ParseName( p ); if ( _value.Empty() ) { - return 0; + return nullptr; } p = ParseAttributes( p, curLineNumPtr ); @@ -2003,14 +2001,14 @@ const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = { XMLDocument::XMLDocument( bool processEntities, Whitespace whitespaceMode ) : - XMLNode( 0 ), + XMLNode( nullptr ), _writeBOM( false ), _processEntities( processEntities ), _errorID(XML_SUCCESS), _whitespaceMode( whitespaceMode ), _errorStr(), _errorLineNum( 0 ), - _charBuffer( 0 ), + _charBuffer( nullptr ), _parseCurLineNum( 0 ), _parsingDepth(0), _unlinked(), @@ -2033,7 +2031,7 @@ XMLDocument::~XMLDocument() void XMLDocument::MarkInUse(XMLNode* node) { TIXMLASSERT(node); - TIXMLASSERT(node->_parent == 0); + TIXMLASSERT(node->_parent == nullptr); for (int i = 0; i < _unlinked.Size(); ++i) { if (node == _unlinked[i]) { @@ -2056,7 +2054,7 @@ void XMLDocument::Clear() ClearError(); delete [] _charBuffer; - _charBuffer = 0; + _charBuffer = nullptr; _parsingDepth = 0; #if 0 @@ -2211,7 +2209,7 @@ XMLError XMLDocument::LoadFile( FILE* fp ) fseek( fp, 0, SEEK_SET ); if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + SetError( XML_ERROR_FILE_READ_ERROR, 0, nullptr ); return _errorID; } @@ -2219,28 +2217,28 @@ XMLError XMLDocument::LoadFile( FILE* fp ) const long filelength = ftell( fp ); fseek( fp, 0, SEEK_SET ); if ( filelength == -1L ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + SetError( XML_ERROR_FILE_READ_ERROR, 0, nullptr ); return _errorID; } TIXMLASSERT( filelength >= 0 ); if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) { // Cannot handle files which won't fit in buffer together with null terminator - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + SetError( XML_ERROR_FILE_READ_ERROR, 0, nullptr ); return _errorID; } if ( filelength == 0 ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, nullptr ); return _errorID; } const size_t size = filelength; - TIXMLASSERT( _charBuffer == 0 ); + TIXMLASSERT( _charBuffer == nullptr ); _charBuffer = new char[size+1]; size_t read = fread( _charBuffer, 1, size, fp ); if ( read != size ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + SetError( XML_ERROR_FILE_READ_ERROR, 0, nullptr ); return _errorID; } @@ -2286,13 +2284,13 @@ XMLError XMLDocument::Parse( const char* p, size_t len ) Clear(); if ( len == 0 || !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, nullptr ); return _errorID; } if ( len == (size_t)(-1) ) { len = strlen( p ); } - TIXMLASSERT( _charBuffer == 0 ); + TIXMLASSERT( _charBuffer == nullptr ); _charBuffer = new char[ len+1 ]; memcpy( _charBuffer, p, len ); _charBuffer[len] = 0; @@ -2386,10 +2384,10 @@ void XMLDocument::Parse() p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); p = const_cast<char*>( XMLUtil::ReadBOM( p, &_writeBOM ) ); if ( !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, nullptr ); return; } - ParseDeep(p, 0, &_parseCurLineNum ); + ParseDeep(p, nullptr, &_parseCurLineNum ); } void XMLDocument::PushDepth() @@ -2786,7 +2784,7 @@ bool XMLPrinter::VisitEnter( const XMLDocument& doc ) bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) { - const XMLElement* parentElem = 0; + const XMLElement* parentElem = nullptr; if ( element.Parent() ) { parentElem = element.Parent()->ToElement(); } diff --git a/VirtualRobot/VirtualRobotException.cpp b/VirtualRobot/VirtualRobotException.cpp index 1a7faeea191b783da3e402989e07107ef5d8c6de..916c733d5dc355527472c6f7d3003e83e918e9c7 100644 --- a/VirtualRobot/VirtualRobotException.cpp +++ b/VirtualRobot/VirtualRobotException.cpp @@ -17,8 +17,7 @@ namespace VirtualRobot } VirtualRobotException::~VirtualRobotException() throw() - { - } + = default; const char* VirtualRobotException::what() const throw() { diff --git a/VirtualRobot/Visualization/CoinVisualization/CoinVisualization.cpp b/VirtualRobot/Visualization/CoinVisualization/CoinVisualization.cpp index 210bd9d70b369899a8dc89ad3e9f6a12b99e1fb7..ab0de471fd232bc3bd2c15774ec4a18b3f03cb7e 100644 --- a/VirtualRobot/Visualization/CoinVisualization/CoinVisualization.cpp +++ b/VirtualRobot/Visualization/CoinVisualization/CoinVisualization.cpp @@ -26,17 +26,17 @@ namespace VirtualRobot CoinVisualization::CoinVisualization(const VisualizationNodePtr visualizationNode) : Visualization(visualizationNode) { - selection = NULL; - visuRoot = NULL; - color = NULL; + selection = nullptr; + visuRoot = nullptr; + color = nullptr; } CoinVisualization::CoinVisualization(const std::vector<VisualizationNodePtr>& visualizationNodes) : Visualization(visualizationNodes) { - selection = NULL; - visuRoot = NULL; - color = NULL; + selection = nullptr; + visuRoot = nullptr; + color = nullptr; } CoinVisualization::~CoinVisualization() diff --git a/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.cpp b/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.cpp index 70bb6911a0f4fb34cf3d98fd9c3b3afa100fae8f..4fe585650403779b727e0fe1886870187e6b8469 100644 --- a/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.cpp +++ b/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.cpp @@ -95,13 +95,11 @@ namespace VirtualRobot CoinVisualizationFactory::TextureCacheMap CoinVisualizationFactory::globalTextureCache; CoinVisualizationFactory::CoinVisualizationFactory() - { - } + = default; CoinVisualizationFactory::~CoinVisualizationFactory() - { - } + = default; void CoinVisualizationFactory::init(int &argc, char* argv[], const std::string &appName) { @@ -358,7 +356,7 @@ namespace VirtualRobot SoNode* coinVisualization = SoDB::readAll(&soInput); // check if the visualization was read - if (NULL == coinVisualization) + if (nullptr == coinVisualization) { std::cerr << "Problem reading model from SoInput: " << soInput.getCurFileName() << std::endl; return; @@ -798,7 +796,7 @@ namespace VirtualRobot result->addChild(tmp2); } - if (text != NULL) + if (text != nullptr) { SoSeparator* textSep = new SoSeparator(); SoTranslation* moveT = new SoTranslation(); @@ -951,7 +949,7 @@ namespace VirtualRobot SoUnits* u = new SoUnits(); u->units = SoUnits::MILLIMETERS; res->addChild(u); - res->addChild(CreateEllipse(x, y, z, NULL, showAxes, axesHeight, axesWidth)); + res->addChild(CreateEllipse(x, y, z, nullptr, showAxes, axesHeight, axesWidth)); VisualizationNodePtr visualizationNode(new CoinVisualizationNode(res)); res->unref(); return visualizationNode; @@ -1101,7 +1099,7 @@ namespace VirtualRobot } private: - ~DeleteTextureCallBack() override{} + ~DeleteTextureCallBack() override= default; std::string nodeName; std::string path; size_t filesize; @@ -2347,7 +2345,7 @@ namespace VirtualRobot if (!reachSpace || reachSpace->numVoxels[0] <= 0 || reachSpace->numVoxels[1] <= 0 || reachSpace->numVoxels[2] <= 0) { - return NULL; + return nullptr; } //float x[6]; @@ -2412,7 +2410,7 @@ namespace VirtualRobot if (entryRot.size() == 0) { - return NULL; + return nullptr; } SoSeparator* res = new SoSeparator; @@ -3632,7 +3630,7 @@ namespace VirtualRobot bool CoinVisualizationFactory::renderOffscreen(SoOffscreenRenderer* renderer, SoPerspectiveCamera* cam, SoNode* scene, unsigned char** buffer) { //SbTime t1 = SbTime::getTimeOfDay(); // for profiling - if (!renderer || !cam || !scene || buffer == NULL) + if (!renderer || !cam || !scene || buffer == nullptr) { return false; } @@ -4300,7 +4298,7 @@ namespace VirtualRobot { if (!n) { - return NULL; + return nullptr; } bool copyImages = true; diff --git a/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationNode.cpp b/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationNode.cpp index 662c404ec62c87aa8363f32a764c8abf49adb8c6..256773dc1d377033df51149a2ed88b7491c4498b 100644 --- a/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationNode.cpp +++ b/VirtualRobot/Visualization/CoinVisualization/CoinVisualizationNode.cpp @@ -311,7 +311,7 @@ namespace VirtualRobot { THROW_VR_EXCEPTION_IF(scaling <= 0, "Scaling must be >0"); - SoSeparator* newModel = NULL; + SoSeparator* newModel = nullptr; if (visualization) { diff --git a/VirtualRobot/Visualization/ColorMap.cpp b/VirtualRobot/Visualization/ColorMap.cpp index facb2597891c5662a599f19d57d3bfefb9a73c8b..aeda2984eb5a034b2aa800c04e1e700a4cfdd2a3 100644 --- a/VirtualRobot/Visualization/ColorMap.cpp +++ b/VirtualRobot/Visualization/ColorMap.cpp @@ -19,13 +19,10 @@ namespace VirtualRobot } ColorMap::ColorMap() - { - } + = default; ColorMap::~ColorMap() - { - - } + = default; void ColorMap::create(type t) { colorKeys.clear(); diff --git a/VirtualRobot/Visualization/TriMeshModel.cpp b/VirtualRobot/Visualization/TriMeshModel.cpp index ab8ed0a8a97a5c94649770460238702818acbba2..6f62237115f2221592695dd513749e33e6c3b86a 100644 --- a/VirtualRobot/Visualization/TriMeshModel.cpp +++ b/VirtualRobot/Visualization/TriMeshModel.cpp @@ -20,8 +20,7 @@ namespace VirtualRobot TriMeshModel::TriMeshModel() - { - } + = default; TriMeshModel::TriMeshModel(std::vector <triangle>& triangles) { diff --git a/VirtualRobot/Visualization/Visualization.cpp b/VirtualRobot/Visualization/Visualization.cpp index 77b523d54b676d6204d9dde77cb44ac7f4971fe8..544c5837ca98d96e60dc46f0d16b8ced70e7a481 100644 --- a/VirtualRobot/Visualization/Visualization.cpp +++ b/VirtualRobot/Visualization/Visualization.cpp @@ -24,8 +24,7 @@ namespace VirtualRobot } Visualization::~Visualization() - { - } + = default; VirtualRobot::VisualizationPtr Visualization::clone() { diff --git a/VirtualRobot/Workspace/WorkspaceDataArray.cpp b/VirtualRobot/Workspace/WorkspaceDataArray.cpp index e2a0c417a0efa23c3d2a49d09fbb0452476f7cd2..5a888dc9ee56c1e280a57680385501bdaab87911 100644 --- a/VirtualRobot/Workspace/WorkspaceDataArray.cpp +++ b/VirtualRobot/Workspace/WorkspaceDataArray.cpp @@ -39,7 +39,7 @@ namespace VirtualRobot { for (unsigned int z = 0; z < size3; z++) { - data[x * sizeTr0 + y * sizeTr1 + z] = NULL; + data[x * sizeTr0 + y * sizeTr1 + z] = nullptr; } } } @@ -94,14 +94,14 @@ namespace VirtualRobot { int pos = x * sizeTr0 + y * sizeTr1 + z; - if (other->data[pos] != NULL) + if (other->data[pos] != nullptr) { data[pos] = new unsigned char[(unsigned int)sizeRot]; memcpy(data[pos], other->data[pos], (unsigned int)sizeRot * sizeof(unsigned char)); } else { - data[pos] = NULL; + data[pos] = nullptr; } } } @@ -497,7 +497,7 @@ namespace VirtualRobot if (data[x * sizeTr0 + y * sizeTr1 + z]) { delete [] data[x * sizeTr0 + y * sizeTr1 + z]; - data[x * sizeTr0 + y * sizeTr1 + z] = NULL; + data[x * sizeTr0 + y * sizeTr1 + z] = nullptr; } } } @@ -514,7 +514,7 @@ namespace VirtualRobot return false; } - return (data[x * sizeTr0 + y * sizeTr1 + z] != NULL); + return (data[x * sizeTr0 + y * sizeTr1 + z] != nullptr); } WorkspaceData* WorkspaceDataArray::clone() diff --git a/VirtualRobot/Workspace/WorkspaceGrid.cpp b/VirtualRobot/Workspace/WorkspaceGrid.cpp index 932987cc5f82eda43cb7eefeff77f58d60dcf832..d322e388814f8394458725ae0ad5875262ce8b8c 100644 --- a/VirtualRobot/Workspace/WorkspaceGrid.cpp +++ b/VirtualRobot/Workspace/WorkspaceGrid.cpp @@ -21,7 +21,7 @@ namespace VirtualRobot minY = fMinY; maxY = fMaxY; discretizeSize = fDiscretizeSize; - data = NULL; + data = nullptr; if (fMinX >= fMaxX || fMinY >= fMaxY) { diff --git a/VirtualRobot/Workspace/tests/VoxelTreeTest.cpp b/VirtualRobot/Workspace/tests/VoxelTreeTest.cpp index e337daf8ad827f8bc7fe2210b5c49c2fd5012038..559b140a905059b9c1ee0cfe7a4ac21042ff614f 100644 --- a/VirtualRobot/Workspace/tests/VoxelTreeTest.cpp +++ b/VirtualRobot/Workspace/tests/VoxelTreeTest.cpp @@ -72,11 +72,11 @@ BOOST_AUTO_TEST_CASE(VoxelTreeEntriesTest) } unsigned char* c = v.getEntry(pos); - bool isNull = (c == NULL); + bool isNull = (c == nullptr); BOOST_REQUIRE(isNull); v.setEntry(pos, 10); c = v.getEntry(pos); - isNull = (c == NULL); + isNull = (c == nullptr); BOOST_REQUIRE(!isNull); BOOST_REQUIRE_EQUAL(*c, 10); @@ -107,16 +107,16 @@ BOOST_AUTO_TEST_CASE(VoxelTreeNDEntriesTest) } unsigned char* c = v.getEntry(pos); - bool isNull = (c == NULL); + bool isNull = (c == nullptr); BOOST_REQUIRE(isNull); v.setEntry(pos, 10); c = v.getEntry(pos); - isNull = (c == NULL); + isNull = (c == nullptr); BOOST_REQUIRE(!isNull); BOOST_REQUIRE_EQUAL(*c, 10); VirtualRobot::VoxelTreeNDElement<unsigned char, N>* e = v.getLeafElement(pos); - BOOST_REQUIRE(e != NULL); + BOOST_REQUIRE(e != nullptr); BOOST_REQUIRE(*(e->getEntry()) == 10); for (unsigned int i = 0; i < N; i++) @@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(VoxelTreeNDSaveLoad) v.save("testVoxelTree.bin"); VirtualRobot::VoxelTreeND<unsigned char, N>* v2 = VirtualRobot::VoxelTreeND<unsigned char, N>::load("testVoxelTree.bin"); unsigned char* c = v2->getEntry(pos); - bool isNull = (c == NULL); + bool isNull = (c == nullptr); BOOST_REQUIRE(!isNull); BOOST_REQUIRE_EQUAL(*c, 10); diff --git a/VirtualRobot/XML/BaseIO.cpp b/VirtualRobot/XML/BaseIO.cpp index 84ff2937bccbea709663e40ac8b303e8fa655f1c..a15989eb02d3e72d1a140b7bb88abf9ba4fe9d06 100644 --- a/VirtualRobot/XML/BaseIO.cpp +++ b/VirtualRobot/XML/BaseIO.cpp @@ -21,12 +21,10 @@ namespace VirtualRobot boost::mutex BaseIO::mutex; BaseIO::BaseIO() - { - } + = default; BaseIO::~BaseIO() - { - } + = default; bool BaseIO::isTrue(const char* s) { @@ -52,7 +50,7 @@ namespace VirtualRobot */ float BaseIO::convertToFloat(const char* s) { - THROW_VR_EXCEPTION_IF(NULL == s, "Passing Null string to convertToFloat()"); + THROW_VR_EXCEPTION_IF(nullptr == s, "Passing Null string to convertToFloat()"); std::stringstream floatStream; floatStream << std::string(s); float result; @@ -67,7 +65,7 @@ namespace VirtualRobot int BaseIO::convertToInt(const char* s) { - THROW_VR_EXCEPTION_IF(NULL == s, "Passing Null string to convertToInt()"); + THROW_VR_EXCEPTION_IF(nullptr == s, "Passing Null string to convertToInt()"); std::stringstream intStream; intStream << std::string(s); int result; @@ -167,7 +165,7 @@ namespace VirtualRobot return; } - rapidxml::xml_node<>* trXMLNode = NULL; + rapidxml::xml_node<>* trXMLNode = nullptr; std::string nodeName = getLowerCase(transformXMLNode->name()); if (nodeName == "transform") @@ -430,7 +428,7 @@ namespace VirtualRobot attr = node->first_attribute("unitsTime", 0, false); } - return (attr != NULL); + return (attr != nullptr); } void BaseIO::getAllAttributes(rapidxml::xml_node<char>* node, const std::string& attrString, std::vector<std::string>& storeValues) @@ -572,7 +570,7 @@ namespace VirtualRobot */ std::string BaseIO::getLowerCase(const char* c) { - THROW_VR_EXCEPTION_IF(NULL == c, "Passing Null string to getLowerCase()"); + THROW_VR_EXCEPTION_IF(nullptr == c, "Passing Null string to getLowerCase()"); std::string res = c; getLowerCase(res); return res; diff --git a/VirtualRobot/XML/ObjectIO.cpp b/VirtualRobot/XML/ObjectIO.cpp index 34c3138b61da7cf5c5443107b33dae0f279b0bc2..5cbbd9224f4e72f3bc5ebaadfe9b6fb214226283 100644 --- a/VirtualRobot/XML/ObjectIO.cpp +++ b/VirtualRobot/XML/ObjectIO.cpp @@ -20,12 +20,10 @@ namespace VirtualRobot ObjectIO::ObjectIO() - { - } + = default; ObjectIO::~ObjectIO() - { - } + = default; VirtualRobot::ObstaclePtr ObjectIO::loadObstacle(const std::string& xmlFile) { diff --git a/VirtualRobot/XML/RobotIO.cpp b/VirtualRobot/XML/RobotIO.cpp index 812f1209cc9e82870dbe056ec9582c8753c27175..825ce0244d87dab68ea615820f952ea5859be428 100644 --- a/VirtualRobot/XML/RobotIO.cpp +++ b/VirtualRobot/XML/RobotIO.cpp @@ -29,12 +29,10 @@ namespace VirtualRobot std::map<std::string, int> RobotIO::robot_name_counter; RobotIO::RobotIO() - { - } + = default; RobotIO::~RobotIO() - { - } + = default; diff --git a/VirtualRobot/XML/SceneIO.cpp b/VirtualRobot/XML/SceneIO.cpp index 05a9c6d5ffdf55aad7ce871978cc0b6935007fdc..bf3af0dcb88113048a04b69dde850f26746db954 100644 --- a/VirtualRobot/XML/SceneIO.cpp +++ b/VirtualRobot/XML/SceneIO.cpp @@ -14,12 +14,10 @@ namespace VirtualRobot SceneIO::SceneIO() - { - } + = default; SceneIO::~SceneIO() - { - } + = default; VirtualRobot::ScenePtr SceneIO::loadScene(const std::string& xmlFile) { @@ -260,7 +258,7 @@ namespace VirtualRobot std::vector<rapidxml::xml_node<char>* > trajectoryNodes; - rapidxml::xml_node<>* XMLNode = sceneXMLNode->first_node(NULL, 0, false); + rapidxml::xml_node<>* XMLNode = sceneXMLNode->first_node(nullptr, 0, false); while (XMLNode) { @@ -312,7 +310,7 @@ namespace VirtualRobot THROW_VR_EXCEPTION("XML node of type <" << nodeName_ << "> is not supported. Ignoring contents..." << endl); } - XMLNode = XMLNode->next_sibling(NULL, 0, false); + XMLNode = XMLNode->next_sibling(nullptr, 0, false); } // process all sceneSetNodes diff --git a/VirtualRobot/XML/mjcf/MasslessBodySanitizer.cpp b/VirtualRobot/XML/mjcf/MasslessBodySanitizer.cpp index 4f5c7e35ad1876414344f595e114ef1533bc08b2..e04389f540d4d08a5e3019ba8b96a57d8e5e0926 100644 --- a/VirtualRobot/XML/mjcf/MasslessBodySanitizer.cpp +++ b/VirtualRobot/XML/mjcf/MasslessBodySanitizer.cpp @@ -233,8 +233,7 @@ MergedBodySet&MasslessBodySanitizer::getMergedBodySetWith(const std::string& bod MergedBodySet::MergedBodySet() -{ -} += default; MergedBodySet::MergedBodySet(const std::string& bodyName) { diff --git a/VirtualRobot/XML/mjcf/MujocoIO.cpp b/VirtualRobot/XML/mjcf/MujocoIO.cpp index c440a67576f07fb9951bad71e3f96ed56b928d9a..d5ce06979126c921adc480bc8345be1995c69514 100644 --- a/VirtualRobot/XML/mjcf/MujocoIO.cpp +++ b/VirtualRobot/XML/mjcf/MujocoIO.cpp @@ -309,7 +309,7 @@ struct ParentChildContactExcludeVisitor : public tinyxml2::XMLVisitor { ParentChildContactExcludeVisitor(Document& document) : document(document) {} - virtual ~ParentChildContactExcludeVisitor() override {} + virtual ~ParentChildContactExcludeVisitor() override = default; virtual bool VisitEnter(const tinyxml2::XMLElement&, const tinyxml2::XMLAttribute*) override; @@ -467,7 +467,7 @@ struct ListElementsVisitor : public tinyxml2::XMLVisitor { ListElementsVisitor(const std::string& elementName) : elementName(elementName) {} - virtual ~ListElementsVisitor() override {} + virtual ~ListElementsVisitor() override = default; // XMLVisitor interface virtual bool VisitEnter(const tinyxml2::XMLElement&, const tinyxml2::XMLAttribute*) override; diff --git a/VirtualRobot/examples/CameraViewer/showCamWindow.cpp b/VirtualRobot/examples/CameraViewer/showCamWindow.cpp index 4c646abe8f51e2b0ea1df6295a225383f2201be8..beba7a64243afca4140fdb8516938e3d22329555 100644 --- a/VirtualRobot/examples/CameraViewer/showCamWindow.cpp +++ b/VirtualRobot/examples/CameraViewer/showCamWindow.cpp @@ -31,14 +31,14 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; showCamWindow::showCamWindow(std::string& sRobotFilename, std::string& cam1Name, std::string& cam2Name) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; //this->setCaption(QString("ShowRobot - KIT - Humanoids Group")); //resize(1100, 768); - cam2Renderer = NULL; - cam2Buffer = NULL; - cam2DepthBuffer = NULL; + cam2Renderer = nullptr; + cam2Buffer = nullptr; + cam2DepthBuffer = nullptr; useColModel = false; VirtualRobot::RuntimeEnvironment::getDataFileAbsolute(sRobotFilename); @@ -111,9 +111,9 @@ showCamWindow::~showCamWindow() sceneSep->unref(); cam1VoxelSep->unref(); - UI.cam1->setScene(NULL); + UI.cam1->setScene(nullptr); visuObjects.emplace_back(VirtualRobot::Obstacle::createSphere(400.0f)); - UI.cam2->setScene(NULL); + UI.cam2->setScene(nullptr); delete [] cam2Buffer; delete [] cam2DepthBuffer; @@ -212,7 +212,7 @@ void showCamWindow::rebuildVisualization() SceneObject::VisualizationType colModel = useColModel ? SceneObject::Collision : SceneObject::Full; visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { @@ -409,7 +409,7 @@ void showCamWindow::loadRobot() { QFileInfo fileInfo(m_sRobotFilename.c_str()); std::string suffix(fileInfo.suffix().toLatin1()); - RobotImporterFactoryPtr importer = RobotImporterFactory::fromFileExtension(suffix, NULL); + RobotImporterFactoryPtr importer = RobotImporterFactory::fromFileExtension(suffix, nullptr); if (!importer) { @@ -442,11 +442,11 @@ void showCamWindow::updateCameras() { cam1.reset(); cam2.reset(); - cam2Renderer = NULL; + cam2Renderer = nullptr; delete []cam2Buffer; - cam2Buffer = NULL; + cam2Buffer = nullptr; delete [] cam2DepthBuffer; - cam2DepthBuffer = NULL; + cam2DepthBuffer = nullptr; if (!robot) { diff --git a/VirtualRobot/examples/ConstrainedIK/ConstrainedIKWindow.cpp b/VirtualRobot/examples/ConstrainedIK/ConstrainedIKWindow.cpp index efea278ad204026c578444cb6b3c57d5d77d3a9d..012796c139723f37a10441d2d483ffabe39ffff4 100644 --- a/VirtualRobot/examples/ConstrainedIK/ConstrainedIKWindow.cpp +++ b/VirtualRobot/examples/ConstrainedIK/ConstrainedIKWindow.cpp @@ -49,7 +49,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; ConstrainedIKWindow::ConstrainedIKWindow(std::string& sRobotFilename) - : QMainWindow(NULL) + : QMainWindow(nullptr) { robotFilename = sRobotFilename; sceneSep = new SoSeparator(); @@ -165,7 +165,7 @@ void ConstrainedIKWindow::collisionModel() robotSep->removeAllChildren(); boost::shared_ptr<CoinVisualization> visualization = robot->getVisualization<CoinVisualization>(SceneObject::Full); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/VirtualRobot/examples/GenericIK/GenericIKWindow.cpp b/VirtualRobot/examples/GenericIK/GenericIKWindow.cpp index 6c67e2dbda04fd1eb0fdf2d4fc6f13f2dfa3aa2a..38136fab9939e9c33c8a5e724c6f3826990dcded 100644 --- a/VirtualRobot/examples/GenericIK/GenericIKWindow.cpp +++ b/VirtualRobot/examples/GenericIK/GenericIKWindow.cpp @@ -19,7 +19,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; GenericIKWindow::GenericIKWindow(std::string& sRobotFilename) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; //this->setCaption(QString("ShowRobot - KIT - Humanoids Group")); @@ -195,7 +195,7 @@ void GenericIKWindow::collisionModel() SceneObject::VisualizationType colModel = useColModel ? SceneObject::Collision : SceneObject::Full; boost::shared_ptr<CoinVisualization> visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/VirtualRobot/examples/Jacobi/JacobiWindow.cpp b/VirtualRobot/examples/Jacobi/JacobiWindow.cpp index 4debe93709fe127248aa1f45386bb49b26eb0858..ed322b0c1b06fc43de8e91c6ba497548c757be3b 100644 --- a/VirtualRobot/examples/Jacobi/JacobiWindow.cpp +++ b/VirtualRobot/examples/Jacobi/JacobiWindow.cpp @@ -15,7 +15,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; JacobiWindow::JacobiWindow(std::string& sRobotFilename) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; //this->setCaption(QString("ShowRobot - KIT - Humanoids Group")); @@ -279,7 +279,7 @@ void JacobiWindow::collisionModel() SceneObject::VisualizationType colModel = useColModel ? SceneObject::Collision : SceneObject::Full; boost::shared_ptr<CoinVisualization> visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/VirtualRobot/examples/ReachabilityMap/ReachabilityMapWindow.cpp b/VirtualRobot/examples/ReachabilityMap/ReachabilityMapWindow.cpp index 22e46151e4ae59d27a2f193a7c08100850cc4f81..f050de8cfffefbcc15359e24ed3da7840ec1cee4 100644 --- a/VirtualRobot/examples/ReachabilityMap/ReachabilityMapWindow.cpp +++ b/VirtualRobot/examples/ReachabilityMap/ReachabilityMapWindow.cpp @@ -29,7 +29,7 @@ float TIMER_MS = 30.0f; //#define ENDLESS ReachabilityMapWindow::ReachabilityMapWindow(std::string& sRobotFile, std::string& reachFile, std::string& objFile, std::string& eef) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -338,7 +338,7 @@ void ReachabilityMapWindow::buildRobotVisu() } boost::shared_ptr<VirtualRobot::CoinVisualization> visualization = robot->getVisualization<CoinVisualization>(); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { @@ -361,7 +361,7 @@ void ReachabilityMapWindow::buildObjectVisu() } boost::shared_ptr<VirtualRobot::CoinVisualization> visualization = graspObject->getVisualization<CoinVisualization>(); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/VirtualRobot/examples/RobotViewer/showRobotWindow.cpp b/VirtualRobot/examples/RobotViewer/showRobotWindow.cpp index 1dd70d05902443e1a1c797d114e1eb7c5e46b800..bc9e57648a70371ae83b89eaddecf66aa3ea57b1 100644 --- a/VirtualRobot/examples/RobotViewer/showRobotWindow.cpp +++ b/VirtualRobot/examples/RobotViewer/showRobotWindow.cpp @@ -26,7 +26,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; showRobotWindow::showRobotWindow(std::string& sRobotFilename) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; //this->setCaption(QString("ShowRobot - KIT - Humanoids Group")); @@ -255,7 +255,7 @@ void showRobotWindow::rebuildVisualization() SceneObject::VisualizationType colModel = (UI.checkBoxColModel->isChecked()) ? SceneObject::Collision : SceneObject::Full; visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { @@ -845,7 +845,7 @@ void showRobotWindow::loadRobot() { QFileInfo fileInfo(m_sRobotFilename.c_str()); std::string suffix(fileInfo.suffix().toLatin1()); - RobotImporterFactoryPtr importer = RobotImporterFactory::fromFileExtension(suffix, NULL); + RobotImporterFactoryPtr importer = RobotImporterFactory::fromFileExtension(suffix, nullptr); if (!importer) { diff --git a/VirtualRobot/examples/SceneViewer/showSceneWindow.cpp b/VirtualRobot/examples/SceneViewer/showSceneWindow.cpp index 7680d0f966c7c97f019e9d34a329decc304a017f..354ad20cb7d7425faf949a8386d73272ff2f15a1 100644 --- a/VirtualRobot/examples/SceneViewer/showSceneWindow.cpp +++ b/VirtualRobot/examples/SceneViewer/showSceneWindow.cpp @@ -26,7 +26,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; showSceneWindow::showSceneWindow(std::string& sSceneFile) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -172,7 +172,7 @@ void showSceneWindow::buildVisu() } visualization = scene->getVisualization<CoinVisualization>(visuType); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/VirtualRobot/examples/reachability/reachabilityScene.cpp b/VirtualRobot/examples/reachability/reachabilityScene.cpp index 7032899dc3b78cde648cac3770d0f95a7d9505d6..cf4814a292070f1abb89e2440d72a9e75dfac7d7 100644 --- a/VirtualRobot/examples/reachability/reachabilityScene.cpp +++ b/VirtualRobot/examples/reachability/reachabilityScene.cpp @@ -103,7 +103,7 @@ void endlessExtend(std::string robotFile, std::string reachFile, int steps) reachSpace->print(); - time_t time_now = time(NULL); + time_t time_now = time(nullptr); struct tm* timeinfo; timeinfo = localtime(&time_now); char buffer [255]; diff --git a/VirtualRobot/examples/reachability/reachabilityWindow.cpp b/VirtualRobot/examples/reachability/reachabilityWindow.cpp index 48ba17b21c970c9c8624ca4030fa409d2d06a5b5..70c462ca2a35312b4ff759099d4884d829fdce51 100644 --- a/VirtualRobot/examples/reachability/reachabilityWindow.cpp +++ b/VirtualRobot/examples/reachability/reachabilityWindow.cpp @@ -31,7 +31,7 @@ float TIMER_MS = 30.0f; reachabilityWindow::reachabilityWindow(std::string& sRobotFile, std::string& reachFile, Eigen::Vector3f& axisTCP) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -239,7 +239,7 @@ void reachabilityWindow::buildVisu() SceneObject::VisualizationType colModel = (UI.checkBoxColModel->isChecked()) ? SceneObject::Collision : SceneObject::Full; visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) { diff --git a/VirtualRobot/examples/stability/stabilityWindow.cpp b/VirtualRobot/examples/stability/stabilityWindow.cpp index f0b5def2d578cdce89ad4452e302d8b83beee382..45bec74390f58b9c5b46911361eb529bc75c334d 100644 --- a/VirtualRobot/examples/stability/stabilityWindow.cpp +++ b/VirtualRobot/examples/stability/stabilityWindow.cpp @@ -37,7 +37,7 @@ using namespace VirtualRobot; float TIMER_MS = 30.0f; stabilityWindow::stabilityWindow(std::string& sRobotFile) - : QMainWindow(NULL) + : QMainWindow(nullptr) { VR_INFO << " start " << endl; @@ -202,7 +202,7 @@ void stabilityWindow::buildVisu() useColModel = UI.checkBoxColModel->checkState() == Qt::Checked; SceneObject::VisualizationType colModel = (UI.checkBoxColModel->isChecked()) ? SceneObject::Collision : SceneObject::Full; visualization = robot->getVisualization<CoinVisualization>(colModel); - SoNode* visualisationNode = NULL; + SoNode* visualisationNode = nullptr; if (visualization) {