STYLE: use 'return nullptr' for empty autoPtr/tmp returns

- both autoPtr and tmp are defined with an implicit construct from
  nullptr (but with explicit construct from a pointer to null).
  Thus is it safe to use 'nullptr' when returning an empty autoPtr or tmp.
This commit is contained in:
Mark Olesen
2018-03-21 09:31:09 +01:00
parent 2f86cdc712
commit 018124e3bf
68 changed files with 109 additions and 117 deletions

View File

@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>();
return nullptr;
}

View File

@ -259,7 +259,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::THE
) const
{
NotImplemented;
return tmp<Foam::scalarField>();
return nullptr;
}
@ -272,7 +272,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::THE
) const
{
NotImplemented;
return tmp<Foam::scalarField>();
return nullptr;
}
@ -436,8 +436,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::Cpv
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::CpByCpv() const
{
NotImplemented;
return tmp<Foam::volScalarField>();
NotImplemented;
return nullptr;
}
@ -448,8 +448,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::CpByCpv
const label patchi
) const
{
NotImplemented;
return tmp<Foam::scalarField>();
NotImplemented;
return nullptr;
}

View File

@ -205,7 +205,7 @@ Foam::phaseModel::~phaseModel()
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>();
return nullptr;
}

View File

@ -68,7 +68,7 @@ Foam::phase::phase
Foam::autoPtr<Foam::phase> Foam::phase::clone() const
{
NotImplemented;
return autoPtr<phase>();
return nullptr;
}

View File

@ -65,7 +65,7 @@ template<class BasePhaseModel>
Foam::tmp<Foam::fvScalarMatrix>
Foam::IsothermalPhaseModel<BasePhaseModel>::heEqn()
{
return tmp<fvScalarMatrix>();
return nullptr;
}

View File

@ -152,7 +152,7 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn
)
)
{
return tmp<fvScalarMatrix>();
return nullptr;
}
const volScalarField& alpha = *this;

View File

@ -57,8 +57,7 @@ Foam::PurePhaseModel<BasePhaseModel>::YiEqn
)
{
NotImplemented;
return tmp<fvScalarMatrix>();
return nullptr;
}

View File

@ -77,7 +77,7 @@ Foam::phaseModel::phaseModel
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>();
return nullptr;
}

View File

@ -115,7 +115,7 @@ public:
autoPtr<IATEsource> clone() const
{
NotImplemented;
return autoPtr<IATEsource>();
return nullptr;
}

View File

@ -114,7 +114,7 @@ public:
autoPtr<IATEsource> clone() const
{
NotImplemented;
return autoPtr<IATEsource>();
return nullptr;
}

View File

@ -794,14 +794,12 @@ Foam::DistributedDelaunayMesh<Triangulation>::distribute
{
if (!Pstream::parRun())
{
return autoPtr<mapDistribute>();
return nullptr;
}
distributeBoundBoxes(decomposition.procBounds());
autoPtr<mapDistribute> mapDist = decomposition.distributePoints(points);
return mapDist;
return decomposition.distributePoints(points);
}

View File

@ -101,7 +101,7 @@ public:
virtual autoPtr<searchableSurfaceFeatures> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceFeatures>();
return nullptr;
}
@ -139,7 +139,7 @@ public:
//- Return an extendedFeatureEdgeMesh containing the features
virtual autoPtr<extendedFeatureEdgeMesh> features() const
{
return autoPtr<extendedFeatureEdgeMesh>();
return nullptr;
}
};

View File

@ -109,7 +109,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>();
return nullptr;
}

View File

@ -86,7 +86,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>();
return nullptr;
}

View File

@ -79,7 +79,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>();
return nullptr;
}

View File

@ -251,7 +251,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
{
return autoPtr<mapPolyMesh>();
return nullptr;
}
polyTopoChange meshMod(mesh);

View File

@ -71,7 +71,7 @@ autoPtr<GeoFieldType> loadField
);
}
return autoPtr<GeoFieldType>();
return nullptr;
}

View File

@ -76,7 +76,7 @@ public:
autoPtr<searchableSurfaceModifier> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceModifier>();
return nullptr;
}

View File

@ -100,7 +100,7 @@ public:
autoPtr<searchableSurfaceModifier> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceModifier>();
return nullptr;
}

View File

@ -96,7 +96,7 @@ public:
autoPtr<searchableSurfaceModifier> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceModifier>();
return nullptr;
}