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

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

View File

@ -137,7 +137,7 @@ Foam::tmp<Foam::scalarField> Foam::sampledSurface::sample
) const
{
NotImplemented;
return tmp<scalarField>();
return nullptr;
}
@ -147,7 +147,7 @@ Foam::tmp<Foam::vectorField> Foam::sampledSurface::sample
) const
{
NotImplemented;
return tmp<vectorField>();
return nullptr;
}
@ -157,7 +157,7 @@ Foam::tmp<Foam::sphericalTensorField> Foam::sampledSurface::sample
) const
{
NotImplemented;
return tmp<sphericalTensorField>();
return nullptr;
}
@ -167,7 +167,7 @@ Foam::tmp<Foam::symmTensorField> Foam::sampledSurface::sample
) const
{
NotImplemented;
return tmp<symmTensorField>();
return nullptr;
}
@ -177,7 +177,7 @@ Foam::tmp<Foam::tensorField> Foam::sampledSurface::sample
) const
{
NotImplemented;
return tmp<tensorField>();
return nullptr;
}

View File

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

View File

@ -103,7 +103,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>();
return nullptr;
}
//- Sample field on surface
@ -119,7 +119,7 @@ public:
) const
{
NotImplemented;
return tmp<sphericalTensorField>();
return nullptr;
}
//- Sample field on surface
@ -129,7 +129,7 @@ public:
) const
{
NotImplemented;
return tmp<symmTensorField>();
return nullptr;
}
//- Sample field on surface
@ -139,7 +139,7 @@ public:
) const
{
NotImplemented;
return tmp<tensorField>();
return nullptr;
}
//- Interpolate field on surface
@ -149,7 +149,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>();
return nullptr;
}
//- Interpolate field on surface
@ -165,7 +165,7 @@ public:
) const
{
NotImplemented;
return tmp<sphericalTensorField>();
return nullptr;
}
//- Interpolate field on surface
@ -175,7 +175,7 @@ public:
) const
{
NotImplemented;
return tmp<symmTensorField>();
return nullptr;
}
//- Interpolate field on surface
@ -185,7 +185,7 @@ public:
) const
{
NotImplemented;
return tmp<tensorField>();
return nullptr;
}
};

View File

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

View File

@ -120,10 +120,8 @@ Foam::discreteSurface::sampleType
const VolFieldType& fld = mesh().lookupObject<VolFieldType>(fieldName);
return sampleField(fld);
}
else
{
return tmp<Field<Type>>();
}
return nullptr;
}