Update to c++-11 standard: nullptr and compilation flags

This commit is contained in:
Hrvoje Jasak 2019-01-25 16:22:44 +00:00
parent 0da8433b5d
commit c6babd359a
677 changed files with 2344 additions and 3647 deletions

View file

@ -1,11 +1,11 @@
Info<< "Reading thermophysical properties\n" << endl;
volScalarField* pPtr = NULL;
volScalarField* hPtr = NULL;
const volScalarField* TPtr = NULL;
volScalarField* pPtr = nullptr;
volScalarField* hPtr = nullptr;
const volScalarField* TPtr = nullptr;
volScalarField* psisPtr = NULL;
basicThermo* thermoPtr = NULL;
volScalarField* psisPtr = nullptr;
basicThermo* thermoPtr = nullptr;
Switch compressible;

View file

@ -1,11 +1,11 @@
Info<< "Reading thermophysical properties\n" << endl;
volScalarField* pPtr = NULL;
volScalarField* hPtr = NULL;
const volScalarField* TPtr = NULL;
volScalarField* pPtr = nullptr;
volScalarField* hPtr = nullptr;
const volScalarField* TPtr = nullptr;
volScalarField* psisPtr = NULL;
basicThermo* thermoPtr = NULL;
volScalarField* psisPtr = nullptr;
basicThermo* thermoPtr = nullptr;
Switch compressible;

View file

@ -59,7 +59,7 @@ Foam::phase::phase
Foam::autoPtr<Foam::phase> Foam::phase::clone() const
{
notImplemented("phase::clone() const");
return autoPtr<phase>(NULL);
return autoPtr<phase>(nullptr);
}

View file

@ -11,7 +11,7 @@
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("NULL", dimless, 1.0),
dimensionedScalar("nullptr", dimless, 1.0),
"zeroGradient"
);

View file

@ -12,7 +12,7 @@
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("NULL", dimless, 1.0),
dimensionedScalar("nullptr", dimless, 1.0),
"zeroGradient"
);

View file

