(clang-tidy) : modernize-use-nullptr

This commit is contained in:
Magne Sjaastad
2018-02-18 18:56:43 +01:00
parent 69875eec8f
commit 1ae30ef11a
195 changed files with 552 additions and 552 deletions

View File

@@ -38,7 +38,7 @@ RigActiveCellsResultAccessor::RigActiveCellsResultAccessor(const RigGridBase* gr
//--------------------------------------------------------------------------------------------------
double RigActiveCellsResultAccessor::cellScalar(size_t gridLocalCellIndex) const
{
if (m_reservoirResultValues == NULL || m_reservoirResultValues->size() == 0 ) return HUGE_VAL;
if (m_reservoirResultValues == nullptr || m_reservoirResultValues->size() == 0 ) return HUGE_VAL;
size_t reservoirCellIndex = m_grid->reservoirCellIndex(gridLocalCellIndex);
size_t resultValueIndex = m_activeCellInfo->cellResultIndex(reservoirCellIndex);
@@ -65,7 +65,7 @@ double RigActiveCellsResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, c
//--------------------------------------------------------------------------------------------------
double RigActiveCellsResultAccessor::cellScalarGlobIdx(size_t reservoirCellIndex) const
{
if (m_reservoirResultValues == NULL || m_reservoirResultValues->size() == 0) return HUGE_VAL;
if (m_reservoirResultValues == nullptr || m_reservoirResultValues->size() == 0) return HUGE_VAL;
size_t resultValueIndex = m_activeCellInfo->cellResultIndex(reservoirCellIndex);
if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL;

View File

@@ -44,9 +44,9 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigCaseCellResultsData::RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData) : m_activeCellInfo(NULL)
RigCaseCellResultsData::RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData) : m_activeCellInfo(nullptr)
{
CVF_ASSERT(ownerCaseData != NULL);
CVF_ASSERT(ownerCaseData != nullptr);
CVF_ASSERT(ownerCaseData->mainGrid() != nullptr);
m_ownerCaseData = ownerCaseData;
@@ -1316,15 +1316,15 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex)
this->cellScalarResults(soilResultScalarIndex, timeStepIndex).resize(soilResultValueCount);
std::vector<double>* swatForTimeStep = NULL;
std::vector<double>* sgasForTimeStep = NULL;
std::vector<double>* swatForTimeStep = nullptr;
std::vector<double>* sgasForTimeStep = nullptr;
if (scalarIndexSWAT != cvf::UNDEFINED_SIZE_T)
{
swatForTimeStep = &(this->cellScalarResults(scalarIndexSWAT, timeStepIndex));
if (swatForTimeStep->size() == 0)
{
swatForTimeStep = NULL;
swatForTimeStep = nullptr;
}
}
@@ -1333,7 +1333,7 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex)
sgasForTimeStep = &(this->cellScalarResults(scalarIndexSGAS, timeStepIndex));
if (sgasForTimeStep->size() == 0)
{
sgasForTimeStep = NULL;
sgasForTimeStep = nullptr;
}
}
@@ -1405,13 +1405,13 @@ void RigCaseCellResultsData::testAndComputeSgasForTimeStep(size_t timeStepIndex)
this->cellScalarResults(scalarIndexSGAS, timeStepIndex).resize(swatResultValueCount);
std::vector<double>* swatForTimeStep = NULL;
std::vector<double>* swatForTimeStep = nullptr;
{
swatForTimeStep = &(this->cellScalarResults(scalarIndexSWAT, timeStepIndex));
if (swatForTimeStep->size() == 0)
{
swatForTimeStep = NULL;
swatForTimeStep = nullptr;
}
}
@@ -1554,7 +1554,7 @@ void calculateConnectionGeometry(const RigCell& c1, const RigCell& c2, const std
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads(
&polygon,
&intersections,
(cvf::EdgeIntersectStorage<size_t>*)NULL,
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
cvf::wrapArrayConst(&nodes),
face1.data(),
face2.data(),
@@ -1688,7 +1688,7 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
std::vector<double> & permResults = this->cellScalarResults(permResultIdx)[0];
std::vector<double> & riTransResults = this->cellScalarResults(riTransResultIdx)[0];
std::vector<double> * ntgResults = NULL;
std::vector<double> * ntgResults = nullptr;
if (hasNTGResults)
{
ntgResults = &(this->cellScalarResults(ntgResultIdx)[0]);
@@ -1699,9 +1699,9 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
riTransResults.resize(resultValueCount);
// Prepare how to index the result values:
ResultIndexFunction riTranIdxFunc = NULL;
ResultIndexFunction permIdxFunc = NULL;
ResultIndexFunction ntgIdxFunc = NULL;
ResultIndexFunction riTranIdxFunc = nullptr;
ResultIndexFunction permIdxFunc = nullptr;
ResultIndexFunction ntgIdxFunc = nullptr;
{
bool isPermUsingResIdx = this->isUsingGlobalActiveIndex(permResultIdx);
bool isTransUsingResIdx = this->isUsingGlobalActiveIndex(riTransResultIdx);
@@ -1841,17 +1841,17 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
std::vector<double> & riCombTransResults = m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombTrans());
m_ownerMainGrid->nncData()->setScalarResultIndex(RigNNCData::propertyNameRiCombTrans(), riCombTransScalarResultIndex);
std::vector<double> * ntgResults = NULL;
std::vector<double> * ntgResults = nullptr;
if (hasNTGResults)
{
ntgResults = &(this->cellScalarResults(ntgResultIdx)[0]);
}
// Prepare how to index the result values:
ResultIndexFunction permXIdxFunc = NULL;
ResultIndexFunction permYIdxFunc = NULL;
ResultIndexFunction permZIdxFunc = NULL;
ResultIndexFunction ntgIdxFunc = NULL;
ResultIndexFunction permXIdxFunc = nullptr;
ResultIndexFunction permYIdxFunc = nullptr;
ResultIndexFunction permZIdxFunc = nullptr;
ResultIndexFunction ntgIdxFunc = nullptr;
{
bool isPermXUsingResIdx = this->isUsingGlobalActiveIndex(permXResultIdx);
bool isPermYUsingResIdx = this->isUsingGlobalActiveIndex(permYResultIdx);
@@ -1884,7 +1884,7 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
size_t neighborResvCellIdx = nncConnections[connIdx].m_c2GlobIdx;
cvf::StructGridInterface::FaceType faceId = nncConnections[connIdx].m_c1Face;
ResultIndexFunction permIdxFunc = NULL;
ResultIndexFunction permIdxFunc = nullptr;
std::vector<double> * permResults;
switch (faceId)

View File

@@ -74,7 +74,7 @@ public:
// Access meta-information about the results
size_t resultCount() const;
size_t timeStepCount(size_t scalarResultIndex) const;
size_t maxTimeStepCount(size_t* scalarResultIndex = NULL) const;
size_t maxTimeStepCount(size_t* scalarResultIndex = nullptr) const;
QStringList resultNames(RiaDefines::ResultCatType type) const;
bool isUsingGlobalActiveIndex(size_t scalarResultIndex) const;
bool hasFlowDiagUsableFluxes() const;

View File

@@ -31,8 +31,8 @@
RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigMainGrid* masterEclGrid, RigMainGrid* dependentEclGrid)
: m_masterGrid(masterEclGrid),
m_dependentGrid(dependentEclGrid),
m_masterFemPart(NULL),
m_dependentFemPart(NULL)
m_masterFemPart(nullptr),
m_dependentFemPart(nullptr)
{
m_masterCellOrIntervalIndex.resize(dependentEclGrid->globalCellArray().size(), cvf::UNDEFINED_INT);
@@ -42,10 +42,10 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigMainGrid* masterEclGrid, Rig
///
//--------------------------------------------------------------------------------------------------
RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigMainGrid* dependentEclGrid)
: m_masterGrid(NULL),
: m_masterGrid(nullptr),
m_dependentGrid(dependentEclGrid),
m_masterFemPart(masterFemPart),
m_dependentFemPart(NULL)
m_dependentFemPart(nullptr)
{
m_masterCellOrIntervalIndex.resize(dependentEclGrid->globalCellArray().size(), cvf::UNDEFINED_INT);
this->calculateEclToGeomCellMapping(dependentEclGrid, masterFemPart, false);
@@ -55,8 +55,8 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigM
///
//--------------------------------------------------------------------------------------------------
RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigFemPart* dependentFemPart)
: m_masterGrid(NULL),
m_dependentGrid(NULL),
: m_masterGrid(nullptr),
m_dependentGrid(nullptr),
m_masterFemPart(masterFemPart),
m_dependentFemPart(dependentFemPart)
{
@@ -69,9 +69,9 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigF
//--------------------------------------------------------------------------------------------------
RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigMainGrid* masterEclGrid, RigFemPart* dependentFemPart)
: m_masterGrid(masterEclGrid),
m_dependentGrid(NULL),
m_dependentGrid(nullptr),
m_masterFemPart(dependentFemPart),
m_dependentFemPart(NULL)
m_dependentFemPart(nullptr)
{
m_masterCellOrIntervalIndex.resize(dependentFemPart->elementCount(), cvf::UNDEFINED_INT);
this->calculateEclToGeomCellMapping(masterEclGrid, dependentFemPart, true);
@@ -87,7 +87,7 @@ const int * RigCaseToCaseCellMapper::masterCaseCellIndices(int dependentCaseRese
if (seriesIndex == cvf::UNDEFINED_INT)
{
(*masterCaseCellIndexCount) = 0;
return NULL;
return nullptr;
}
if (seriesIndex < 0)

View File

@@ -41,12 +41,12 @@ public:
const caf::SizeTArray8* neighborIndices(int offsetI, int offsetJ, int offsetK)
{
if (offsetI < 0 && m_baseI == 0) return NULL;
if (offsetJ < 0 && m_baseJ == 0) return NULL;
if (offsetK < 0 && m_baseK == 0) return NULL;
if (offsetI > 0 && m_baseI == m_mainGrid->cellCountI()-1) return NULL;
if (offsetJ > 0 && m_baseJ == m_mainGrid->cellCountJ()-1) return NULL;
if (offsetK > 0 && m_baseK == m_mainGrid->cellCountK()-1) return NULL;
if (offsetI < 0 && m_baseI == 0) return nullptr;
if (offsetJ < 0 && m_baseJ == 0) return nullptr;
if (offsetK < 0 && m_baseK == 0) return nullptr;
if (offsetI > 0 && m_baseI == m_mainGrid->cellCountI()-1) return nullptr;
if (offsetJ > 0 && m_baseJ == m_mainGrid->cellCountJ()-1) return nullptr;
if (offsetK > 0 && m_baseK == m_mainGrid->cellCountK()-1) return nullptr;
size_t gridLocalCellIndex = m_mainGrid->cellIndexFromIJK(m_baseI + offsetI, m_baseJ + offsetJ, m_baseK + offsetK);
const RigCell& cell = m_mainGrid->globalCellArray()[gridLocalCellIndex];

View File

@@ -40,8 +40,8 @@ static size_t undefinedCornersArray[8] = {cvf::UNDEFINED_SIZE_T,
RigCell::RigCell() :
m_parentCellIndex(cvf::UNDEFINED_SIZE_T),
m_mainGridCellIndex(cvf::UNDEFINED_SIZE_T),
m_subGrid(NULL),
m_hostGrid(NULL),
m_subGrid(nullptr),
m_hostGrid(nullptr),
m_isInvalid(false),
m_gridLocalCellIndex(cvf::UNDEFINED_SIZE_T),
m_coarseningBoxIndex(cvf::UNDEFINED_SIZE_T)
@@ -309,7 +309,7 @@ cvf::Vec3d RigCell::faceNormalWithAreaLenght(cvf::StructGridInterface::FaceType
//--------------------------------------------------------------------------------------------------
int RigCell::firstIntersectionPoint(const cvf::Ray& ray, cvf::Vec3d* intersectionPoint) const
{
CVF_ASSERT(intersectionPoint != NULL);
CVF_ASSERT(intersectionPoint != nullptr);
cvf::ubyte faceVertexIndices[4];
int face;

View File

@@ -56,7 +56,7 @@ double RigCellEdgeResultAccessor::cellScalar(size_t gridLocalCellIndex) const
double RigCellEdgeResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const
{
const RigResultAccessor* resultAccessObj = m_resultAccessObjects[faceId].p();
if (resultAccessObj != NULL)
if (resultAccessObj != nullptr)
{
return resultAccessObj->cellFaceScalar(gridLocalCellIndex, faceId);
}
@@ -82,7 +82,7 @@ double RigCellEdgeResultAccessor::cellScalarGlobIdx(size_t globCellIndex) const
double RigCellEdgeResultAccessor::cellFaceScalarGlobIdx(size_t globCellIndex, cvf::StructGridInterface::FaceType faceId) const
{
const RigResultAccessor* resultAccessObj = m_resultAccessObjects[faceId].p();
if (resultAccessObj != NULL)
if (resultAccessObj != nullptr)
{
return resultAccessObj->cellFaceScalarGlobIdx(globCellIndex, faceId);
}

View File

@@ -63,7 +63,7 @@ double RigCombTransResultAccessor::cellScalar(size_t gridLocalCellIndex) const
//--------------------------------------------------------------------------------------------------
double RigCombTransResultAccessor::neighborCellTran(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId, const RigResultAccessor* transAccessor) const
{
if (transAccessor != NULL)
if (transAccessor != nullptr)
{
size_t i, j, k, neighborGridCellIdx;
m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);

View File

@@ -32,7 +32,7 @@ RigGridBase::RigGridBase(RigMainGrid* mainGrid):
m_mainGrid(mainGrid),
m_indexToStartOfCells(0)
{
if (mainGrid == NULL)
if (mainGrid == nullptr)
{
m_gridIndex = 0;
m_gridId = 0;
@@ -493,7 +493,7 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible(size_t i, size_t j, size_t k
}
// If the neighbour cell is invisible, we need to draw the face
if ((cellVisibility != NULL) && !(*cellVisibility)[neighborCellIndex])
if ((cellVisibility != nullptr) && !(*cellVisibility)[neighborCellIndex])
{
return true;
}

View File

@@ -58,7 +58,7 @@ RigMainGrid* RigGridManager::findEqualGrid(RigMainGrid* candidateGrid)
return mainGrid;
}
}
return NULL;
return nullptr;
}
@@ -67,7 +67,7 @@ RigMainGrid* RigGridManager::findEqualGrid(RigMainGrid* candidateGrid)
//--------------------------------------------------------------------------------------------------
bool RigGridManager::isEqual(RigMainGrid* gridA, RigMainGrid* gridB)
{
if (gridA == NULL || gridB == NULL) return false;
if (gridA == nullptr || gridB == nullptr) return false;
if (gridA == gridB) return true;

View File

@@ -35,7 +35,7 @@ int RigHexIntersectionTools::lineHexCellIntersection(const cvf::Vec3d p1,
const size_t hexIndex,
std::vector<HexIntersectionInfo>* intersections)
{
CVF_ASSERT(intersections != NULL);
CVF_ASSERT(intersections != nullptr);
std::set<HexIntersectionInfo> uniqueIntersections;

View File

@@ -394,7 +394,7 @@ bool RigLasFileExporter::writeToFolder(const QString& exportFolder)
if (caf::Utils::fileExists(fileName))
{
QString txt = QString("File %1 exists.\n\nDo you want to overwrite the file?").arg(fileName);
int ret = QMessageBox::question(NULL, "LAS File Export",
int ret = QMessageBox::question(nullptr, "LAS File Export",
txt,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes);

View File

@@ -22,7 +22,7 @@
RigLocalGrid::RigLocalGrid(RigMainGrid* mainGrid):
RigGridBase(mainGrid),
m_parentGrid(NULL),
m_parentGrid(nullptr),
m_positionInParentGrid(cvf::UNDEFINED_SIZE_T)
{

View File

@@ -295,7 +295,7 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
size_t neighborReservoirCellIdx;
size_t neighborGridCellIdx;
size_t i, j, k;
RigGridBase* hostGrid = NULL;
RigGridBase* hostGrid = nullptr;
bool firstNO_FAULTFaceForCell = true;
bool isCellActive = true;
@@ -476,7 +476,7 @@ const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace(size_t reservoirC
{
CVF_ASSERT(m_faultsPrCellAcc.notNull());
if (face == cvf::StructGridInterface::NO_FACE) return NULL;
if (face == cvf::StructGridInterface::NO_FACE) return nullptr;
int faultIdx = m_faultsPrCellAcc->faultIdx(reservoirCellIndex, face);
if (faultIdx != RigFaultsPrCellAccumulator::NO_FAULT )
@@ -510,7 +510,7 @@ const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace(size_t reservoirC
}
}
#endif
return NULL;
return nullptr;
}
//--------------------------------------------------------------------------------------------------
@@ -555,7 +555,7 @@ void RigMainGrid::buildCellSearchTree()
}
m_cellSearchTree = new cvf::BoundingBoxTree;
m_cellSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, NULL);
m_cellSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, nullptr);
}
}

View File

@@ -169,7 +169,7 @@ cvf::StructGridInterface::FaceType RigNNCData::calculateCellFaceOverlap(const Ri
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads(
&polygon,
&intersections,
(cvf::EdgeIntersectStorage<size_t>*)NULL,
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
cvf::wrapArrayConst(&mainGrid.nodes()),
face1.data(),
face2.data(),

View File

@@ -359,7 +359,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow(RigMai
if (!actCellInfo->isActive(reservoirCellIndexPosINeighbour)) continue;
if (hostGrid->cell(gridLocalCellIndexPosINeighbour).subGrid() != NULL)
if (hostGrid->cell(gridLocalCellIndexPosINeighbour).subGrid() != nullptr)
{
//subgrid exists in cell, will be handled though NNCs
continue;
@@ -385,7 +385,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow(RigMai
if (!actCellInfo->isActive(reservoirCellIndexPosJNeighbour)) continue;
if (hostGrid->cell(gridLocalCellIndexPosJNeighbour).subGrid() != NULL)
if (hostGrid->cell(gridLocalCellIndexPosJNeighbour).subGrid() != nullptr)
{
//subgrid exists in cell, will be handled though NNCs
continue;
@@ -412,7 +412,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow(RigMai
if (!actCellInfo->isActive(reservoirCellIndexPosKNeighbour)) continue;
if (hostGrid->cell(gridLocalCellIndexPosKNeighbour).subGrid() != NULL)
if (hostGrid->cell(gridLocalCellIndexPosKNeighbour).subGrid() != nullptr)
{
//subgrid exists in cell, will be handled though NNCs
continue;

View File

@@ -298,7 +298,7 @@ bool RigReservoirBuilderMock::inputProperty(RigEclipseCaseData* eclipseCase, con
size_t k;
/* initialize random seed: */
srand ( time(NULL) );
srand ( time(nullptr) );
/* generate secret number: */
int iSecret = rand() % 20 + 1;

View File

@@ -73,13 +73,13 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromNameAndType(cons
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
{
return NULL;
return nullptr;
}
size_t scalarSetIndex = eclipseCase->results(porosityModel)->findScalarResultIndex(resultType, uiResultName);
if (scalarSetIndex == cvf::UNDEFINED_SIZE_T)
{
return NULL;
return nullptr;
}
cvf::ref<RigResultAccessor> derivedCandidate = createDerivedResultAccessor(eclipseCase,
@@ -155,13 +155,13 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeFromUiResultNa
if (!eclipseCase || !eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
{
return NULL;
return nullptr;
}
size_t scalarSetIndex = eclipseCase->results(porosityModel)->findScalarResultIndex(uiResultName);
if (scalarSetIndex == cvf::UNDEFINED_SIZE_T)
{
return NULL;
return nullptr;
}
return createFromResultIdx(eclipseCase, gridIndex, porosityModel, timeStepIndex, scalarSetIndex);
@@ -323,10 +323,10 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultIdx(const
return new RigHugeValResultAccessor;
}
if (!eclipseCase) return NULL;
if (!eclipseCase) return nullptr;
const RigGridBase* grid = eclipseCase->grid(gridIndex);
if (!grid) return NULL;
if (!grid) return nullptr;
const std::vector< std::vector<double> >& scalarSetResults = eclipseCase->results(porosityModel)->cellScalarResults(resultIndex);
@@ -335,7 +335,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultIdx(const
return new RigHugeValResultAccessor;
}
const std::vector<double>* resultValues = NULL;
const std::vector<double>* resultValues = nullptr;
if (timeStepIndex < scalarSetResults.size())
{
resultValues = &(scalarSetResults[timeStepIndex]);

View File

@@ -35,11 +35,11 @@ cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier(RigEc
size_t timeStepIndex,
QString& uiResultName)
{
if (!eclipseCase) return NULL;
if (!eclipseCase) return nullptr;
if (!eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
{
return NULL;
return nullptr;
}
size_t scalarSetIndex = eclipseCase->results(porosityModel)->findScalarResultIndex(uiResultName);
@@ -56,32 +56,32 @@ cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier(RigEc
RiaDefines::PorosityModelType porosityModel,
size_t timeStepIndex, size_t scalarResultIndex)
{
if ( !eclipseCase ) return NULL;
if ( !eclipseCase ) return nullptr;
if (!eclipseCase->results(porosityModel) || !eclipseCase->activeCellInfo(porosityModel))
{
return NULL;
return nullptr;
}
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T)
{
return NULL;
return nullptr;
}
RigGridBase* grid = eclipseCase->grid(gridIndex);
if (!grid)
{
return NULL;
return nullptr;
}
std::vector< std::vector<double> >& scalarSetResults = eclipseCase->results(porosityModel)->cellScalarResults(scalarResultIndex);
if (timeStepIndex >= scalarSetResults.size())
{
return NULL;
return nullptr;
}
std::vector<double>* resultValues = NULL;
std::vector<double>* resultValues = nullptr;
if (timeStepIndex < scalarSetResults.size())
{
resultValues = &(scalarSetResults[timeStepIndex]);

View File

@@ -371,7 +371,7 @@ const RigWellResultPoint* RigWellResultFrame::findResultCell(size_t gridIndex, s
return &m_wellHead;
}
return NULL;
return nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -140,7 +140,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
cvf::Vec3d whIntermediate = whStartPos;
whIntermediate.z() = (whStartPos.z() + whCell.center().z()) / 2.0;
const RigWellResultPoint* prevWellResPoint = NULL;
const RigWellResultPoint* prevWellResPoint = nullptr;
// CVF_ASSERT(isMultiSegmentWell || resBranches.size() <= 1); // TODO : Consider to set isMultiSegmentWell = true;
@@ -158,7 +158,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
const RigWellResultBranch& branch = resBranches[brIdx];
if ( !hasAnyValidDataCells(branch) ) continue;
prevWellResPoint = NULL;
prevWellResPoint = nullptr;
// Find the start the MSW well-branch centerline. Normal wells are started "once" at wellhead in the code above

View File

@@ -58,7 +58,7 @@ static double sg_createAbsentValue(double lowestDataValue)
RigWellLogFile::RigWellLogFile()
: cvf::Object()
{
m_wellLogFile = NULL;
m_wellLogFile = nullptr;
}
//--------------------------------------------------------------------------------------------------
@@ -77,7 +77,7 @@ bool RigWellLogFile::open(const QString& fileName, QString* errorMessage)
{
close();
NRLib::Well* well = NULL;
NRLib::Well* well = nullptr;
try
{
@@ -138,7 +138,7 @@ void RigWellLogFile::close()
if (m_wellLogFile)
{
delete m_wellLogFile;
m_wellLogFile = NULL;
m_wellLogFile = nullptr;
}
m_wellLogChannelNames.clear();

View File

@@ -328,7 +328,7 @@ GeometryTools::inPlaneLineIntersect3D( const cvf::Vec3d& planeNormal,
const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& p3, const cvf::Vec3d& p4,
cvf::Vec3d* intersectionPoint, double* fractionAlongLine1, double* fractionAlongLine2, double tolerance)
{
CVF_ASSERT (intersectionPoint != NULL);
CVF_ASSERT (intersectionPoint != nullptr);
int Z = findClosestAxis(planeNormal);
int X = (Z + 1) % 3;
@@ -762,7 +762,7 @@ EarClipTesselator::EarClipTesselator():
m_X(-1),
m_Y(-1),
m_areaTolerance(1e-12),
m_nodeCoords(NULL)
m_nodeCoords(nullptr)
{
}
@@ -775,7 +775,7 @@ EarClipTesselator::EarClipTesselator():
bool EarClipTesselator::calculateTriangles( std::vector<size_t>* triangleIndices )
{
CVF_ASSERT(m_nodeCoords != NULL);
CVF_ASSERT(m_nodeCoords != nullptr);
CVF_ASSERT(m_X > -1 && m_Y > -1);
size_t numVertices = m_polygonIndices.size();
@@ -1010,7 +1010,7 @@ void FanEarClipTesselator::setCenterNode(size_t centerNodeIndex)
bool FanEarClipTesselator::calculateTriangles(std::vector<size_t>* triangles)
{
CVF_ASSERT(m_centerNodeIndex != std::numeric_limits<size_t>::max());
CVF_ASSERT(m_nodeCoords != NULL);
CVF_ASSERT(m_nodeCoords != nullptr);
CVF_ASSERT(m_X > -1 && m_Y > -1);
size_t nv = m_polygonIndices.size();

View File

@@ -142,7 +142,7 @@ bool GeometryTools::isPointTouchingIndexedPolygon( const cvf::Vec3d& polygonNor
int yBelowVx1 = 0;
const double* vtx0;
const double* vtx1 = NULL;
const double* vtx1 = nullptr;
double dv0;