(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

@@ -96,9 +96,9 @@ void RivFemElmVisibilityCalculator::computePropertyVisibility(cvf::UByteArray* c
const cvf::UByteArray* rangeFilterVisibility,
RimGeoMechPropertyFilterCollection* propFilterColl)
{
CVF_ASSERT(cellVisibility != NULL);
CVF_ASSERT(rangeFilterVisibility != NULL);
CVF_ASSERT(propFilterColl != NULL);
CVF_ASSERT(cellVisibility != nullptr);
CVF_ASSERT(rangeFilterVisibility != nullptr);
CVF_ASSERT(propFilterColl != nullptr);
CVF_ASSERT(grid->elementCount() > 0);
CVF_ASSERT(rangeFilterVisibility->size() == static_cast<size_t>(grid->elementCount()));
@@ -255,8 +255,8 @@ void RivFemElmVisibilityCalculator::computeOverriddenCellVisibility(cvf::UByteAr
const RigFemPart* femPart,
RimViewController* masterViewLink)
{
CVF_ASSERT(elmVisibilities != NULL);
CVF_ASSERT(femPart != NULL);
CVF_ASSERT(elmVisibilities != nullptr);
CVF_ASSERT(femPart != nullptr);
RimGridView* masterView = masterViewLink->ownerViewLinker()->masterView();
cvf::ref<cvf::UByteArray> totCellVisibility = masterView->currentTotalCellVisibility();

View File

@@ -69,7 +69,7 @@ ref<DrawableGeo> RivFemPartGeometryGenerator::generateSurface()
CVF_ASSERT(m_quadVertices.notNull());
if (m_quadVertices->size() == 0) return NULL;
if (m_quadVertices->size() == 0) return nullptr;
ref<DrawableGeo> geo = new DrawableGeo;
geo->setFromQuadVertexArray(m_quadVertices.p());
@@ -85,7 +85,7 @@ ref<DrawableGeo> RivFemPartGeometryGenerator::generateSurface()
//--------------------------------------------------------------------------------------------------
ref<DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawable()
{
if (!(m_quadVertices.notNull() && m_quadVertices->size() != 0)) return NULL;
if (!(m_quadVertices.notNull() && m_quadVertices->size() != 0)) return nullptr;
ref<DrawableGeo> geo = new DrawableGeo;
geo->setVertexArray(m_quadVertices.p());
@@ -105,7 +105,7 @@ ref<DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawable()
//--------------------------------------------------------------------------------------------------
ref<DrawableGeo> RivFemPartGeometryGenerator::createOutlineMeshDrawable(double creaseAngle)
{
if (!(m_quadVertices.notNull() && m_quadVertices->size() != 0)) return NULL;
if (!(m_quadVertices.notNull() && m_quadVertices->size() != 0)) return nullptr;
cvf::OutlineEdgeExtractor ee(creaseAngle, *m_quadVertices);
@@ -115,7 +115,7 @@ ref<DrawableGeo> RivFemPartGeometryGenerator::createOutlineMeshDrawable(double c
ref<cvf::UIntArray> lineIndices = ee.lineIndices();
if (lineIndices->size() == 0)
{
return NULL;
return nullptr;
}
ref<PrimitiveSetIndexedUInt> prim = new PrimitiveSetIndexedUInt(PT_LINES);
@@ -333,7 +333,7 @@ cvf::ref<cvf::DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawableFromSi
quadVertices->assign(vertices);
}
if (!(quadVertices.notNull() && quadVertices->size() != 0)) return NULL;
if (!(quadVertices.notNull() && quadVertices->size() != 0)) return nullptr;
ref<DrawableGeo> geo = new DrawableGeo;
geo->setVertexArray(quadVertices.p());

View File

@@ -104,7 +104,7 @@ void RivFemPartPartMgr::generatePartGeometry(RivFemPartGeometryGenerator& geoBui
bool useBufferObjects = true;
// Surface geometry
{
m_surfaceFaces = NULL; // To possibly free memory before adding the new stuff
m_surfaceFaces = nullptr; // To possibly free memory before adding the new stuff
cvf::ref<cvf::DrawableGeo> geo = geoBuilder.generateSurface();
if (geo.notNull())
@@ -139,7 +139,7 @@ void RivFemPartPartMgr::generatePartGeometry(RivFemPartGeometryGenerator& geoBui
// Mesh geometry
{
m_surfaceGridLines = NULL; // To possibly free memory before adding the new stuff
m_surfaceGridLines = nullptr; // To possibly free memory before adding the new stuff
cvf::ref<cvf::DrawableGeo> geoMesh = geoBuilder.createMeshDrawable();
if (geoMesh.notNull())
@@ -176,7 +176,7 @@ void RivFemPartPartMgr::generatePartGeometry(RivFemPartGeometryGenerator& geoBui
//--------------------------------------------------------------------------------------------------
void RivFemPartPartMgr::appendPartsToModel(cvf::ModelBasicList* model)
{
CVF_ASSERT(model != NULL);
CVF_ASSERT(model != nullptr);
if(m_surfaceFaces.notNull() ) model->addPart(m_surfaceFaces.p() );
if(m_surfaceGridLines.notNull()) model->addPart(m_surfaceGridLines.p());
@@ -250,7 +250,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, m_gridIdx, (int)timeStepIndex);
const std::vector<size_t>* vxToResultMapping = NULL;
const std::vector<size_t>* vxToResultMapping = nullptr;
int vxCount = 0;
if (resVarAddress.resultPosType == RIG_NODAL)
@@ -313,7 +313,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
}
}
Rim3dView* view = NULL;
Rim3dView* view = nullptr;
cellResultColors->firstAncestorOrThisOfType(view);
CVF_ASSERT(view);

View File

@@ -205,7 +205,7 @@ RivGeoMechPartMgr* RivGeoMechVizLogic::getUpdatedPartMgr(RivGeoMechPartMgrCache:
}
else if (pMgrKey.geometryType() == PROPERTY_FILTERED)
{
RivGeoMechPartMgr* rangefiltered = NULL;
RivGeoMechPartMgr* rangefiltered = nullptr;
if (m_geomechView->rangeFilterCollection()->hasActiveFilters())
{
rangefiltered = getUpdatedPartMgr(RivGeoMechPartMgrCache::Key(RANGE_FILTERED, -1));