@ -44,7 +44,7 @@ cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField
)
:
fixedGradientFvPatchVectorField(p, iF),
cohesiveLawPtr_(NULL),
cohesiveLawPtr_(nullptr),
relaxationFactor_(1.0),
traction_(p.size(), vector::zero)
{}
@ -131,10 +131,10 @@ void cohesiveLawFvPatchVectorField::autoMap
const fvPatchFieldMapper& m
)
{
if (cohesiveLawPtr_ == NULL)
if (cohesiveLawPtr_ == nullptr)
{
FatalErrorIn("cohesiveFvPatchVectorField::autoMap")
<< "NULL cohesive law"
<< "nullptr cohesive law"
<< abort(FatalError);
}

View file

@ -53,7 +53,7 @@ cohesiveZoneFvPatchVectorField::cohesiveZoneFvPatchVectorField
directionMixedFvPatchVectorField(p, iF),
UName_("undefined"),
rheologyName_("undefined"),
cohesiveLawPtr_(NULL),
cohesiveLawPtr_(nullptr),
relaxationFactor_(1.0)
{}
@ -161,10 +161,10 @@ void cohesiveZoneFvPatchVectorField::autoMap
const fvPatchFieldMapper& m
)
{
if (cohesiveLawPtr_ == NULL)
if (cohesiveLawPtr_ == nullptr)
{
FatalErrorIn("cohesiveZoneFvPatchVectorField::autoMap")
<< "NULL cohesive law"
<< "nullptr cohesive law"
<< abort(FatalError);
}

View file

@ -13,7 +13,7 @@ volVectorField D
);
autoPtr<volScalarField> Tptr(NULL);
autoPtr<volScalarField> Tptr(nullptr);
if (thermalStress)
{

View file

@ -13,7 +13,7 @@
);
volScalarField* Tptr = NULL;
volScalarField* Tptr = nullptr;
if (thermalStress)
{

View file

@ -1,7 +1,7 @@
label cohesivePatchID = -1;
solidCohesiveFvPatchVectorField* cohesivePatchUPtr = NULL;
solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = NULL;
solidCohesiveFvPatchVectorField* cohesivePatchUPtr = nullptr;
solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = nullptr;
forAll (U.boundaryField(), patchI)
{

View file

@ -1,4 +1,4 @@
OFstream* filePtr(NULL);
OFstream* filePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,7 +1,7 @@
label cohesivePatchID = -1;
solidCohesiveFvPatchVectorField* cohesivePatchDUPtr = NULL;
solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchDUFixedModePtr = NULL;
solidCohesiveFvPatchVectorField* cohesivePatchDUPtr = nullptr;
solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchDUFixedModePtr = nullptr;
forAll (DU.boundaryField(), patchI)
{

View file

@ -1,4 +1,4 @@
OFstream * filePtr(NULL);
OFstream * filePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,6 +1,6 @@
Switch solidInterfaceCorr(false);
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
{
const dictionary& stressControl =

View file

@ -1,4 +1,4 @@
OFstream * filePtr(NULL);
OFstream * filePtr(nullptr);
if(Pstream::master())
{

View file

@ -1,6 +1,6 @@
bool solidInterfaceCorr = rheology.solidInterfaceActive();
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
if(solidInterfaceCorr)
{

View file

@ -1,4 +1,4 @@
OFstream * filePtr(NULL);
OFstream * filePtr(nullptr);
if(Pstream::master())
{

View file

@ -1,6 +1,6 @@
Switch solidInterfaceCorr(false);
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
{
const dictionary& stressControl =

View file

@ -1,6 +1,6 @@
bool solidInterfaceCorr = rheology.solidInterfaceActive();
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
if(solidInterfaceCorr)
{

View file

@ -1,7 +1,7 @@
label cohesivePatchID = -1;
solidCohesiveFvPatchVectorField* cohesivePatchUPtr = NULL;
solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = NULL;
solidCohesiveFvPatchVectorField* cohesivePatchUPtr = nullptr;
solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = nullptr;
forAll (U.boundaryField(), patchI)
{

View file

@ -1,4 +1,4 @@
OFstream* filePtr(NULL);
OFstream* filePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,4 +1,4 @@
OFstream * filePtr(NULL);
OFstream * filePtr(nullptr);
if(Pstream::master())
{

View file

@ -84,7 +84,7 @@ int main(int argc, char *argv[])
//- div(sigmaOld) should be zero but I will include
//- it to make sure errors don't accumulate
volVectorField* oldErrorPtr = NULL;
volVectorField* oldErrorPtr = nullptr;
if (ensureTotalEquilibrium)
{
oldErrorPtr = new volVectorField

View file

@ -1,4 +1,4 @@
OFstream* filePtr(NULL);
OFstream* filePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,5 +1,5 @@
OFstream* forceFilePtr(NULL);
OFstream* stressFilePtr(NULL);
OFstream* forceFilePtr(nullptr);
OFstream* stressFilePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,4 +1,4 @@
OFstream * filePtr(NULL);
OFstream * filePtr(nullptr);
if(Pstream::master())
{

View file

@ -1,5 +1,5 @@
OFstream* forceFilePtr(NULL);
OFstream* stressFilePtr(NULL);
OFstream* forceFilePtr(nullptr);
OFstream* stressFilePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,6 +1,6 @@
Switch solidInterfaceCorr(false);
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
{
const dictionary& stressControl =

View file

@ -1,6 +1,6 @@
Switch solidInterfaceCorr(false);
solidInterfaceNonLin* solidInterfacePtr(NULL);
solidInterfaceNonLin* solidInterfacePtr(nullptr);
{
const dictionary& stressControl =

View file

@ -1,5 +1,5 @@
OFstream* forceFilePtr(NULL);
OFstream* stressFilePtr(NULL);
OFstream* forceFilePtr(nullptr);
OFstream* stressFilePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,6 +1,6 @@
Switch solidInterfaceCorr(false);
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
{
const dictionary& stressControl =

View file

@ -1,4 +1,4 @@
OFstream* filePtr(NULL);
OFstream* filePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -1,6 +1,6 @@
Switch solidInterfaceCorr(false);
solidInterface* solidInterfacePtr(NULL);
solidInterface* solidInterfacePtr(nullptr);
{
const dictionary& stressControl =

View file

@ -147,7 +147,6 @@ int main(int argc, char *argv[])
||
(
solverPerf.initialResidual() > convergenceTolerance
//relativeResidual > convergenceTolerance
&& iCorr < nCorr
)
);

View file

@ -1,6 +1,6 @@
zoneToZoneInterpolation* interpolatorFluidSolidPtr = NULL;
zoneToZoneInterpolation* interpolatorSolidFluidPtr = NULL;
zoneToZoneInterpolation* interpolatorFluidSolidPtr = nullptr;
zoneToZoneInterpolation* interpolatorSolidFluidPtr = nullptr;
if(!interpolatorFluidSolidPtr || !interpolatorSolidFluidPtr)

View file

@ -125,7 +125,7 @@
IOobject::MUST_READ
);
vectorField* accumulatedFluidInterfaceDisplacementPtr = NULL;
vectorField* accumulatedFluidInterfaceDisplacementPtr = nullptr;
if(accumulatedFluidInterfaceDisplacementHeader.headerOk())
{

View file

@ -95,8 +95,8 @@ int main(int argc, char *argv[])
Info<< nl;
// gradU needed for nonLinear
volTensorField* gradUPtr = NULL;
volSymmTensorField* sigmaCauchyPtr = NULL;
volTensorField* gradUPtr = nullptr;
volSymmTensorField* sigmaCauchyPtr = nullptr;
if (nonLinear)
{
gradUPtr = new volTensorField

View file

@ -123,7 +123,7 @@ int main(int argc, char *argv[])
dimensionedVector("zero", dimForce/dimArea, vector::zero)
);
volTensorField* gradUPtr = NULL;
volTensorField* gradUPtr = nullptr;
if (nonLinear)
{
gradUPtr = new volTensorField

View file

@ -1,5 +1,5 @@
OFstream* forceFilePtr(NULL);
// OFstream* stressFilePtr(NULL);
OFstream* forceFilePtr(nullptr);
// OFstream* stressFilePtr(nullptr);
word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1)

View file

@ -50,7 +50,7 @@ volScalarField rho
freeSurface interface(mesh, rho, U, p, phi);
volScalarField* fluidIndicatorPtr = NULL;
volScalarField* fluidIndicatorPtr = nullptr;
if(Pstream::parRun())
{

View file

@ -1,7 +1,7 @@
// Volume surfactant concentration
volScalarField* CPtr = NULL;
volScalarField* CPtr = nullptr;
if(!interface.cleanInterface() && interface.surfactant().soluble())
{

View file

@ -56,7 +56,7 @@ correctedFvPatchField<Type>::correctedFvPatchField
correctionVectors_(p.size(), vector::zero),
corrVecGrad_(p.size(), pTraits<Type>::zero),
nGradInternal_(p.size(), pTraits<Type>::zero),
patchSubMeshPtr_(NULL),
patchSubMeshPtr_(nullptr),
subMeshPatchID_(-1)
{
updateCorrectionVectors();
@ -75,7 +75,7 @@ correctedFvPatchField<Type>::correctedFvPatchField
correctionVectors_(p.size(), vector::zero),
corrVecGrad_(p.size(), pTraits<Type>::zero),
nGradInternal_(p.size(), pTraits<Type>::zero),
patchSubMeshPtr_(NULL),
patchSubMeshPtr_(nullptr),
subMeshPatchID_(-1)
{
@ -95,7 +95,7 @@ correctedFvPatchField<Type>::correctedFvPatchField
correctionVectors_(p.size(), vector::zero),
corrVecGrad_(p.size(), pTraits<Type>::zero),
nGradInternal_(p.size(), pTraits<Type>::zero),
patchSubMeshPtr_(NULL),
patchSubMeshPtr_(nullptr),
subMeshPatchID_(-1)
{
updateCorrectionVectors();
@ -121,7 +121,7 @@ correctedFvPatchField<Type>::correctedFvPatchField
correctionVectors_(ptf.correctionVectors_, mapper),
corrVecGrad_(ptf.corrVecGrad_, mapper),
nGradInternal_(ptf.nGradInternal_, mapper),
patchSubMeshPtr_(NULL),
patchSubMeshPtr_(nullptr),
subMeshPatchID_(-1)
{
updateCorrectionVectors();
@ -139,7 +139,7 @@ correctedFvPatchField<Type>::correctedFvPatchField
correctionVectors_(ptf.correctionVectors_),
corrVecGrad_(ptf.corrVecGrad_),
nGradInternal_(ptf.nGradInternal_),
patchSubMeshPtr_(NULL),
patchSubMeshPtr_(nullptr),
subMeshPatchID_(-1)
{
updateCorrectionVectors();

View file

@ -162,20 +162,20 @@ freeSurface::freeSurface
readInt(this->lookup("nFreeSurfaceCorrectors"))
),
smoothing_(false),
interpolatorABPtr_(NULL),
interpolatorBAPtr_(NULL),
controlPointsPtr_(NULL),
motionPointsMaskPtr_(NULL),
pointsDisplacementDirPtr_(NULL),
facesDisplacementDirPtr_(NULL),
totalDisplacementPtr_(NULL),
aMeshPtr_(NULL),
UsPtr_(NULL),
phisPtr_(NULL),
surfactConcPtr_(NULL),
surfaceTensionPtr_(NULL),
surfactantPtr_(NULL),
fluidIndicatorPtr_(NULL)
interpolatorABPtr_(nullptr),
interpolatorBAPtr_(nullptr),
controlPointsPtr_(nullptr),
motionPointsMaskPtr_(nullptr),
pointsDisplacementDirPtr_(nullptr),
facesDisplacementDirPtr_(nullptr),
totalDisplacementPtr_(nullptr),
aMeshPtr_(nullptr),
UsPtr_(nullptr),
phisPtr_(nullptr),
surfactConcPtr_(nullptr),
surfaceTensionPtr_(nullptr),
surfactantPtr_(nullptr),
fluidIndicatorPtr_(nullptr)
{
//Read motion direction
if (!normalMotionDir_)

View file

@ -64,7 +64,7 @@ Foam::bubbleHistory::bubbleHistory
time_(t),
regionName_(polyMesh::defaultRegion),
V0_(SMALL),
historyFilePtr_(NULL)
historyFilePtr_(nullptr)
{
if (dict.found("region"))
{

View file

@ -63,7 +63,7 @@ Foam::sloshingHistory::sloshingHistory
name_(name),
time_(t),
regionName_(polyMesh::defaultRegion),
historyFilePtr_(NULL),
historyFilePtr_(nullptr),
freeSurfacePatchID_(-1),
leftPointID_(-1),
rightPointID_(-1)

View file

@ -50,7 +50,7 @@ volScalarField rho
freeSurface interface(mesh, rho, U, p, phi);
volScalarField* fluidIndicatorPtr = NULL;
volScalarField* fluidIndicatorPtr = nullptr;
if(Pstream::parRun())
{

View file

@ -665,7 +665,7 @@ int main(int argc, char *argv[])
);
// corrector for mesh motion
twoDPointCorrector* correct2DPtr = NULL;
twoDPointCorrector* correct2DPtr = nullptr;
if (motionObj.headerOk())
{

View file

@ -411,9 +411,9 @@ int main(int argc, char *argv[])
// Surface
autoPtr<triSurface> surf(NULL);
autoPtr<triSurface> surf(nullptr);
// Search engine on surface.
autoPtr<triSurfaceSearch> querySurf(NULL);
autoPtr<triSurfaceSearch> querySurf(nullptr);
if (useSurface)
{

View file

@ -185,7 +185,7 @@ void ReadVertices
// any chunk. Normally this would be in a for loop.
CCMIOSize nVertices;
CCMIOEntitySize(&err, vertices, &nVertices, NULL);
CCMIOEntitySize(&err, vertices, &nVertices, nullptr);
List<int> mapData(nVertices, 0);
List<float> verts(3*nVertices, 0);
@ -201,9 +201,9 @@ void ReadVertices
CCMIOReadMap(&err, mapID, mapData.begin(), offset, offsetPlusSize);
//CCMIOSize size;
//CCMIOEntityDescription(&err, vertices, &size, NULL);
//CCMIOEntityDescription(&err, vertices, &size, nullptr);
//char *desc = new char[size + 1];
//CCMIOEntityDescription(&err, vertices, NULL, desc);
//CCMIOEntityDescription(&err, vertices, nullptr, desc);
//Pout<< "label: '" << desc << "'" << endl;
//delete [] desc;
@ -239,7 +239,7 @@ void ReadProblem
int i = 0;
while
(
CCMIONextEntity(NULL, problem, kCCMIOCellType, &i, &next)
CCMIONextEntity(nullptr, problem, kCCMIOCellType, &i, &next)
== kCCMIONoErr
)
{
@ -251,10 +251,10 @@ void ReadProblem
// an array to get the name because we do not know how long the
// string is yet. Many parameters to CCMIO functions that
// return
// data can be NULL if that data is not needed.)
// data can be nullptr if that data is not needed.)
if
(
CCMIOReadOptstr(NULL, next, "MaterialType", &size, NULL)
CCMIOReadOptstr(nullptr, next, "MaterialType", &size, nullptr)
== kCCMIONoErr
)
{
@ -277,7 +277,7 @@ void ReadProblem
int k = 0;
while
(
CCMIONextEntity(NULL, problem, kCCMIOBoundaryRegion, &k, &boundary)
CCMIONextEntity(nullptr, problem, kCCMIOBoundaryRegion, &k, &boundary)
== kCCMIONoErr
)
{
@ -289,7 +289,7 @@ void ReadProblem
int prostarI = -1;
if
(
CCMIOReadOpti(NULL, boundary, "ProstarRegionNumber", &prostarI)
CCMIOReadOpti(nullptr, boundary, "ProstarRegionNumber", &prostarI)
== kCCMIONoErr
)
{
@ -315,12 +315,12 @@ void ReadProblem
int size;
if
(
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
CCMIOReadOptstr(nullptr, boundary, "BoundaryType", &size, nullptr)
== kCCMIONoErr
)
{
char* s = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
CCMIOReadOptstr(nullptr, boundary, "BoundaryType", &size, s);
s[size] = '\0';
foamPatchTypes[foamPatchI] = string::validate<word>(string(s));
delete [] s;
@ -337,12 +337,12 @@ void ReadProblem
if
(
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
CCMIOReadOptstr(nullptr, boundary, "BoundaryName", &size, nullptr)
== kCCMIONoErr
)
{
char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
CCMIOReadOptstr(nullptr, boundary, "BoundaryName", &size, name);
name[size] = '\0';
foamPatchNames[foamPatchI] =
string::validate<word>(string(name));
@ -351,12 +351,12 @@ void ReadProblem
}
else if
(
CCMIOReadOptstr(NULL, boundary, "Label", &size, NULL)
CCMIOReadOptstr(nullptr, boundary, "Label", &size, nullptr)
== kCCMIONoErr
)
{
char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
CCMIOReadOptstr(nullptr, boundary, "Label", &size, name);
name[size] = '\0';
foamPatchNames[foamPatchI] =
string::validate<word>(string(name));
@ -405,7 +405,7 @@ void ReadCells
CCMIOID id;
CCMIOGetEntity(&err, topology, kCCMIOCells, 0, &id);
CCMIOSize nCells;
CCMIOEntitySize(&err, id, &nCells, NULL);
CCMIOEntitySize(&err, id, &nCells, nullptr);
std::vector<int> mapData(nCells);
std::vector<int> cellType(nCells);
@ -429,7 +429,7 @@ void ReadCells
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
CCMIOSize nInternalFaces;
CCMIOEntitySize(&err, id, &nInternalFaces, NULL);
CCMIOEntitySize(&err, id, &nInternalFaces, nullptr);
Pout<< "nInternalFaces:" << nInternalFaces << endl;
// Determine patch sizes before reading internal faces
@ -437,12 +437,12 @@ void ReadCells
int index = 0;
while
(
CCMIONextEntity(NULL, topology, kCCMIOBoundaryFaces, &index, &id)
CCMIONextEntity(nullptr, topology, kCCMIOBoundaryFaces, &index, &id)
== kCCMIONoErr
)
{
CCMIOSize size;
CCMIOEntitySize(&err, id, &size, NULL);
CCMIOEntitySize(&err, id, &size, nullptr);
Pout<< "Read kCCMIOBoundaryFaces entry with " << size
<< " faces." << endl;
@ -461,10 +461,10 @@ void ReadCells
mapData.resize(nInternalFaces);
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
CCMIOSize size;
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, NULL, &size, NULL,
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, nullptr, &size, nullptr,
kCCMIOStart, kCCMIOEnd);
std::vector<int> faces(size);
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0],
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, nullptr, &faces[0],
kCCMIOStart, kCCMIOEnd);
std::vector<int> faceCells(2*nInternalFaces);
CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0],
@ -501,19 +501,19 @@ void ReadCells
label regionI = 0;
while
(
CCMIONextEntity(NULL, topology, kCCMIOBoundaryFaces, &index, &id)
CCMIONextEntity(nullptr, topology, kCCMIOBoundaryFaces, &index, &id)
== kCCMIONoErr
)
{
CCMIOSize nFaces;
CCMIOEntitySize(&err, id, &nFaces, NULL);
CCMIOEntitySize(&err, id, &nFaces, nullptr);
mapData.resize(nFaces);
faceCells.resize(nFaces);
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL,
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, nullptr, &size, nullptr,
kCCMIOStart, kCCMIOEnd);
faces.resize(size);
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0],
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, nullptr, &faces[0],
kCCMIOStart, kCCMIOEnd);
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
kCCMIOStart, kCCMIOEnd);
@ -524,7 +524,7 @@ void ReadCells
int prostarI;
if
(
CCMIOReadOpti(NULL, id, "ProstarRegionNumber", &prostarI)
CCMIOReadOpti(nullptr, id, "ProstarRegionNumber", &prostarI)
== kCCMIONoErr
)
{
@ -634,11 +634,11 @@ int main(int argc, char *argv[])
}
// Open the file. Because we did not initialize 'err' we need to pass
// in NULL (which always means kCCMIONoErr) and then assign the return
// in nullptr (which always means kCCMIONoErr) and then assign the return
// value to 'err'.).
CCMIOID root;
CCMIOError err =
CCMIOOpenFile(NULL, ccmFile.c_str(), kCCMIORead, &root);
CCMIOOpenFile(nullptr, ccmFile.c_str(), kCCMIORead, &root);
// We are going to assume that we have a state with a known name.
// We could instead use CCMIONextEntity() to walk through all the
@ -649,9 +649,9 @@ int main(int argc, char *argv[])
CheckError(err, "Error opening state");
unsigned int size;
CCMIOEntityDescription(&err, state, &size, NULL);
CCMIOEntityDescription(&err, state, &size, nullptr);
char *desc = new char[size + 1];
CCMIOEntityDescription(&err, state, NULL, desc);
CCMIOEntityDescription(&err, state, nullptr, desc);
Pout<< "Reading state '" << kDefaultState << "' (" << desc << ")"
<< endl;
delete [] desc;
@ -668,7 +668,7 @@ int main(int argc, char *argv[])
processor,
&vertices,
&topology,
NULL,
nullptr,
&solution
);
@ -682,8 +682,8 @@ int main(int argc, char *argv[])
processor,
&vertices,
&topology,
NULL,
NULL
nullptr,
nullptr
);
if (err != kCCMIONoErr)
{

View file

@ -97,7 +97,7 @@ public:
autoPtr<block> clone() const
{
notImplemented("block::clone()");
return autoPtr<block>(NULL);
return autoPtr<block>(nullptr);
}
// Destructor

View file

@ -47,7 +47,7 @@ cellShape extrudedQuadCellShape
faceList& frontAndBackFaces
)
{
const static cellModel* hexModelPtr_ = NULL;
const static cellModel* hexModelPtr_ = nullptr;
if (!hexModelPtr_)
{

View file

@ -48,7 +48,7 @@ cellShape extrudedTriangleCellShape
faceList& frontAndBackFaces
)
{
const static cellModel* prismModelPtr_ = NULL;
const static cellModel* prismModelPtr_ = nullptr;
if (!prismModelPtr_)
{

View file

@ -172,7 +172,7 @@ sammMesh::sammMesh
cellPolys_(0),
nInternalFaces_(0),
polyBoundaryPatchStartIndices_(0),
pointCellsPtr_(NULL),
pointCellsPtr_(nullptr),
isShapeMesh_(true)
{
// Fill in the lookup tables

View file

@ -161,7 +161,7 @@ meshReader::meshReader
cellFaces_(0),
baffleFaces_(0),
cellTableId_(0),
pointCellsPtr_(NULL)
pointCellsPtr_(nullptr)
{}

View file

@ -399,7 +399,7 @@ void starMeshReader::readCells
}
// determine the foam cell shape
const cellModel* curModelPtr = NULL;
const cellModel* curModelPtr = nullptr;
// fluid/solid cells
switch (shapeId)

View file

@ -249,7 +249,7 @@ starMesh::starMesh
cellPolys_(0),
nInternalFaces_(0),
polyBoundaryPatchStartIndices_(0),
pointCellsPtr_(NULL),
pointCellsPtr_(nullptr),
couples_(0),
isShapeMesh_(true)
{

View file

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTimeExtruded.H"
autoPtr<extrudedMesh> meshPtr(NULL);
autoPtr<extrudedMesh> meshPtr(nullptr);
IOdictionary dict
(

View file

@ -107,7 +107,7 @@ int main(int argc, char *argv[])
// Load set to work
autoPtr<topoSet> currentSetPtr(NULL);
autoPtr<topoSet> currentSetPtr(nullptr);
IOobject::readOption r;
if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR))

View file

@ -107,7 +107,7 @@ int main(int argc, char *argv[])
// Load set to work
autoPtr<topoSet> currentSetPtr(NULL);
autoPtr<topoSet> currentSetPtr(nullptr);
IOobject::readOption r;
if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR))

View file

@ -43,7 +43,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
IOobject::NO_WRITE
)
),
mirrorMeshPtr_(NULL)
mirrorMeshPtr_(nullptr)
{
plane mirrorPlane(mirrorMeshDict_);

View file

@ -107,7 +107,7 @@ int main(int argc, char *argv[])
// Load set to work
autoPtr<topoSet> currentSetPtr(NULL);
autoPtr<topoSet> currentSetPtr(nullptr);
IOobject::readOption r;
if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR))

View file

@ -768,7 +768,7 @@ int main(int argc, char *argv[])
std::ifstream* fileStreamPtr(NULL);
std::ifstream* fileStreamPtr(nullptr);
if (args.optionFound("batch"))
{

View file

@ -384,7 +384,7 @@ int main(int argc, char *argv[])
// Construct the tetPoint fields
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
tetPolyMesh* tetMeshPtr = NULL;
tetPolyMesh* tetMeshPtr = nullptr;
PtrList<tetPointScalarField> tetPointScalarFields;
PtrList<tetPointVectorField> tetPointVectorFields;
@ -491,7 +491,7 @@ int main(int argc, char *argv[])
new List<SLList<indexedParticle*>*>
(
mesh.nCells(),
static_cast<SLList<indexedParticle*>*>(NULL)
static_cast<SLList<indexedParticle*>*>(nullptr)
)
);
@ -895,7 +895,7 @@ int main(int argc, char *argv[])
if (tetMeshPtr)
{
delete tetMeshPtr;
tetMeshPtr = NULL;
tetMeshPtr = nullptr;
}

View file

@ -430,7 +430,7 @@ void writePatchField
word timeFile = prepend + itoa(timeIndex);
OFstream *ensightFilePtr = NULL;
OFstream *ensightFilePtr = nullptr;
if (Pstream::master())
{
if (timeIndex == 0)
@ -533,7 +533,7 @@ void ensightFieldAscii
const labelList& hexes = meshCellSets.hexes;
const labelList& polys = meshCellSets.polys;
OFstream *ensightFilePtr = NULL;
OFstream *ensightFilePtr = nullptr;
if (Pstream::master())
{
// set the filename of the ensight file
@ -708,7 +708,7 @@ void ensightFieldBinary
const labelList& hexes = meshCellSets.hexes;
const labelList& polys = meshCellSets.polys;
std::ofstream *ensightFilePtr = NULL;
std::ofstream *ensightFilePtr = nullptr;
if (Pstream::master())
{
// set the filename of the ensight file

View file

@ -966,7 +966,7 @@ void Foam::ensightMesh::writeAllFacePrims
{
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
if (&prims != NULL)
if (&prims != nullptr)
{
writeFacePrims
(
@ -993,7 +993,7 @@ void Foam::ensightMesh::writeAllFacePrims
}
}
}
else if (&prims != NULL)
else if (&prims != nullptr)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< ensMap(patchFaces, prims);
@ -1053,7 +1053,7 @@ void Foam::ensightMesh::writeAllNSided
// Number of points for each face
if (Pstream::master())
{
if (&prims != NULL)
if (&prims != nullptr)
{
writeNSidedNPointsPerFace
(
@ -1078,7 +1078,7 @@ void Foam::ensightMesh::writeAllNSided
}
}
}
else if (&prims != NULL)
else if (&prims != nullptr)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< ensMap(patchFaces, prims);
@ -1087,7 +1087,7 @@ void Foam::ensightMesh::writeAllNSided
// List of points id for each face
if (Pstream::master())
{
if (&prims != NULL)
if (&prims != nullptr)
{
writeNSidedPoints
(
@ -1114,7 +1114,7 @@ void Foam::ensightMesh::writeAllNSided
}
}
}
else if (&prims != NULL)
else if (&prims != nullptr)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< ensMap(patchFaces, prims);
@ -1177,7 +1177,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
// Number of points for each face
if (Pstream::master())
{
if (&prims != NULL)
if (&prims != nullptr)
{
writeNSidedNPointsPerFaceBinary
(
@ -1202,7 +1202,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
}
}
}
else if (&prims != NULL)
else if (&prims != nullptr)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< ensMap(patchFaces, prims);
@ -1211,7 +1211,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
// List of points id for each face
if (Pstream::master())
{
if (&prims != NULL)
if (&prims != nullptr)
{
writeNSidedPointsBinary
(
@ -1238,7 +1238,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
}
}
}
else if (&prims != NULL)
else if (&prims != nullptr)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< ensMap(patchFaces, prims);
@ -1265,7 +1265,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
writeEnsDataBinary(key,ensightGeometryFile);
writeEnsDataBinary(nPrims,ensightGeometryFile);
if (&prims != NULL)
if (&prims != nullptr)
{
writeFacePrimsBinary
(
@ -1292,7 +1292,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
}
}
}
else if (&prims != NULL)
else if (&prims != nullptr)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< ensMap(patchFaces, prims);
@ -1346,7 +1346,7 @@ void Foam::ensightMesh::writeAscii
// set the filename of the ensight file
fileName ensightGeometryFileName = timeFile + "mesh";
OFstream *ensightGeometryFilePtr = NULL;
OFstream *ensightGeometryFilePtr = nullptr;
if (Pstream::master())
{
ensightGeometryFilePtr = new OFstream
@ -1475,12 +1475,12 @@ void Foam::ensightMesh::writeAscii
{
const nFacePrimitives& nfp = nPatchPrims_.find(patchName)();
const labelList *trisPtr = NULL;
const labelList *quadsPtr = NULL;
const labelList *polysPtr = NULL;
const labelList *trisPtr = nullptr;
const labelList *quadsPtr = nullptr;
const labelList *polysPtr = nullptr;
const pointField *patchPointsPtr = NULL;
const faceList *patchFacesPtr = NULL;
const pointField *patchPointsPtr = nullptr;
const faceList *patchFacesPtr = nullptr;
if (mesh_.boundary()[patchi].size())
{
@ -1641,7 +1641,7 @@ void Foam::ensightMesh::writeBinary
// set the filename of the ensight file
fileName ensightGeometryFileName = timeFile + "mesh";
std::ofstream *ensightGeometryFilePtr = NULL;
std::ofstream *ensightGeometryFilePtr = nullptr;
if (Pstream::master())
{
@ -1763,12 +1763,12 @@ void Foam::ensightMesh::writeBinary
{
const nFacePrimitives& nfp = nPatchPrims_.find(patchName)();
const labelList *trisPtr = NULL;
const labelList *quadsPtr = NULL;
const labelList *polysPtr = NULL;
const labelList *trisPtr = nullptr;
const labelList *quadsPtr = nullptr;
const labelList *polysPtr = nullptr;
const pointField *patchPointsPtr = NULL;
const faceList *patchFacesPtr = NULL;
const pointField *patchPointsPtr = nullptr;
const faceList *patchFacesPtr = nullptr;
if (mesh_.boundary()[patchi].size())
{

View file

@ -150,7 +150,7 @@ int main(int argc, char *argv[])
const word prepend = args.globalCaseName() + '.';
OFstream *ensightCaseFilePtr = NULL;
OFstream *ensightCaseFilePtr = nullptr;
if (Pstream::master())
{
fileName caseFileName = prepend + "case";

View file

@ -277,7 +277,7 @@ int main(int argc, char *argv[])
}
// Current mesh. Start off from unloaded mesh.
autoPtr<fieldviewTopology> topoPtr(NULL);
autoPtr<fieldviewTopology> topoPtr(nullptr);
label fieldViewTime = 0;
@ -410,7 +410,7 @@ int main(int argc, char *argv[])
writeInt(fvFile, volFieldNames.size());
forAll(volFieldNames, fieldI)
{
if (volFieldPtrs[fieldI] == NULL)
if (volFieldPtrs[fieldI] == nullptr)
{
Info<< " dummy field for "
<< volFieldNames[fieldI].c_str() << endl;
@ -436,7 +436,7 @@ int main(int argc, char *argv[])
}
forAll(surfFieldNames, fieldI)
{
if (surfFieldPtrs[fieldI] == NULL)
if (surfFieldPtrs[fieldI] == nullptr)
{
Info<< " dummy surface field for "
<< surfFieldNames[fieldI].c_str() << endl;
@ -644,7 +644,7 @@ int main(int argc, char *argv[])
forAll(volFieldPtrs, fieldI)
{
if (volFieldPtrs[fieldI] != NULL)
if (volFieldPtrs[fieldI] != nullptr)
{
const volScalarField& vField = *volFieldPtrs[fieldI];
@ -689,7 +689,7 @@ int main(int argc, char *argv[])
forAll(volFieldPtrs, fieldI)
{
if (volFieldPtrs[fieldI] != NULL)
if (volFieldPtrs[fieldI] != nullptr)
{
const volScalarField& vsf = *volFieldPtrs[fieldI];
@ -730,7 +730,7 @@ int main(int argc, char *argv[])
// surfFields
forAll(surfFieldPtrs, fieldI)
{
if (surfFieldPtrs[fieldI] != NULL)
if (surfFieldPtrs[fieldI] != nullptr)
{
const surfaceScalarField& ssf = *surfFieldPtrs[fieldI];
@ -778,7 +778,7 @@ int main(int argc, char *argv[])
writeInt(fvFile, FV_ARB_POLY_BNDRY_VARS);
forAll(volFieldPtrs, fieldI)
{
if (volFieldPtrs[fieldI] != NULL)
if (volFieldPtrs[fieldI] != nullptr)
{
const volScalarField& vsf = *volFieldPtrs[fieldI];
@ -815,7 +815,7 @@ int main(int argc, char *argv[])
// surfFields
forAll(surfFieldPtrs, fieldI)
{
if (surfFieldPtrs[fieldI] != NULL)
if (surfFieldPtrs[fieldI] != nullptr)
{
const surfaceScalarField& ssf = *surfFieldPtrs[fieldI];
@ -920,7 +920,7 @@ int main(int argc, char *argv[])
forAll(sprayScalarFieldPtrs, fieldI)
{
if (sprayScalarFieldPtrs[fieldI] != NULL)
if (sprayScalarFieldPtrs[fieldI] != nullptr)
{
const IOField<scalar>& sprayField =
*sprayScalarFieldPtrs[fieldI];
@ -937,7 +937,7 @@ int main(int argc, char *argv[])
}
forAll(sprayVectorFieldPtrs, fieldI)
{
if (sprayVectorFieldPtrs[fieldI] != NULL)
if (sprayVectorFieldPtrs[fieldI] != nullptr)
{
const IOField<vector>& sprayVectorField =
*sprayVectorFieldPtrs[fieldI];

View file

@ -112,8 +112,8 @@ Pout<< "zoneName:" << zoneName
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
INTEGER4 NumBConns = 0; /* No Boundary Connections */
@ -192,8 +192,8 @@ Pout<< "zoneName:" << zoneName
<< endl;
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
INTEGER4 NumBConns = 0; /* No Boundary Connections */
@ -274,8 +274,8 @@ Pout<< "zoneName:" << zoneName
<< endl;
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
@ -374,9 +374,9 @@ void Foam::tecplotWriter::writeConnectivity(const fvMesh& mesh) const
FaceNodes.begin(), /* The face nodes array */
FaceLeftElems.begin(), /* The left elements array */
FaceRightElems.begin(), /* The right elements array */
NULL, /* No boundary connection counts */
NULL, /* No boundary connection elements */
NULL /* No boundary connection zones */
nullptr, /* No boundary connection counts */
nullptr, /* No boundary connection elements */
nullptr /* No boundary connection zones */
)
)
{
@ -488,9 +488,9 @@ void Foam::tecplotWriter::writeConnectivity
FaceNodes.begin(), /* The face nodes array */
FaceLeftElems.begin(), /* The left elements array */
FaceRightElems.begin(), /* The right elements array */
NULL, /* No boundary connection counts */
NULL, /* No boundary connection elements */
NULL /* No boundary connection zones */
nullptr, /* No boundary connection counts */
nullptr, /* No boundary connection elements */
nullptr /* No boundary connection zones */
)
)
{

View file

@ -204,14 +204,14 @@ int main(int argc, char *argv[])
sFields[i]->correctBoundaryConditions();
sFields[i]->write();
delete sFields[i];
sFields[i] = NULL;
sFields[i] = nullptr;
}
else if (vFields[i])
{
vFields[i]->correctBoundaryConditions();
vFields[i]->write();
delete vFields[i];
vFields[i] = NULL;
vFields[i] = nullptr;
}
}

View file

@ -82,7 +82,7 @@ void Foam::vtkPVFoam::reduceMemory()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
}
@ -222,8 +222,8 @@ Foam::vtkPVFoam::vtkPVFoam
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
timeIndex_(-1),
@ -343,7 +343,7 @@ void Foam::vtkPVFoam::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
<< timeIndex_ << endl;
}
@ -412,7 +412,7 @@ void Foam::vtkPVFoam::updateFoamMesh()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
// Check to see if the FOAM mesh has been created
@ -533,7 +533,7 @@ void Foam::vtkPVFoam::CleanUp()
double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
{
int nTimes = 0;
double* tsteps = NULL;
double* tsteps = nullptr;
if (dbPtr_.valid())
{

View file

@ -47,7 +47,7 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
const word& cloudName
)
{
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (debug)
{

View file

@ -198,7 +198,7 @@ void Foam::vtkPVFoam::updateInfoPatches()
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoPatches"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
@ -292,7 +292,7 @@ void Foam::vtkPVFoam::updateInfoZones()
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoZones"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
vtkDataArraySelection* partSelection = reader_->GetPartSelection();

View file

@ -41,7 +41,7 @@ void Foam::vtkPVFoam::updateInfoFields
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoFields <"
<< meshType::Mesh::typeName
<< "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
<< "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
<< endl;
}

View file

@ -28,7 +28,7 @@ int USERD_set_filenames
// remove the last '/' from rootDir
if (the_path[lRoot-1] == '/')
{
the_path[lRoot-1] = (char)NULL;
the_path[lRoot-1] = '\0';
}
else
{
@ -99,7 +99,7 @@ int USERD_set_filenames
label nVar = 0;
wordList scalars = objects.names(scalarName);
for (label n=0; n<fieldNames.size(); n++)
forAll (fieldNames, n)
{
bool isitScalar = false;
forAll(scalars,i)
@ -115,7 +115,7 @@ int USERD_set_filenames
wordList vectors = objects.names(vectorName);
for (label n=0; n<fieldNames.size(); n++)
forAll (fieldNames, n)
{
bool isitVector = false;
forAll(vectors,i)
@ -131,7 +131,7 @@ int USERD_set_filenames
wordList tensors = objects.names(tensorName);
for (label n=0; n<fieldNames.size(); n++)
forAll (fieldNames, n)
{
bool isitTensor = false;
forAll(tensors,i)
@ -151,10 +151,10 @@ int USERD_set_filenames
{
runTime.setTime(timeDirs[n+1], n+1);
Cloud<passiveParticle> lagrangian(*meshPtr);
Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
n++;
if (lagrangian.size())
if (lagrangian.size() > 0)
{
lagrangianNamesFound = true;
}
@ -171,20 +171,19 @@ int USERD_set_filenames
false
);
if (sprayHeader.headerOk())
{
Info << "[Found lagrangian]" << endl;
delete sprayPtr;
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
sprayPtr = new Cloud<passiveParticle>(*meshPtr, cloud::defaultName);
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix);
lagrangianScalarNames =
(const wordList&)objects.names(sprayScalarFieldName);
lagrangianVectorNames =
(const wordList&)objects.names(sprayVectorFieldName);
lagrangianScalarNames = objects.names(sprayScalarFieldName);
lagrangianVectorNames = objects.names(sprayVectorFieldName);
isSpray[fieldNames.size()] = true;
@ -206,4 +205,3 @@ int USERD_set_filenames
return Z_OK;
}

View file

@ -84,8 +84,8 @@ void Foam::readerDatabase::getPolyHedra()
Foam::readerDatabase::readerDatabase()
:
fieldviewNames_(10),
runTimePtr_(NULL),
meshPtr_(NULL),
runTimePtr_(nullptr),
meshPtr_(nullptr),
setName_(""),
polys_(),
volScalarNames_(),

View file

@ -28,7 +28,7 @@ int USERD_set_filenames
// remove the last '/' from rootDir
if (the_path[lRoot-1] == '/')
{
the_path[lRoot-1] = (char)NULL;
the_path[lRoot-1] = '\0';
}
else
{
@ -54,7 +54,6 @@ int USERD_set_filenames
return Z_ERR;
}
// construct the global pointers to the database and mesh
delete meshPtr;
@ -80,7 +79,7 @@ int USERD_set_filenames
);
// set the available number of time-steps
TimeList = (const instantList&)Foam::Time::findTimes(rootDir/caseDir);
TimeList = Foam::Time::findTimes(rootDir/caseDir);
Num_time_steps = TimeList.size() - 1;
@ -88,10 +87,10 @@ int USERD_set_filenames
// set the number of fields and store their names
// a valid field must exist for all time-steps
runTime.setTime(TimeList[TimeList.size()-1], TimeList.size()-1);
runTime.setTime(TimeList.last(), TimeList.size() - 1);
IOobjectList objects(*meshPtr, runTime.timeName());
fieldNames = (const wordList&)objects.names();
fieldNames = objects.names();
// because of the spray being a 'field' ...
// get the availabe number of variables and
@ -100,7 +99,7 @@ int USERD_set_filenames
label nVar = 0;
wordList scalars = objects.names(scalarName);
for (label n=0; n<fieldNames.size(); n++)
forAll (fieldNames, n)
{
bool isitScalar = false;
forAll(scalars,i)
@ -116,7 +115,7 @@ int USERD_set_filenames
wordList vectors = objects.names(vectorName);
for (label n=0; n<fieldNames.size(); n++)
forAll (fieldNames, n)
{
bool isitVector = false;
forAll(vectors,i)
@ -132,7 +131,7 @@ int USERD_set_filenames
wordList tensors = objects.names(tensorName);
for (label n=0; n<fieldNames.size(); n++)
forAll (fieldNames, n)
{
bool isitTensor = false;
forAll(tensors,i)
@ -148,11 +147,11 @@ int USERD_set_filenames
bool lagrangianNamesFound = false;
label n = 0;
while ((!lagrangianNamesFound) && (n<Num_time_steps))
while (!lagrangianNamesFound && n < Num_time_steps)
{
runTime.setTime(TimeList[n + 1], n + 1);
Cloud<passiveParticle> lagrangian(*meshPtr);
Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
n++;
if (lagrangian.size() > 0)
@ -179,14 +178,12 @@ int USERD_set_filenames
delete sprayPtr;
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
sprayPtr = new Cloud<passiveParticle>(*meshPtr, cloud::defaultName);
IOobjectList objects(*meshPtr, runTime.timeName(), "lagrangian");
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix);
lagrangianScalarNames =
(const wordList&)objects.names(sprayScalarFieldName);
lagrangianVectorNames =
(const wordList&)objects.names(sprayVectorFieldName);
lagrangianScalarNames = objects.names(sprayScalarFieldName);
lagrangianVectorNames = objects.names(sprayVectorFieldName);
isSpray[fieldNames.size()] = true;
@ -448,4 +445,3 @@ int USERD_set_filenames
return Z_OK;
}

View file

@ -197,12 +197,12 @@ void ComputeEdgeCostAtVertex(Vertex *v) {
// cost (in member variable objdist).
if(v->neighbor.num==0) {
// v doesn't have neighbors so it costs nothing to collapse
v->collapse=NULL;
v->collapse=nullptr;
v->objdist=-0.01f;
return;
}
v->objdist = 1000000;
v->collapse=NULL;
v->collapse=nullptr;
// search all neighboring edges for "least cost" edge
for(int i=0;i<v->neighbor.num;i++) {
float dist;

View file

@ -271,33 +271,33 @@ HWND CreateOpenGLWindow(char* title)
/* only register the window class once - use hInstance as a flag. */
if (!hInstance) {
hInstance = GetModuleHandle(NULL);
hInstance = GetModuleHandle(nullptr);
wc.style = CS_OWNDC;
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.hIcon = LoadIcon(nullptr, IDI_WINLOGO);
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
wc.hbrBackground = nullptr;
wc.lpszMenuName = nullptr;
wc.lpszClassName = "OpenGL";
if (!RegisterClass(&wc)) {
MessageBox(NULL, "RegisterClass() failed: "
MessageBox(nullptr, "RegisterClass() failed: "
"Cannot register window class.", "Error", MB_OK);
return NULL;
return nullptr;
}
}
hWnd = CreateWindow("OpenGL", title, WS_OVERLAPPEDWINDOW |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
0,0,Width,Height, NULL, NULL, hInstance, NULL);
0,0,Width,Height, nullptr, nullptr, hInstance, nullptr);
if (hWnd == NULL) {
MessageBox(NULL, "CreateWindow() failed: Cannot create a window.",
if (hWnd == nullptr) {
MessageBox(nullptr, "CreateWindow() failed: Cannot create a window.",
"Error", MB_OK);
return NULL;
return nullptr;
}
hDC = GetDC(hWnd);
@ -314,13 +314,13 @@ HWND CreateOpenGLWindow(char* title)
pf = ChoosePixelFormat(hDC, &pfd);
if (pf == 0) {
MessageBox(NULL, "ChoosePixelFormat() failed: "
MessageBox(nullptr, "ChoosePixelFormat() failed: "
"Cannot find a suitable pixel format.", "Error", MB_OK);
return 0;
}
if (SetPixelFormat(hDC, pf, &pfd) == FALSE) {
MessageBox(NULL, "SetPixelFormat() failed: "
MessageBox(nullptr, "SetPixelFormat() failed: "
"Cannot set format specified.", "Error", MB_OK);
return 0;
}
@ -406,7 +406,7 @@ int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,
CalcFPSDeltaT();
hWnd = CreateOpenGLWindow("bunnylod by Stan Melax");
if (hWnd == NULL) exit(1);
if (hWnd == nullptr) exit(1);
hDC = GetDC(hWnd);
hRC = wglCreateContext(hDC);
@ -435,7 +435,7 @@ int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,
}
quit:
wglMakeCurrent(NULL, NULL);
wglMakeCurrent(nullptr, nullptr);
ReleaseDC(hDC, hWnd);
wglDeleteContext(hRC);
DestroyWindow(hWnd);

View file

@ -434,7 +434,7 @@ void Foam::boundaryMesh::markZone
// Null constructor
Foam::boundaryMesh::boundaryMesh()
:
meshPtr_(NULL),
meshPtr_(nullptr),
patches_(),
meshFace_(),
featurePoints_(),
@ -460,7 +460,7 @@ void Foam::boundaryMesh::clearOut()
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
}

View file

@ -96,11 +96,11 @@ std::string MSwindows::getLastError()
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
nullptr,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
0, nullptr );
lpDisplayBuf = LocalAlloc(LMEM_ZEROINIT,
(lstrlen(static_cast<LPCTSTR>(lpMsgBuf))+40)*sizeof(TCHAR));
@ -343,7 +343,7 @@ std::string toUnixPath(const std::string & path)
bool env(const word& envName)
{
const DWORD actualBufferSize =
::GetEnvironmentVariable(envName.c_str(), NULL, 0);
::GetEnvironmentVariable(envName.c_str(), nullptr, 0);
const bool envExists = (0 < actualBufferSize);
return envExists;
@ -355,7 +355,7 @@ string getEnv(const word& envName)
std::string envAsString;
const DWORD actualBufferSize =
::GetEnvironmentVariable(envName.c_str(), NULL, 0);
::GetEnvironmentVariable(envName.c_str(), nullptr, 0);
if (0 < actualBufferSize)
{
@ -461,7 +461,7 @@ fileName cwd()
string currentDirectory;
const DWORD actualBufferSize =
::GetCurrentDirectory(0, NULL);
::GetCurrentDirectory(0, nullptr);
if (0 < actualBufferSize)
{
@ -704,7 +704,7 @@ bool mkDir(const fileName& pathName, const mode_t mode)
}
bool success = ::CreateDirectory(pathName.c_str(), NULL);
bool success = ::CreateDirectory(pathName.c_str(), nullptr);
if (success)
{
@ -1294,7 +1294,7 @@ void* dlOpen(const fileName& libName, const bool check)
void* handle = ::LoadLibrary(winLibName.c_str());
if (NULL == handle)
if (nullptr == handle)
{
// Assumes libName = name
winLibName = "lib";
@ -1304,7 +1304,7 @@ void* dlOpen(const fileName& libName, const bool check)
handle = ::LoadLibrary(winLibName.c_str());
}
if (NULL != handle)
if (nullptr != handle)
{
getLoadedLibs()[handle] = libName;
}
@ -1357,7 +1357,7 @@ void* dlSym(void* handle, const std::string& symbol)
// get address of symbol
void* fun = (void*) ::GetProcAddress(static_cast<HMODULE>(handle), symbol.c_str());
if (NULL == fun)
if (nullptr == fun)
{
WarningIn("dlSym(void*, const std::string&)")
<< "Cannot lookup symbol " << symbol << " : " << MSwindows::getLastError()
@ -1381,7 +1381,7 @@ bool dlSymFound(void* handle, const std::string& symbol)
// get address of symbol
void* fun = (void*) ::GetProcAddress(static_cast<HMODULE>(handle), symbol.c_str());
return (NULL != fun);
return (nullptr != fun);
}
else
{

View file

@ -39,7 +39,7 @@ namespace Foam
void clockTime::getTime(struct timeval& t)
{
gettimeofday(&t, NULL);
gettimeofday(&t, nullptr);
}

View file

@ -51,7 +51,7 @@ bool rwMutex::debug = false;
multiThreader::multiThreader(int numThreads)
:
maxQueueSize_(10),
poolInfo_(NULL)
poolInfo_(nullptr)
{
if (numThreads > 0)
{
@ -126,7 +126,7 @@ rwMutex::rwMutex()
Conditional::Conditional()
{
if (pthread_cond_init(&condition_, NULL))
if (pthread_cond_init(&condition_, nullptr))
{
FatalErrorIn("multiThreader::Conditional::Conditional()")
<< "Unable to initialize condition"
@ -190,8 +190,8 @@ void multiThreader::initializeThreadPool()
poolInfo_->numThreads = numThreads_;
poolInfo_->queueSize = 0;
poolInfo_->threads = new pthread_t[numThreads_];
poolInfo_->head = NULL;
poolInfo_->tail = NULL;
poolInfo_->head = nullptr;
poolInfo_->tail = nullptr;
// Initialize flags
poolInfo_->queueClosed = false;
@ -265,7 +265,7 @@ threadReturnType multiThreader::poolThread(void *arg)
if (poolInfo->shutDown)
{
poolInfo->queueLock.unlock();
pthread_exit(NULL);
pthread_exit(nullptr);
}
// Pick an item off the queue, and get to work
@ -273,7 +273,7 @@ threadReturnType multiThreader::poolThread(void *arg)
poolInfo->queueSize--;
if (poolInfo->queueSize == 0)
{
poolInfo->head = poolInfo->tail = NULL;
poolInfo->head = poolInfo->tail = nullptr;
}
else
{
@ -355,7 +355,7 @@ void multiThreader::addToWorkQueue
workQueueItem *newWorkItem = new workQueueItem;
newWorkItem->function = tFunction;
newWorkItem->arg = arg;
newWorkItem->next = NULL;
newWorkItem->next = nullptr;
// Add new work structure to the queue
if (poolInfo_->queueSize == 0)
@ -412,7 +412,7 @@ void multiThreader::destroyThreadPool()
// Wait for all workers to exit
for(int i=0; i < numThreads_; i++)
{
if (pthread_join(poolInfo_->threads[i],NULL))
if (pthread_join(poolInfo_->threads[i],nullptr))
{
FatalErrorIn("multiThreader::destroyThreadPool()")
<< "pthread_join failed."
@ -427,7 +427,7 @@ void multiThreader::destroyThreadPool()
delete [] poolInfo_->threads;
workQueueItem *currentNode;
while(poolInfo_->head != NULL)
while(poolInfo_->head != nullptr)
{
currentNode = poolInfo_->head->next;
poolInfo_->head = poolInfo_->head->next;

View file

@ -65,7 +65,7 @@ extern "C"
typedef void *(*threadFunctionType)(void *);
#define threadReturnType void *
#define threadReturnValue NULL
#define threadReturnValue nullptr
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -57,7 +57,7 @@ threadHandler<T>::~threadHandler()
// to avoid multiple deallocations.
forAll(argList_, indexI)
{
argList_[indexI] = NULL;
argList_[indexI] = nullptr;
}
}
@ -79,7 +79,7 @@ inline void threadHandler<T>::setSize
const label size
)
{
argList_.setSize(size, NULL);
argList_.setSize(size, nullptr);
}

View file

@ -58,7 +58,7 @@ string pOpen(const string &cmd, label line=0)
char* s = fgets(buffer, MAX-1, cmdPipe);
if (s == NULL)
if (s == nullptr)
{
#ifdef darwin
// workaround for the Python-Script
@ -392,7 +392,7 @@ void error::printStack(Ostream& os)
char* cplusNamePtr = abi::__cxa_demangle
(
cName.c_str(),
NULL, // have it malloc itself
nullptr, // have it malloc itself
0,
&status
);

View file

@ -76,7 +76,7 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const
{
clear();
// avoid NULL pointer and zero-length patterns
// avoid nullptr pointer and zero-length patterns
if (pattern && *pattern)
{
int cflags = EXTENDED;

View file

@ -44,7 +44,7 @@ jmp_buf Foam::timer::envAlarm;
__p_sig_fn_t Foam::timer::oldAction_ = SIG_DFL;
static HANDLE hTimer_ = NULL;
static HANDLE hTimer_ = nullptr;
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
@ -78,7 +78,7 @@ Foam::timer::timer(const unsigned int newTimeOut)
if (newTimeOut > 0)
{
// Is singleton since handler is static function
if( NULL != hTimer_ )
if( nullptr != hTimer_ )
{
FatalErrorIn
(
@ -110,15 +110,15 @@ Foam::timer::timer(const unsigned int newTimeOut)
const bool success =
::CreateTimerQueueTimer(&hTimer_,
NULL,
nullptr,
(WAITORTIMERCALLBACK)timerExpired,
NULL ,
nullptr ,
newTimeOut * 1000,
0, 0);
if (!success)
{
hTimer_ = NULL;
hTimer_ = nullptr;
FatalErrorIn
(
"Foam::timer::timer(const unsigned int)"
@ -138,8 +138,8 @@ Foam::timer::~timer()
{
// Reset timer
const bool timerSuccess =
::DeleteTimerQueueTimer(NULL, hTimer_, NULL);
hTimer_ = NULL;
::DeleteTimerQueueTimer(nullptr, hTimer_, nullptr);
hTimer_ = nullptr;
if (!timerSuccess)
{

View file

@ -82,7 +82,7 @@ pid_t Foam::pgid()
bool Foam::env(const word& envName)
{
return getenv(envName.c_str()) != NULL;
return getenv(envName.c_str()) != nullptr;
}
@ -158,7 +158,7 @@ Foam::string Foam::userName()
{
struct passwd* pw = getpwuid(getuid());
if (pw != NULL)
if (pw != nullptr)
{
return pw->pw_name;
}
@ -179,7 +179,7 @@ Foam::fileName Foam::home()
{
char* env = getenv("HOME");
if (env != NULL)
if (env != nullptr)
{
return fileName(env);
}
@ -187,7 +187,7 @@ Foam::fileName Foam::home()
{
struct passwd* pw = getpwuid(getuid());
if (pw != NULL)
if (pw != nullptr)
{
return pw->pw_dir;
}
@ -211,7 +211,7 @@ Foam::fileName Foam::home(const string& userName)
{
char* env = getenv("HOME");
if (env != NULL)
if (env != nullptr)
{
return fileName(env);
}
@ -219,7 +219,7 @@ Foam::fileName Foam::home(const string& userName)
pw = getpwuid(getuid());
}
if (pw != NULL)
if (pw != nullptr)
{
return pw->pw_dir;
}
@ -670,7 +670,7 @@ Foam::fileNameList Foam::readDir
label nEntries = 0;
// Attempt to open directory and set the structure pointer
if ((source = opendir(directory.c_str())) == NULL)
if ((source = opendir(directory.c_str())) == nullptr)
{
dirEntries.setSize(0);
@ -683,7 +683,7 @@ Foam::fileNameList Foam::readDir
else
{
// Read and parse all the entries in the directory
while ((list = readdir(source)) != NULL)
while ((list = readdir(source)) != nullptr)
{
fileName fName(list->d_name);
@ -976,7 +976,7 @@ bool Foam::rmDir(const fileName& directory)
struct dirent *list;
// Attempt to open directory and set the structure pointer
if ((source = opendir(directory.c_str())) == NULL)
if ((source = opendir(directory.c_str())) == nullptr)
{
WarningInFunction
<< "cannot open directory " << directory << endl;
@ -986,7 +986,7 @@ bool Foam::rmDir(const fileName& directory)
else
{
// Read and parse all the entries in the directory
while ((list = readdir(source)) != NULL)
while ((list = readdir(source)) != nullptr)
{
fileName fName(list->d_name);
@ -1074,7 +1074,7 @@ bool Foam::ping
struct sockaddr_in destAddr; // will hold the destination addr
u_int addr;
if ((hostPtr = gethostbyname(destName.c_str())) == NULL)
if ((hostPtr = gethostbyname(destName.c_str())) == nullptr)
{
FatalErrorIn
(

View file

@ -39,7 +39,7 @@ namespace Foam
void clockTime::getTime(struct timeval& t)
{
gettimeofday(&t, NULL);
gettimeofday(&t, nullptr);
}

View file

@ -313,8 +313,8 @@ void Foam::fileMonitor::checkFiles() const
(
watcher_->inotifyFd_+1, // num filedescriptors in fdSet
&fdSet, // fdSet with only inotifyFd
NULL, // No writefds
NULL, // No errorfds
nullptr, // No writefds
nullptr, // No errorfds
&zeroTimeout // eNo timeout
);

View file

@ -51,7 +51,7 @@ bool rwMutex::debug = false;
multiThreader::multiThreader(int numThreads)
:
maxQueueSize_(10),
poolInfo_(NULL)
poolInfo_(nullptr)
{
if (numThreads > 0)
{
@ -133,7 +133,7 @@ rwMutex::rwMutex()
Conditional::Conditional()
{
if (pthread_cond_init(&condition_, NULL))
if (pthread_cond_init(&condition_, nullptr))
{
FatalErrorIn("multiThreader::Conditional::Conditional()")
<< "Unable to initialize condition"
@ -197,8 +197,8 @@ void multiThreader::initializeThreadPool()
poolInfo_->numThreads = numThreads_;
poolInfo_->queueSize = 0;
poolInfo_->threads = new pthread_t[numThreads_];
poolInfo_->head = NULL;
poolInfo_->tail = NULL;
poolInfo_->head = nullptr;
poolInfo_->tail = nullptr;
// Initialize flags
poolInfo_->queueClosed = false;
@ -272,7 +272,7 @@ threadReturnType multiThreader::poolThread(void *arg)
if (poolInfo->shutDown)
{
poolInfo->queueLock.unlock();
pthread_exit(NULL);
pthread_exit(nullptr);
}
// Pick an item off the queue, and get to work
@ -280,7 +280,7 @@ threadReturnType multiThreader::poolThread(void *arg)
poolInfo->queueSize--;
if (poolInfo->queueSize == 0)
{
poolInfo->head = poolInfo->tail = NULL;
poolInfo->head = poolInfo->tail = nullptr;
}
else
{
@ -362,7 +362,7 @@ void multiThreader::addToWorkQueue
workQueueItem *newWorkItem = new workQueueItem;
newWorkItem->function = tFunction;
newWorkItem->arg = arg;
newWorkItem->next = NULL;
newWorkItem->next = nullptr;
// Add new work structure to the queue
if (poolInfo_->queueSize == 0)
@ -419,7 +419,7 @@ void multiThreader::destroyThreadPool()
// Wait for all workers to exit
for(int i=0; i < numThreads_; i++)
{
if (pthread_join(poolInfo_->threads[i],NULL))
if (pthread_join(poolInfo_->threads[i],nullptr))
{
FatalErrorIn("multiThreader::destroyThreadPool()")
<< "pthread_join failed."
@ -434,7 +434,7 @@ void multiThreader::destroyThreadPool()
delete [] poolInfo_->threads;
workQueueItem *currentNode;
while(poolInfo_->head != NULL)
while(poolInfo_->head != nullptr)
{
currentNode = poolInfo_->head->next;
poolInfo_->head = poolInfo_->head->next;

View file

@ -65,7 +65,7 @@ extern "C"
typedef void *(*threadFunctionType)(void *);
#define threadReturnType void *
#define threadReturnValue NULL
#define threadReturnValue nullptr
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -57,7 +57,7 @@ threadHandler<T>::~threadHandler()
// to avoid multiple deallocations.
forAll(argList_, indexI)
{
argList_[indexI] = NULL;
argList_[indexI] = nullptr;
}
}
@ -79,7 +79,7 @@ inline void threadHandler<T>::setSize
const label size
)
{
argList_.setSize(size, NULL);
argList_.setSize(size, nullptr);
}

View file

@ -61,7 +61,7 @@ string pOpen(const string &cmd, label line=0)
char* s = fgets(buffer, MAX-1, cmdPipe);
if (s == NULL)
if (s == nullptr)
{
#ifdef darwin
// workaround for the Python-Script
@ -346,7 +346,7 @@ void error::printStack(Ostream& os)
char* cplusNamePtr = abi::__cxa_demangle
(
cName.c_str(),
NULL, // have it malloc itself
nullptr, // have it malloc itself
0,
&status
);

View file

@ -119,7 +119,7 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const
{
clear();
// Avoid NULL pointer and zero-length patterns
// Avoid nullptr pointer and zero-length patterns
if (pattern && *pattern)
{
int cflags = REG_EXTENDED;

View file

@ -99,7 +99,7 @@ void* Foam::sigFpe::mallocNan(size_t size)
#elif defined(__APPLE__)
void *(*Foam::sigFpe::system_malloc_)(malloc_zone_t *zone, size_t size)=NULL;
void *(*Foam::sigFpe::system_malloc_)(malloc_zone_t *zone, size_t size)=nullptr;
void* Foam::sigFpe::nan_malloc_(malloc_zone_t *zone, size_t size)
{
@ -135,7 +135,7 @@ void* Foam::sigFpe::nan_malloc_(malloc_zone_t *zone, size_t size)
void Foam::sigFpe::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGFPE, &oldAction_, NULL) < 0)
if (sigaction(SIGFPE, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(
@ -159,7 +159,7 @@ void Foam::sigFpe::sigHandler(int)
Foam::sigFpe::sigFpe()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -171,7 +171,7 @@ Foam::sigFpe::~sigFpe()
{
# ifdef LINUX_GNUC
// Reset signal
if (oldAction_.sa_handler && sigaction(SIGFPE, &oldAction_, NULL) < 0)
if (oldAction_.sa_handler && sigaction(SIGFPE, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(
@ -256,7 +256,7 @@ void Foam::sigFpe::set(const bool verbose)
| _EN_OVERFL,
0,
_ABORT_ON_ERROR,
NULL
nullptr
);
# elif defined(__APPLE__)
@ -305,7 +305,7 @@ void Foam::sigFpe::set(const bool verbose)
# elif defined(__APPLE__)
if(system_malloc_!=NULL) {
if(system_malloc_!=nullptr) {
FatalErrorIn("Foam__sigFpe::set")
<< "system_malloc_ already reset." << endl
<< "This should never happen"
@ -314,7 +314,7 @@ void Foam::sigFpe::set(const bool verbose)
}
malloc_zone_t *zone = malloc_default_zone();
if(zone==NULL) {
if(zone==nullptr) {
FatalErrorIn("Foam__sigFpe::set")
<< "Could not get malloc_default_zone()." << endl
<< "Seems like this version of Mac OS X doesn't support FOAM_SETNAN"

View file

@ -38,7 +38,7 @@ struct sigaction Foam::sigInt::oldAction_;
void Foam::sigInt::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGINT, &oldAction_, NULL) < 0)
if (sigaction(SIGINT, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(
@ -59,7 +59,7 @@ void Foam::sigInt::sigHandler(int)
Foam::sigInt::sigInt()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -68,7 +68,7 @@ Foam::sigInt::sigInt()
Foam::sigInt::~sigInt()
{
// Reset old handling
if (sigaction(SIGINT, &oldAction_, NULL) < 0)
if (sigaction(SIGINT, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(

View file

@ -38,7 +38,7 @@ struct sigaction Foam::sigQuit::oldAction_;
void Foam::sigQuit::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGQUIT, &oldAction_, NULL) < 0)
if (sigaction(SIGQUIT, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(
@ -61,7 +61,7 @@ void Foam::sigQuit::sigHandler(int)
Foam::sigQuit::sigQuit()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -70,7 +70,7 @@ Foam::sigQuit::sigQuit()
Foam::sigQuit::~sigQuit()
{
// Reset old handling
if (oldAction_.sa_handler && sigaction(SIGQUIT, &oldAction_, NULL) < 0)
if (oldAction_.sa_handler && sigaction(SIGQUIT, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(

View file

@ -37,7 +37,7 @@ struct sigaction Foam::sigSegv::oldAction_;
void Foam::sigSegv::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGSEGV, &oldAction_, NULL) < 0)
if (sigaction(SIGSEGV, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(
@ -60,7 +60,7 @@ void Foam::sigSegv::sigHandler(int)
Foam::sigSegv::sigSegv()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -69,7 +69,7 @@ Foam::sigSegv::sigSegv()
Foam::sigSegv::~sigSegv()
{
// Reset old handling
if (sigaction(SIGSEGV, &oldAction_, NULL) < 0)
if (sigaction(SIGSEGV, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(

View file

@ -125,7 +125,7 @@ Foam::timer::~timer()
oldTimeOut_ = 0;
// Restore signal handler
if (sigaction(SIGALRM, &oldAction_, NULL) < 0)
if (sigaction(SIGALRM, &oldAction_, nullptr) < 0)
{
FatalErrorIn
(

Some files were not shown because too many files have changed in this diff Show more