mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -217,7 +217,7 @@ public:
|
||||
autoPtr<sampledSet> clone() const
|
||||
{
|
||||
NotImplemented;
|
||||
return autoPtr<sampledSet>();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -205,7 +205,7 @@ public:
|
||||
autoPtr<sampledSurface> clone() const
|
||||
{
|
||||
NotImplemented;
|
||||
return autoPtr<sampledSurface>();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ public:
|
||||
autoPtr<surfMeshSampler> clone() const
|
||||
{
|
||||
NotImplemented;
|
||||
return autoPtr<surfMeshSampler>();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -120,10 +120,8 @@ Foam::discreteSurface::sampleType
|
||||
const VolFieldType& fld = mesh().lookupObject<VolFieldType>(fieldName);
|
||||
return sampleField(fld);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<Field<Type>>();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user