From 3113af358f7ea22fe05f9dd52b09370485c72359 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Thu, 4 May 2017 13:27:24 +0200 Subject: [PATCH] Eradicate NULL macro. Replace with nullptr, 0, etc --- Applications/DataExplorer/DataView/GeoTreeView.cpp | 10 +++++++--- BaseLib/TemplateLogogFormatterSuppressedGCC-impl.h | 2 +- GeoLib/IO/Legacy/OGSIOVer4.cpp | 2 -- GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Applications/DataExplorer/DataView/GeoTreeView.cpp b/Applications/DataExplorer/DataView/GeoTreeView.cpp index b228cdc69c6..11d63a8a120 100644 --- a/Applications/DataExplorer/DataView/GeoTreeView.cpp +++ b/Applications/DataExplorer/DataView/GeoTreeView.cpp @@ -283,9 +283,13 @@ void GeoTreeView::loadFEMConditions() void GeoTreeView::saveFEMConditions() { TreeItem* item = static_cast<GeoTreeModel*>(model())->getItem( - this->selectionModel()->currentIndex()); - QString fileName = QFileDialog::getSaveFileName(NULL, - "Save FEM Conditions as", "", "OpenGeoSys FEM Condition file (*.cnd);; GeoSys Boundary Condition (*.bc);; GeoSys Initial Condition (*.ic);; GeoSys Source Condition (*.st)"); + this->selectionModel()->currentIndex()); + QString fileName = + QFileDialog::getSaveFileName(nullptr, "Save FEM Conditions as", "", + "OpenGeoSys FEM Condition file (*.cnd);; " + "GeoSys Boundary Condition (*.bc);; " + "GeoSys Initial Condition (*.ic);; " + "GeoSys Source Condition (*.st)"); emit saveFEMConditionsRequested(item->data(0).toString(), fileName); } */ diff --git a/BaseLib/TemplateLogogFormatterSuppressedGCC-impl.h b/BaseLib/TemplateLogogFormatterSuppressedGCC-impl.h index 97fc1ca1ffc..43cb85993cb 100644 --- a/BaseLib/TemplateLogogFormatterSuppressedGCC-impl.h +++ b/BaseLib/TemplateLogogFormatterSuppressedGCC-impl.h @@ -80,7 +80,7 @@ TemplateLogogFormatterSuppressedGCC<T_SUPPPRESS_TOPIC_FLAG> } if ( target.GetNullTerminatesStrings() ) - m_sMessageBuffer.append( (LOGOG_CHAR)NULL ); + m_sMessageBuffer.append((LOGOG_CHAR)'\0'); return m_sMessageBuffer; } diff --git a/GeoLib/IO/Legacy/OGSIOVer4.cpp b/GeoLib/IO/Legacy/OGSIOVer4.cpp index 8503ced9c15..a78e6c5ba9a 100644 --- a/GeoLib/IO/Legacy/OGSIOVer4.cpp +++ b/GeoLib/IO/Legacy/OGSIOVer4.cpp @@ -163,7 +163,6 @@ std::string readPolyline(std::istream &in, in >> line; if (line.find("$ID") != std::string::npos) // subkeyword found CC in >> line; // read value - // id = strtol(line_string.data(), NULL, 0); //.................................................................... if (line.find("$NAME") != std::string::npos) // subkeyword found { @@ -292,7 +291,6 @@ std::string readSurface(std::istream &in, in >> line; if (line.find("$ID") != std::string::npos) // subkeyword found CC in >> line; // read value - // id = strtol(line_string.data(), NULL, 0); //.................................................................... if (line.find("$NAME") != std::string::npos) // subkeyword found { diff --git a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp index a34c86ffd93..045bb5d208f 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp @@ -106,7 +106,7 @@ int XmlGmlInterface::readFile(const QString &fileName) { readPoints(type_node, points.get(), pnt_names.get()); - // if names-map is empty, set it to NULL because it is not needed + // if names-map is empty, set it to nullptr because it is not needed if (pnt_names->empty()) { pnt_names.reset(nullptr); @@ -120,7 +120,7 @@ int XmlGmlInterface::readFile(const QString &fileName) type_node, polylines.get(), *_geo_objs.getPointVec(gliName), _geo_objs.getPointVecObj(gliName)->getIDMap(), ply_names.get()); - // if names-map is empty, set it to NULL because it is not needed + // if names-map is empty, set it to nullptr because it is not needed if (ply_names->empty()) { ply_names.reset(nullptr); @@ -132,7 +132,7 @@ int XmlGmlInterface::readFile(const QString &fileName) type_node, surfaces.get(), *_geo_objs.getPointVec(gliName), _geo_objs.getPointVecObj(gliName)->getIDMap(), sfc_names.get()); - // if names-map is empty, set it to NULL because it is not needed + // if names-map is empty, set it to nullptr because it is not needed if (sfc_names->empty()) { sfc_names.reset(nullptr); -- GitLab