(clang-tidy) : modernize-use-nullptr

This commit is contained in:
Magne Sjaastad
2018-02-18 18:22:23 +01:00
parent cfb75ecc34
commit 69875eec8f
6 changed files with 22 additions and 22 deletions

View File

@@ -365,7 +365,7 @@ void RigFemPart::findIntersectingCells(const cvf::BoundingBox& inputBB, std::vec
}
m_elementSearchTree = new cvf::BoundingBoxTree;
m_elementSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, NULL);
m_elementSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, nullptr);
}
m_elementSearchTree->findIntersections(inputBB, elementIndices);

View File

@@ -1919,7 +1919,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
return resFrames;
}
return NULL;
return nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -128,5 +128,5 @@ RimWellPathEntry* RimOilFieldEntry::find(const QString& name, RimWellPathEntry::
}
}
return NULL;
return nullptr;
}

View File

@@ -115,8 +115,8 @@ void RimWellPathImport::updateRegions(const QStringList& regionStrings, const QS
for (int i = 0; i < regionStrings.size(); i++)
{
RimOilRegionEntry* oilRegionEntry = NULL;
RimOilFieldEntry* oilFieldEntry = NULL;
RimOilRegionEntry* oilRegionEntry = nullptr;
RimOilFieldEntry* oilFieldEntry = nullptr;
for (size_t regionIdx = 0; regionIdx < this->regions.size(); regionIdx++)
{

View File

@@ -127,7 +127,7 @@ void RiuWellImportWizard::issueHttpRequestToFile(QString completeUrlText, QStrin
tr("Unable to save the file %1: %2.")
.arg(destinationFileName).arg(m_file->errorString()));
delete m_file;
m_file = 0;
m_file = nullptr;
return;
}
@@ -156,7 +156,7 @@ void RiuWellImportWizard::httpFinished()
m_file->close();
m_file->remove();
delete m_file;
m_file = 0;
m_file = nullptr;
}
m_reply->deleteLater();
m_myProgressDialog->hide();
@@ -231,9 +231,9 @@ void RiuWellImportWizard::httpFinished()
}
m_reply->deleteLater();
m_reply = 0;
m_reply = nullptr;
delete m_file;
m_file = 0;
m_file = nullptr;
if (m_currentDownloadState == DOWNLOAD_WELLS || m_currentDownloadState == DOWNLOAD_WELL_PATH)
{
@@ -446,7 +446,7 @@ void RiuWellImportWizard::downloadWellPaths()
{
WellSelectionPage* wellSelectionPage = dynamic_cast<WellSelectionPage*>(page(m_wellSelectionPageId));
std::vector<DownloadEntity> downloadEntities;
wellSelectionPage->selectedWellPathEntries(downloadEntities, NULL);
wellSelectionPage->selectedWellPathEntries(downloadEntities, nullptr);
for (size_t i = 0; i < downloadEntities.size(); i++)
{
@@ -537,7 +537,7 @@ QStringList RiuWellImportWizard::absoluteFilePathsToWellPaths() const
WellSelectionPage* wellSelectionPage = dynamic_cast<WellSelectionPage*>(page(m_wellSelectionPageId));
std::vector<DownloadEntity> downloadEntities;
wellSelectionPage->selectedWellPathEntries(downloadEntities, NULL);
wellSelectionPage->selectedWellPathEntries(downloadEntities, nullptr);
for (size_t i = 0; i < downloadEntities.size(); i++)
{
@@ -787,7 +787,7 @@ void FieldSelectionPage::initializePage()
//--------------------------------------------------------------------------------------------------
FieldSelectionPage::~FieldSelectionPage()
{
m_propertyView->showProperties(NULL);
m_propertyView->showProperties(nullptr);
}
@@ -915,7 +915,7 @@ WellSelectionPage::~WellSelectionPage()
{
if (m_wellSelectionTreeView)
{
m_wellSelectionTreeView->setPdmItem(NULL);
m_wellSelectionTreeView->setPdmItem(nullptr);
}
delete m_regionsWithVisibleWells;
}
@@ -926,7 +926,7 @@ WellSelectionPage::~WellSelectionPage()
//--------------------------------------------------------------------------------------------------
void WellSelectionPage::selectedWellPathEntries(std::vector<DownloadEntity>& downloadEntities, caf::PdmObjectHandle* objHandle)
{
if (objHandle == NULL)
if (objHandle == nullptr)
{
objHandle = m_regionsWithVisibleWells;
}
@@ -968,8 +968,8 @@ void WellSelectionPage::selectedWellPathEntries(std::vector<DownloadEntity>& dow
//--------------------------------------------------------------------------------------------------
bool lessByDescription(const caf::PdmPointer<caf::PdmObjectHandle>& obj1, const caf::PdmPointer<caf::PdmObjectHandle>& obj2)
{
caf::PdmUiFieldHandle* uiFieldHandle1 = NULL;
caf::PdmUiFieldHandle* uiFieldHandle2 = NULL;
caf::PdmUiFieldHandle* uiFieldHandle1 = nullptr;
caf::PdmUiFieldHandle* uiFieldHandle2 = nullptr;
if (obj1.notNull() && obj1->uiCapability() && obj1->uiCapability()->userDescriptionField())
{
@@ -1053,7 +1053,7 @@ void WellSummaryPage::updateSummaryPage()
RiuWellImportWizard* wiz = dynamic_cast<RiuWellImportWizard*>(wizard());
WellSelectionPage* wellSelectionPage = dynamic_cast<WellSelectionPage*>(wiz->page(wiz->wellSelectionPageId()));
std::vector<DownloadEntity> downloadEntities;
wellSelectionPage->selectedWellPathEntries(downloadEntities, NULL);
wellSelectionPage->selectedWellPathEntries(downloadEntities, nullptr);
for (size_t i = 0; i < downloadEntities.size(); i++)
{

View File

@@ -57,7 +57,7 @@ class AuthenticationPage : public QWizardPage
Q_OBJECT
public:
AuthenticationPage(const QString& webServiceAddress, QWidget *parent = 0);
AuthenticationPage(const QString& webServiceAddress, QWidget *parent = nullptr);
virtual void initializePage();
};
@@ -71,7 +71,7 @@ class FieldSelectionPage : public QWizardPage
Q_OBJECT
public:
FieldSelectionPage(RimWellPathImport* wellPathImport, QWidget* parent = 0);
FieldSelectionPage(RimWellPathImport* wellPathImport, QWidget* parent = nullptr);
~FieldSelectionPage();
virtual void initializePage();
@@ -127,7 +127,7 @@ class WellSelectionPage : public QWizardPage
Q_OBJECT
public:
WellSelectionPage(RimWellPathImport* wellPathImport, QWidget* parent = 0);
WellSelectionPage(RimWellPathImport* wellPathImport, QWidget* parent = nullptr);
~WellSelectionPage();
virtual void initializePage();
@@ -153,7 +153,7 @@ class WellSummaryPage : public QWizardPage
Q_OBJECT
public:
WellSummaryPage(RimWellPathImport* wellPathImport, QWidget* parent = 0);
WellSummaryPage(RimWellPathImport* wellPathImport, QWidget* parent = nullptr);
virtual void initializePage();
@@ -182,7 +182,7 @@ public:
enum DownloadState{ DOWNLOAD_FIELDS, DOWNLOAD_WELLS, DOWNLOAD_WELL_PATH, DOWNLOAD_UNDEFINED};
public:
RiuWellImportWizard(const QString& webServiceAddress, const QString& downloadFolder, RimWellPathImport* wellPathImportObject, QWidget *parent = 0);
RiuWellImportWizard(const QString& webServiceAddress, const QString& downloadFolder, RimWellPathImport* wellPathImportObject, QWidget *parent = nullptr);
~RiuWellImportWizard();
void setCredentials(const QString& username, const QString& password);