Commit 018124e3 authored by Mark Olesen's avatar Mark Olesen
Browse files

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.
parent 2f86cdc7
......@@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>();
return nullptr;
}
......
......@@ -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;
}
......
......@@ -205,7 +205,7 @@ Foam::phaseModel::~phaseModel()
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>();
return nullptr;
}
......
......@@ -68,7 +68,7 @@ Foam::phase::phase
Foam::autoPtr<Foam::phase> Foam::phase::clone() const
{
NotImplemented;
return autoPtr<phase>();
return nullptr;
}
......
......@@ -65,7 +65,7 @@ template<class BasePhaseModel>
Foam::tmp<Foam::fvScalarMatrix>
Foam::IsothermalPhaseModel<BasePhaseModel>::heEqn()
{
return tmp<fvScalarMatrix>();
return nullptr;
}
......
......@@ -152,7 +152,7 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn
)
)
{
return tmp<fvScalarMatrix>();
return nullptr;
}
const volScalarField& alpha = *this;
......
......@@ -57,8 +57,7 @@ Foam::PurePhaseModel<BasePhaseModel>::YiEqn
)
{
NotImplemented;
return tmp<fvScalarMatrix>();
return nullptr;
}
......
......@@ -77,7 +77,7 @@ Foam::phaseModel::phaseModel
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>();
return nullptr;
}
......
......@@ -115,7 +115,7 @@ public:
autoPtr<IATEsource> clone() const
{
NotImplemented;
return autoPtr<IATEsource>();
return nullptr;
}
......
......@@ -114,7 +114,7 @@ public:
autoPtr<IATEsource> clone() const
{
NotImplemented;
return autoPtr<IATEsource>();
return nullptr;
}
......
......@@ -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);
}
......
......@@ -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;
}
};
......
......@@ -109,7 +109,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>();
return nullptr;
}
......
......@@ -86,7 +86,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>();
return nullptr;
}
......
......@@ -79,7 +79,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>();
return nullptr;
}
......
......@@ -251,7 +251,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
{
return autoPtr<mapPolyMesh>();
return nullptr;
}
polyTopoChange meshMod(mesh);
......
......@@ -71,7 +71,7 @@ autoPtr<GeoFieldType> loadField
);
}
return autoPtr<GeoFieldType>();
return nullptr;
}
......
......@@ -76,7 +76,7 @@ public:
autoPtr<searchableSurfaceModifier> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceModifier>();
return nullptr;
}
......
......@@ -100,7 +100,7 @@ public:
autoPtr<searchableSurfaceModifier> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceModifier>();
return nullptr;
}
......
......@@ -96,7 +96,7 @@ public:
autoPtr<searchableSurfaceModifier> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceModifier>();
return nullptr;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment