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;
}