C++11: Replaced the C NULL with the safer C++11 nullptr

Requires gcc version 4.7 or higher
This commit is contained in:
Henry Weller
2016-08-05 17:19:38 +01:00
parent 618753c5b4
commit 7656c076c8
363 changed files with 1468 additions and 1416 deletions

View File

@ -7,7 +7,7 @@ IOobject phiBHeader
);
surfaceScalarField* phiBPtr = NULL;
surfaceScalarField* phiBPtr = nullptr;
if (phiBHeader.headerOk())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,8 +45,8 @@ Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo
:
psiThermo(mesh, word::null),
twoPhaseMixture(mesh, *this),
thermo1_(NULL),
thermo2_(NULL)
thermo1_(nullptr),
thermo2_(nullptr)
{
{
volScalarField T1(IOobject::groupName("T", phase1Name()), T_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ Foam::phaseModel::phaseModel
name_(phaseName),
p_(p),
T_(T),
thermo_(NULL),
thermo_(nullptr),
dgdt_
(
IOobject
@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>(NULL);
return autoPtr<phaseModel>(nullptr);
}

View File

@ -203,7 +203,7 @@ Foam::phaseModel::~phaseModel()
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>(NULL);
return autoPtr<phaseModel>(nullptr);
}

View File

@ -123,7 +123,7 @@
++dmIter, ++dcIter
)
{
const phaseModel *phase2Ptr = NULL;
const phaseModel *phase2Ptr = nullptr;
if (&phase == &dmIter()->phase1())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,7 +68,7 @@ Foam::phase::phase
Foam::autoPtr<Foam::phase> Foam::phase::clone() const
{
NotImplemented;
return autoPtr<phase>(NULL);
return autoPtr<phase>(nullptr);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -102,7 +102,7 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::dmdt
const Foam::phaseModel& phase
) const
{
return tmp<volScalarField>(NULL);
return tmp<volScalarField>(nullptr);
}

View File

@ -175,7 +175,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
fluid.mesh(),
dimensionedVector("0", dimAcceleration, Zero)
),
divU_(NULL),
divU_(nullptr),
turbulence_
(
phaseCompressibleTurbulenceModel::New

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,7 +77,7 @@ Foam::phaseModel::phaseModel
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
{
NotImplemented;
return autoPtr<phaseModel>(NULL);
return autoPtr<phaseModel>(nullptr);
}
@ -168,7 +168,7 @@ bool Foam::phaseModel::compressible() const
const Foam::tmp<Foam::volScalarField>& Foam::phaseModel::divU() const
{
NotImplemented;
static tmp<Foam::volScalarField> divU_(NULL);
static tmp<Foam::volScalarField> divU_(nullptr);
return divU_;
}

View File

@ -102,7 +102,7 @@ void Foam::phaseSystem::generatePairsAndSubModels
: blendingMethods_["default"]
);
autoPtr<modelType> noModel(NULL);
autoPtr<modelType> noModel(nullptr);
forAllConstIter(typename modelTypeTable, tempModels, iter)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -115,7 +115,7 @@ public:
autoPtr<IATEsource> clone() const
{
NotImplemented;
return autoPtr<IATEsource>(NULL);
return autoPtr<IATEsource>(nullptr);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,7 +114,7 @@ public:
autoPtr<IATEsource> clone() const
{
NotImplemented;
return autoPtr<IATEsource>(NULL);
return autoPtr<IATEsource>(nullptr);
}

View File

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

View File

@ -943,7 +943,7 @@ uint32_t SuperFastHash (const char * data, int len)
{
uint32_t hash = 0;
if (len <= 0 || data == NULL) return 0;
if (len <= 0 || data == nullptr) return 0;
unsigned rem = len & 3;
len >>= 2;
@ -1060,14 +1060,14 @@ struct tagtest {
{ 0.0, "hashLookup3\t", hashLookup3 },
{ 0.0, "hashLookup3Orig\t", hashLookup3Orig },
{ 0.0, "SuperFastHash\t", SuperFastHash },
{ 0.0, NULL, NULL }
{ 0.0, nullptr, nullptr }
};
int main () {
int i, j;
GenerateCRC32Table ();
for (j=0; tests[j].name != NULL; j++) {
for (j=0; tests[j].name != nullptr; j++) {
for (i=0; i < 3; i++) {
double res = test (tests[j].hash);
if (tests[j].res == 0.0 || tests[j].res > res) tests[j].res = res;

View File

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
string me("Mark");
// Handling of null strings
if (regExp(NULL).match(me))
if (regExp(nullptr).match(me))
{
Info<< "fail - matched: " << me << endl;
}

View File

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

View File

@ -414,9 +414,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

@ -186,7 +186,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);
@ -205,9 +205,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;
@ -243,7 +243,7 @@ void ReadProblem
int i = 0;
while
(
CCMIONextEntity(NULL, problem, kCCMIOCellType, &i, &next)
CCMIONextEntity(nullptr, problem, kCCMIOCellType, &i, &next)
== kCCMIONoErr
)
{
@ -255,10 +255,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
)
{
@ -280,7 +280,7 @@ void ReadProblem
int k = 0;
while
(
CCMIONextEntity(NULL, problem, kCCMIOBoundaryRegion, &k, &boundary)
CCMIONextEntity(nullptr, problem, kCCMIOBoundaryRegion, &k, &boundary)
== kCCMIONoErr
)
{
@ -292,7 +292,7 @@ void ReadProblem
int prostarI = -1;
if
(
CCMIOReadOpti(NULL, boundary, "ProstarRegionNumber", &prostarI)
CCMIOReadOpti(nullptr, boundary, "ProstarRegionNumber", &prostarI)
== kCCMIONoErr
)
{
@ -318,12 +318,18 @@ void ReadProblem
int size;
if
(
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
== kCCMIONoErr
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;
@ -340,12 +346,18 @@ void ReadProblem
if
(
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
== kCCMIONoErr
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));
@ -353,12 +365,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));
@ -407,7 +419,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);
@ -431,7 +443,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
@ -439,12 +451,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;
@ -463,10 +475,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],
@ -503,22 +515,38 @@ 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],
kCCMIOStart, kCCMIOEnd);
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
kCCMIOStart, kCCMIOEnd);
CCMIOReadFaces
(
&err,
id,
kCCMIOBoundaryFaces,
&mapID,
nullptr,
&faces[0],
kCCMIOStart,
kCCMIOEnd
);
CCMIOReadFaceCells
(
&err,
id,
kCCMIOBoundaryFaces,
&faceCells[0],
kCCMIOStart,
kCCMIOEnd
);
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
CheckError(err, "Error reading boundary faces");
@ -526,7 +554,7 @@ void ReadCells
int prostarI;
if
(
CCMIOReadOpti(NULL, id, "ProstarRegionNumber", &prostarI)
CCMIOReadOpti(nullptr, id, "ProstarRegionNumber", &prostarI)
== kCCMIONoErr
)
{
@ -639,12 +667,12 @@ 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
// value to 'err'.).
// in nullptr (which always means kCCMIONoErr) and then assign the
// return value to 'err'.).
CCMIOID root;
CCMIOError err = CCMIOOpenFile
(
NULL,
nullptr,
ccmFile.c_str(),
kCCMIORead,
&root
@ -659,9 +687,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;
@ -678,7 +706,7 @@ int main(int argc, char *argv[])
processor,
&vertices,
&topology,
NULL,
nullptr,
&solution
);
@ -692,8 +720,8 @@ int main(int argc, char *argv[])
processor,
&vertices,
&topology,
NULL,
NULL
nullptr,
nullptr
);
if (err != kCCMIONoErr)
{

View File

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

View File

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

View File

@ -258,84 +258,84 @@ YIELD STRESS
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
PRESSURE PASCAL
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
CONVECTIVE FILM COEFFICIENT
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
CONVECTION COEFFICIENT J/M^2/K/SEC
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
THERMAL CAPACITY PER UNIT AREA
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
THERMAL CAPACITY PER UNIT AREA J/M^2/K
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
SURFACE HEAT FLUX RATE
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
HEAT FLUX PER UNIT AREA J/M^2/SEC
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
VISCOSITY
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
VISCOSITY KG/M/SEC
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
COEFFICIENT OF FRICTION
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
DIMENSIONLESS UNITLESS
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
AREA FACTOR
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
DIMENSIONLESS UNITLESS
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
EMISSIVITY
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
DIMENSIONLESS UNITLESS
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
ABSORPTIVITY
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
DIMENSIONLESS UNITLESS
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
HEAT FLUX RATE
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
HEAT FLUX PER UNIT LENGTH J/M/SEC
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
INTERACTION TERM FOR TSAI-WU
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
DIMENSIONLESS UNITLESS
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
SWELLING COEFFICIENT
1 VERSION NUMBER
0 LINE(S) OF TEXT
DIMENSIONS AND UNITS:
DIMENSIONLESS UNITLESS
NULL_PROPERTY
nullptr_PROPERTY
--------------------------------------------------------------------------------
DEFAULT MATERIAL PROPERT(IES):
MODULUS OF ELASTICITY VERSION : 1

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -255,7 +255,7 @@ Foam::starMesh::starMesh
cellPolys_(0),
nInternalFaces_(0),
polyBoundaryPatchStartIndices_(0),
pointCellsPtr_(NULL),
pointCellsPtr_(nullptr),
couples_(0),
isShapeMesh_(true)
{

View File

@ -1177,7 +1177,11 @@ void setCouplingInfo
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> newPatches(patches.size(), static_cast<polyPatch*>(NULL));
List<polyPatch*> newPatches
(
patches.size(),
static_cast<polyPatch*>(nullptr)
);
forAll(zoneToPatch, zoneI)
{

View File

@ -866,7 +866,7 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
"backgroundMeshDecomposition"
)
)
: NULL
: nullptr
),
cellShapeControl_
(

View File

@ -1810,7 +1810,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
}
// Error if startCell is null
if (startCell == NULL)
if (startCell == nullptr)
{
Pout<< "Start cell is null!" << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,7 +101,7 @@ public:
virtual autoPtr<searchableSurfaceFeatures> clone() const
{
NotImplemented;
return autoPtr<searchableSurfaceFeatures>(NULL);
return autoPtr<searchableSurfaceFeatures>(nullptr);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -109,7 +109,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>(NULL);
return autoPtr<faceSelection>(nullptr);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,7 +86,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>(NULL);
return autoPtr<faceSelection>(nullptr);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,7 +79,7 @@ public:
autoPtr<faceSelection> clone() const
{
NotImplemented;
return autoPtr<faceSelection>(NULL);
return autoPtr<faceSelection>(nullptr);
}

View File

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

View File

@ -871,7 +871,7 @@ int main(int argc, char *argv[])
// Main command read & execute loop
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
autoPtr<IFstream> fileStreamPtr(NULL);
autoPtr<IFstream> fileStreamPtr(nullptr);
if (batch)
{

View File

@ -680,7 +680,7 @@ int main(int argc, char *argv[])
new List<SLList<indexedParticle*>*>
(
mesh.nCells(),
static_cast<SLList<indexedParticle*>*>(NULL)
static_cast<SLList<indexedParticle*>*>(nullptr)
)
);
@ -947,7 +947,7 @@ int main(int argc, char *argv[])
if (times.size() == 1)
{
// Clear cached decomposer
fieldDecomposerList.set(proci, NULL);
fieldDecomposerList.set(proci, nullptr);
}
}
@ -978,7 +978,7 @@ int main(int argc, char *argv[])
if (times.size() == 1)
{
dimFieldDecomposerList.set(proci, NULL);
dimFieldDecomposerList.set(proci, nullptr);
}
}
@ -1029,8 +1029,8 @@ int main(int argc, char *argv[])
if (times.size() == 1)
{
pointProcAddressingList.set(proci, NULL);
pointFieldDecomposerList.set(proci, NULL);
pointProcAddressingList.set(proci, nullptr);
pointFieldDecomposerList.set(proci, nullptr);
}
}
@ -1133,11 +1133,11 @@ int main(int argc, char *argv[])
// times, otherwise it is just extra storage.
if (times.size() == 1)
{
boundaryProcAddressingList.set(proci, NULL);
cellProcAddressingList.set(proci, NULL);
faceProcAddressingList.set(proci, NULL);
procMeshList.set(proci, NULL);
processorDbList.set(proci, NULL);
boundaryProcAddressingList.set(proci, nullptr);
cellProcAddressingList.set(proci, nullptr);
faceProcAddressingList.set(proci, nullptr);
procMeshList.set(proci, nullptr);
processorDbList.set(proci, nullptr);
}
}
}

View File

@ -88,7 +88,7 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
false
)
)
: NULL
: nullptr
),
nProcs_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,7 +89,7 @@ Foam::pointFieldDecomposer::pointFieldDecomposer
patchFieldDecomposerPtrs_
(
procMesh_.boundary().size(),
static_cast<patchFieldDecomposer*>(NULL)
static_cast<patchFieldDecomposer*>(nullptr)
)
{
forAll(boundaryAddressing_, patchi)

View File

@ -227,7 +227,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
{
return autoPtr<mapPolyMesh>(NULL);
return autoPtr<mapPolyMesh>(nullptr);
}
polyTopoChange meshMod(mesh);

View File

@ -216,7 +216,7 @@ void writePatchField
word timeFile = prepend + itoa(timeIndex);
ensightStream* ensightFilePtr = NULL;
ensightStream* ensightFilePtr = nullptr;
if (Pstream::master())
{
if (timeIndex == 0)
@ -330,7 +330,7 @@ void ensightField
const labelList& hexes = meshCellSets.hexes;
const labelList& polys = meshCellSets.polys;
ensightStream* ensightFilePtr = NULL;
ensightStream* ensightFilePtr = nullptr;
if (Pstream::master())
{
// set the filename of the ensight file
@ -548,7 +548,7 @@ void ensightPointField
const wordHashSet& faceZoneNames = eMesh.faceZoneNames();
ensightStream* ensightFilePtr = NULL;
ensightStream* ensightFilePtr = nullptr;
if (Pstream::master())
{
// set the filename of the ensight file

View File

@ -1041,7 +1041,7 @@ void Foam::ensightMesh::write
// set the filename of the ensight file
fileName ensightGeometryFileName = timeFile + "mesh";
ensightStream* ensightGeometryFilePtr = NULL;
ensightStream* ensightGeometryFilePtr = nullptr;
if (Pstream::master())
{
if (binary_)

View File

@ -196,7 +196,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

@ -381,7 +381,7 @@ int main(int argc, char *argv[])
// check that the positions field is present for this time
IOobject* positionPtr = cloudObjs.lookup(word("positions"));
if (positionPtr != NULL)
if (positionPtr != nullptr)
{
ensightParticlePositions
(

View File

@ -111,8 +111,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 */
@ -191,8 +191,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 */
@ -273,8 +273,8 @@ Pout<< "zoneName:" << zoneName
<< endl;
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
@ -373,9 +373,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 */
)
)
{
@ -487,9 +487,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

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -206,14 +206,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

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,10 +58,10 @@ vtkPV3FoamReader::vtkPV3FoamReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
output0_ = NULL;
output0_ = nullptr;
#ifdef VTKPV3FOAM_DUALPORT
// Add second output for the Lagrangian
@ -217,7 +217,7 @@ int vtkPV3FoamReader::RequestInformation
// delete foamData and flag it as fatal error
delete foamData_;
foamData_ = NULL;
foamData_ = nullptr;
return 0;
}

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,7 +190,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
<< patchName << endl;
}
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (patchIds.size() == 1)
{
vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
const word& cloudName
)
{
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (debug)
{

View File

@ -228,7 +228,7 @@ void Foam::vtkPV3Foam::updateInfoPatches
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfoPatches"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
@ -476,7 +476,7 @@ void Foam::vtkPV3Foam::updateInfoZones
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfoZones"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
wordList namesLst;

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,8 +56,8 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
ShowPointNumbers = 1;
UpdateGUI = 0;
@ -165,7 +165,7 @@ int vtkPV3blockMeshReader::RequestInformation
//
// // delete foamData and flag it as fatal error
// delete foamData_;
// foamData_ = NULL;
// foamData_ = nullptr;
// return 0;
// }

View File

@ -66,7 +66,7 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks
if (debug)
{
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoBlocks"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
@ -109,7 +109,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges
if (debug)
{
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoEdges"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
@ -150,8 +150,8 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
arrayRangeBlocks_("block"),
@ -269,7 +269,7 @@ void Foam::vtkPV3blockMesh::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
}
resetCounters();

View File

@ -58,10 +58,10 @@ vtkPVFoamReader::vtkPVFoamReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
output0_ = NULL;
output0_ = nullptr;
#ifdef VTKPVFOAM_DUALPORT
// Add second output for the Lagrangian
@ -217,7 +217,7 @@ int vtkPVFoamReader::RequestInformation
// delete foamData and flag it as fatal error
delete foamData_;
foamData_ = NULL;
foamData_ = nullptr;
return 0;
}

View File

@ -86,7 +86,7 @@ void Foam::vtkPVFoam::reduceMemory()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
}
@ -226,8 +226,8 @@ Foam::vtkPVFoam::vtkPVFoam
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
timeIndex_(-1),
@ -347,7 +347,7 @@ void Foam::vtkPVFoam::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
<< timeIndex_ << endl;
}
@ -426,7 +426,7 @@ void Foam::vtkPVFoam::updateFoamMesh()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
// Check to see if the OpenFOAM mesh has been created
@ -551,7 +551,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

@ -188,7 +188,7 @@ void Foam::vtkPVFoam::convertMeshPatches
<< patchName << endl;
}
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (patchIds.size() == 1)
{
vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);

View File

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

View File

@ -228,7 +228,7 @@ void Foam::vtkPVFoam::updateInfoPatches
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoPatches"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
@ -476,7 +476,7 @@ void Foam::vtkPVFoam::updateInfoZones
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoZones"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
wordList namesLst;

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

@ -56,8 +56,8 @@ vtkPVblockMeshReader::vtkPVblockMeshReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
ShowPointNumbers = 1;
UpdateGUI = 0;
@ -165,7 +165,7 @@ int vtkPVblockMeshReader::RequestInformation
//
// // delete foamData and flag it as fatal error
// delete foamData_;
// foamData_ = NULL;
// foamData_ = nullptr;
// return 0;
// }

View File

@ -66,7 +66,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
if (debug)
{
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoBlocks"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
@ -109,7 +109,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
if (debug)
{
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoEdges"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
@ -150,8 +150,8 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
arrayRangeBlocks_("block"),
@ -269,7 +269,7 @@ void Foam::vtkPVblockMesh::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPVblockMesh::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
}
resetCounters();

View File

@ -32,7 +32,7 @@ bool Foam::fieldOk(const IOobjectList& cloudObjs, const word& name)
{
IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
return (objects.lookup(name) != NULL);
return (objects.lookup(name) != nullptr);
}
@ -46,7 +46,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField
IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
const IOobject* obj = objects.lookup(name);
if (obj != NULL)
if (obj != nullptr)
{
IOField<Type> newField(*obj);
return tmp<Field<Type>>(new Field<Type>(newField.xfer()));
@ -73,7 +73,7 @@ void Foam::readFields
forAll(fieldNames, j)
{
const IOobject* obj = objects.lookup(fieldNames[j]);
if (obj != NULL)
if (obj != nullptr)
{
Info<< " reading field " << fieldNames[j] << endl;
IOField<Type> newField(*obj);
@ -158,7 +158,7 @@ void Foam::processFields
forAll(userFieldNames, i)
{
IOobject* obj = objects.lookup(userFieldNames[i]);
if (obj != NULL)
if (obj != nullptr)
{
fieldNames.append(obj->name());
}

View File

@ -34,7 +34,7 @@
const scalar xMin = p->minValue();
const scalar xMax = p->maxValue();
autoPtr<OFstream> filePtr(NULL);
autoPtr<OFstream> filePtr(nullptr);
if (writeData)
{
fileName fName = pdfPath/(p->type() + ".data");

View File

@ -49,7 +49,7 @@ void processField
IOobjectList fieldObjbjects(objects.lookupClass(fieldType::typeName));
if (fieldObjbjects.lookup(fieldName) != NULL)
if (fieldObjbjects.lookup(fieldName) != nullptr)
{
fieldType vtf(*fieldObjbjects.lookup(fieldName), mesh);
const typename fieldType::Boundary& bf =

View File

@ -133,7 +133,7 @@ void rewriteBoundary
if (patchDict.found("neighbourPatch"))
{
patches.set(patchi, oldPatches.set(patchi, NULL));
patches.set(patchi, oldPatches.set(patchi, nullptr));
oldToNew[patchi] = newPatchi++;
// Check if patches come from automatic conversion
@ -181,7 +181,7 @@ void rewriteBoundary
const dictionary patchDict(patches[patchi].dict());
// Change entry on this side
patches.set(patchi, oldPatches.set(patchi, NULL));
patches.set(patchi, oldPatches.set(patchi, nullptr));
oldToNew[patchi] = newPatchi++;
dictionary& thisPatchDict = patches[patchi].dict();
thisPatchDict.add("neighbourPatch", nbrName);
@ -226,7 +226,7 @@ void rewriteBoundary
}
else
{
patches.set(patchi, oldPatches.set(patchi, NULL));
patches.set(patchi, oldPatches.set(patchi, nullptr));
oldToNew[patchi] = newPatchi++;
}
}

View File

@ -34,7 +34,7 @@ template<class Type>
List<Type>::List(int s){
num=0;
array_size = 0;
element = NULL;
element = nullptr;
if(s) {
allocate(s);
}

View File

@ -198,12 +198,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,35 +271,35 @@ 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,
if (hWnd == nullptr) {
MessageBox(nullptr,
"CreateWindow() failed: Cannot create a window.",
"Error", MB_OK);
return NULL;
return nullptr;
}
hDC = GetDC(hWnd);
@ -318,14 +318,14 @@ 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;
}
@ -414,7 +414,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);
@ -444,7 +444,7 @@ int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,
}
quit:
wglMakeCurrent(NULL, NULL);
wglMakeCurrent(nullptr, nullptr);
ReleaseDC(hDC, hWnd);
wglDeleteContext(hRC);
DestroyWindow(hWnd);

View File

@ -95,7 +95,7 @@ pid_t Foam::pgid()
bool Foam::env(const word& envName)
{
return ::getenv(envName.c_str()) != NULL;
return ::getenv(envName.c_str()) != nullptr;
}
@ -171,7 +171,7 @@ Foam::string Foam::userName()
{
struct passwd* pw = ::getpwuid(::getuid());
if (pw != NULL)
if (pw != nullptr)
{
return pw->pw_name;
}
@ -192,7 +192,7 @@ Foam::fileName Foam::home()
{
char* env = ::getenv("HOME");
if (env != NULL)
if (env != nullptr)
{
return fileName(env);
}
@ -200,7 +200,7 @@ Foam::fileName Foam::home()
{
struct passwd* pw = ::getpwuid(getuid());
if (pw != NULL)
if (pw != nullptr)
{
return pw->pw_dir;
}
@ -224,7 +224,7 @@ Foam::fileName Foam::home(const string& userName)
{
char* env = ::getenv("HOME");
if (env != NULL)
if (env != nullptr)
{
return fileName(env);
}
@ -232,7 +232,7 @@ Foam::fileName Foam::home(const string& userName)
pw = ::getpwuid(::getuid());
}
if (pw != NULL)
if (pw != nullptr)
{
return pw->pw_dir;
}
@ -551,7 +551,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);
@ -564,7 +564,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);
@ -849,7 +849,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;
@ -859,7 +859,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);
@ -945,7 +945,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)
{
FatalErrorInFunction
<< "gethostbyname error " << h_errno << " for host " << destName

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

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,7 +48,7 @@ string pOpen(const string &cmd, label line=0)
if (cmdPipe)
{
char *buf = NULL;
char *buf = nullptr;
// Read line number of lines
for (label cnt = 0; cnt <= line; cnt++)
@ -69,7 +69,7 @@ string pOpen(const string &cmd, label line=0)
}
}
if (buf != NULL)
if (buf != nullptr)
{
free(buf);
}
@ -163,7 +163,7 @@ word demangleSymbol(const char* sn)
char* cxx_sname = abi::__cxa_demangle
(
sn,
NULL,
nullptr,
0,
&st
);
@ -227,13 +227,13 @@ void Foam::error::printStack(Ostream& os)
int st = dladdr(callstack[i], info);
os << '#' << label(i) << " ";
if (st != 0 && info->dli_fname != NULL && info->dli_fname[0] != '\0')
if (st != 0 && info->dli_fname != nullptr && info->dli_fname[0] != '\0')
{
fname = absolutePath(info->dli_fname);
os <<
(
(info->dli_sname != NULL)
(info->dli_sname != nullptr)
? demangleSymbol(info->dli_sname)
: "?"
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -117,7 +117,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

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -90,7 +90,7 @@ void* Foam::sigFpe::mallocNan(size_t size)
void Foam::sigFpe::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGFPE, &oldAction_, NULL) < 0)
if (sigaction(SIGFPE, &oldAction_, nullptr) < 0)
{
FatalErrorInFunction
<< "Cannot reset SIGFPE trapping"
@ -112,7 +112,7 @@ void Foam::sigFpe::sigHandler(int)
Foam::sigFpe::sigFpe()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -124,7 +124,11 @@ 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
)
{
FatalErrorInFunction
<< "Cannot reset SIGFPE trapping"
@ -199,7 +203,7 @@ void Foam::sigFpe::set(const bool verbose)
| _EN_OVERFL,
0,
_ABORT_ON_ERROR,
NULL
nullptr
);
#endif

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -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)
{
FatalErrorInFunction
<< "Cannot reset SIGINT trapping"
@ -57,7 +57,7 @@ void Foam::sigInt::sigHandler(int)
Foam::sigInt::sigInt()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -66,7 +66,7 @@ Foam::sigInt::sigInt()
Foam::sigInt::~sigInt()
{
// Reset old handling
if (sigaction(SIGINT, &oldAction_, NULL) < 0)
if (sigaction(SIGINT, &oldAction_, nullptr) < 0)
{
FatalErrorInFunction
<< "Cannot reset SIGINT trapping"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -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)
{
FatalErrorInFunction
<< "Cannot reset SIGQUIT trapping"
@ -59,7 +59,7 @@ void Foam::sigQuit::sigHandler(int)
Foam::sigQuit::sigQuit()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -68,7 +68,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)
{
FatalErrorInFunction
<< "Cannot reset SIGQUIT trapping"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,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)
{
FatalErrorInFunction
<< "Cannot reset SIGSEGV trapping"
@ -59,7 +59,7 @@ void Foam::sigSegv::sigHandler(int)
Foam::sigSegv::sigSegv()
{
oldAction_.sa_handler = NULL;
oldAction_.sa_handler = nullptr;
}
@ -68,7 +68,7 @@ Foam::sigSegv::sigSegv()
Foam::sigSegv::~sigSegv()
{
// Reset old handling
if (sigaction(SIGSEGV, &oldAction_, NULL) < 0)
if (sigaction(SIGSEGV, &oldAction_, nullptr) < 0)
{
FatalErrorInFunction
<< "Cannot reset SIGSEGV trapping"

View File

@ -67,7 +67,7 @@ addstopAtWriteNowSignalToOpt addstopAtWriteNowSignalToOpt_
}
static Foam::Time const* runTimePtr_ = NULL;
static Foam::Time const* runTimePtr_ = nullptr;
struct sigaction Foam::sigStopAtWriteNow::oldAction_;
@ -78,7 +78,7 @@ struct sigaction Foam::sigStopAtWriteNow::oldAction_;
void Foam::sigStopAtWriteNow::sigHandler(int)
{
// Reset old handling
if (sigaction(signal_, &oldAction_, NULL) < 0)
if (sigaction(signal_, &oldAction_, nullptr) < 0)
{
FatalErrorInFunction
<< "Cannot reset " << signal_ << " trapping"
@ -123,7 +123,7 @@ Foam::sigStopAtWriteNow::~sigStopAtWriteNow()
// Reset old handling
if (signal_ > 0)
{
if (sigaction(signal_, &oldAction_, NULL) < 0)
if (sigaction(signal_, &oldAction_, nullptr) < 0)
{
FatalErrorInFunction
<< "Cannot reset " << signal_ << " trapping"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ addwriteNowSignalToOpt addwriteNowSignalToOpt_("writeNowSignal");
}
static Foam::Time* runTimePtr_ = NULL;
static Foam::Time* runTimePtr_ = nullptr;
struct sigaction Foam::sigWriteNow::oldAction_;
@ -106,7 +106,7 @@ Foam::sigWriteNow::~sigWriteNow()
// Reset old handling
if (signal_ > 0)
{
if (sigaction(signal_, &oldAction_, NULL) < 0)
if (sigaction(signal_, &oldAction_, nullptr) < 0)
{
FatalErrorInFunction
<< "Cannot reset " << signal_ << " trapping"

View File

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

View File

@ -109,7 +109,7 @@ const T* Foam::DictionaryBase<IDLListType, T>::lookupPtr
}
else
{
return NULL;
return nullptr;
}
}
@ -125,7 +125,7 @@ T* Foam::DictionaryBase<IDLListType, T>::lookupPtr(const word& keyword)
}
else
{
return NULL;
return nullptr;
}
}
@ -220,7 +220,7 @@ T* Foam::DictionaryBase<IDLListType, T>::remove(const word& keyword)
}
else
{
return NULL;
return nullptr;
}
}

View File

@ -113,10 +113,10 @@ public:
//- Search DictionaryBase for given keyword
bool found(const word&) const;
//- Find and return an entry if present, otherwise return NULL
//- Find and return an entry if present, otherwise return nullptr
const T* lookupPtr(const word&) const;
//- Find and return an entry if present, otherwise return NULL
//- Find and return an entry if present, otherwise return nullptr
T* lookupPtr(const word&);
//- Find and return entry
@ -141,7 +141,7 @@ public:
void append(const word&, T*);
//- Remove and return entry specified by keyword.
// Return NULL if the keyword was not found.
// Return nullptr if the keyword was not found.
T* remove(const word&);
//- Clear the dictionary

View File

@ -37,7 +37,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(const label size)
HashTableCore(),
nElmts_(0),
tableSize_(HashTableCore::canonicalSize(size)),
table_(NULL)
table_(nullptr)
{
if (tableSize_)
{
@ -57,7 +57,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
HashTableCore(),
nElmts_(0),
tableSize_(ht.tableSize_),
table_(NULL)
table_(nullptr)
{
if (tableSize_)
{
@ -84,7 +84,7 @@ Foam::HashTable<T, Key, Hash>::HashTable
HashTableCore(),
nElmts_(0),
tableSize_(0),
table_(NULL)
table_(nullptr)
{
transfer(ht());
}
@ -304,7 +304,7 @@ bool Foam::HashTable<T, Key, Hash>::set
template<class T, class Key, class Hash>
bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
{
// Note: entryPtr_ is NULL for end(), so this catches that too
// Note: entryPtr_ is nullptr for end(), so this catches that too
if (entryPtr_)
{
// Search element before entryPtr_
@ -337,7 +337,7 @@ bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
hashTable_->table_[hashIndex_] = entryPtr_->next_;
delete entryPtr_;
// Assign any non-NULL pointer value so it doesn't look
// Assign any non-nullptr pointer value so it doesn't look
// like end()/cend()
entryPtr_ = reinterpret_cast<hashedEntry*>(this);
@ -519,7 +519,7 @@ void Foam::HashTable<T, Key, Hash>::transfer(HashTable<T, Key, Hash>& ht)
ht.tableSize_ = 0;
table_ = ht.table_;
ht.table_ = NULL;
ht.table_ = nullptr;
nElmts_ = ht.nElmts_;
ht.nElmts_ = 0;

View File

@ -181,7 +181,7 @@ inline Foam::HashTable<T, Key, Hash>::iteratorBase::iteratorBase
{
if (hashTable_->nElmts_)
{
// find first non-NULL table entry
// find first non-nullptr table entry
while
(
!(entryPtr_ = hashTable_->table_[hashIndex_])
@ -235,7 +235,7 @@ Foam::HashTable<T, Key, Hash>::iteratorBase::increment()
}
// else
// {
// // if we reach here (entryPtr_ is NULL) it is already at the end()
// // if we reach here (entryPtr_ is nullptr) it is already at the end()
// // we should probably stop
// }

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(Istream& is, const label size)
HashTableCore(),
nElmts_(0),
tableSize_(HashTableCore::canonicalSize(size)),
table_(NULL)
table_(nullptr)
{
if (tableSize_)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -197,7 +197,7 @@ public:
// Private Member Functions
//- Construct for a given SLListBase with NULL element and link.
//- Construct for a given SLListBase with nullptr element and link.
// Only used to create endIter
inline iterator(DLListBase&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,7 +190,7 @@ inline Foam::DLListBase::iterator::iterator(DLListBase& s, link* elmt)
inline Foam::DLListBase::iterator::iterator(DLListBase& s)
:
curList_(s),
curElmt_(NULL),
curElmt_(nullptr),
curLink_()
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -179,7 +179,7 @@ public:
// Private Member Functions
//- Construct for a given SLListBase with NULL element and link.
//- Construct for a given SLListBase with nullptr element and link.
// Only used to create endIter
inline iterator(SLListBase&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -166,7 +166,7 @@ inline Foam::SLListBase::iterator::iterator(SLListBase& s, link* elmt)
inline Foam::SLListBase::iterator::iterator(SLListBase& s)
:
curList_(s),
curElmt_(NULL),
curElmt_(nullptr),
curLink_()
{}

View File

@ -55,7 +55,7 @@ template<class T>
template<class InputIterator>
Foam::List<T>::List(InputIterator first, InputIterator last, const label s)
:
UList<T>(NULL, s)
UList<T>(nullptr, s)
{
if (this->size_)
{
@ -75,7 +75,7 @@ Foam::List<T>::List(InputIterator first, InputIterator last, const label s)
template<class T>
Foam::List<T>::List(const label s)
:
UList<T>(NULL, s)
UList<T>(nullptr, s)
{
if (this->size_ < 0)
{
@ -94,7 +94,7 @@ Foam::List<T>::List(const label s)
template<class T>
Foam::List<T>::List(const label s, const T& a)
:
UList<T>(NULL, s)
UList<T>(nullptr, s)
{
if (this->size_ < 0)
{
@ -118,7 +118,7 @@ Foam::List<T>::List(const label s, const T& a)
template<class T>
Foam::List<T>::List(const label s, const zero)
:
UList<T>(NULL, s)
UList<T>(nullptr, s)
{
if (this->size_ < 0)
{
@ -142,7 +142,7 @@ Foam::List<T>::List(const label s, const zero)
template<class T>
Foam::List<T>::List(const List<T>& a)
:
UList<T>(NULL, a.size_)
UList<T>(nullptr, a.size_)
{
if (this->size_)
{
@ -170,7 +170,7 @@ template<class T>
template<class T2>
Foam::List<T>::List(const List<T2>& a)
:
UList<T>(NULL, a.size())
UList<T>(nullptr, a.size())
{
if (this->size_)
{
@ -195,7 +195,7 @@ Foam::List<T>::List(const Xfer<List<T>>& lst)
template<class T>
Foam::List<T>::List(List<T>& a, bool reuse)
:
UList<T>(NULL, a.size_)
UList<T>(nullptr, a.size_)
{
if (reuse)
{
@ -228,7 +228,7 @@ Foam::List<T>::List(List<T>& a, bool reuse)
template<class T>
Foam::List<T>::List(const UList<T>& a, const labelUList& map)
:
UList<T>(NULL, map.size())
UList<T>(nullptr, map.size())
{
if (this->size_)
{
@ -256,7 +256,7 @@ template<class T>
template<unsigned Size>
Foam::List<T>::List(const FixedList<T, Size>& lst)
:
UList<T>(NULL, Size)
UList<T>(nullptr, Size)
{
CopyList(lst);
}
@ -265,7 +265,7 @@ Foam::List<T>::List(const FixedList<T, Size>& lst)
template<class T>
Foam::List<T>::List(const PtrList<T>& lst)
:
UList<T>(NULL, lst.size())
UList<T>(nullptr, lst.size())
{
CopyList(lst);
}
@ -281,7 +281,7 @@ Foam::List<T>::List(const SLList<T>& lst)
template<class T>
Foam::List<T>::List(const UIndirectList<T>& lst)
:
UList<T>(NULL, lst.size())
UList<T>(nullptr, lst.size())
{
CopyList(lst);
}
@ -290,7 +290,7 @@ Foam::List<T>::List(const UIndirectList<T>& lst)
template<class T>
Foam::List<T>::List(const BiIndirectList<T>& lst)
:
UList<T>(NULL, lst.size())
UList<T>(nullptr, lst.size())
{
CopyList(lst);
}

View File

@ -34,7 +34,7 @@ License
template<class T>
Foam::List<T>::List(Istream& is)
:
UList<T>(NULL, 0)
UList<T>(nullptr, 0)
{
operator>>(is, *this);
}

View File

@ -164,7 +164,7 @@ void Foam::PtrList<T>::setSize(const label newSize)
label i;
for (i=oldSize; i<newSize; i++)
{
this->ptrs_[i] = NULL;
this->ptrs_[i] = nullptr;
}
}
}

View File

@ -123,7 +123,7 @@ public:
// Edit
//- Reset size of PtrList. If extending the PtrList, new entries are
// set to NULL. If truncating the PtrList, removed entries are
// set to nullptr. If truncating the PtrList, removed entries are
// deleted
void setSize(const label);
@ -149,7 +149,7 @@ public:
//- Is element set
inline bool set(const label) const;
//- Set element to given T* and return old element (can be NULL)
//- Set element to given T* and return old element (can be nullptr)
inline autoPtr<T> set(const label, T*);
//- Set element to given autoPtr<T> and return old element

View File

@ -64,7 +64,7 @@ inline void Foam::PtrList<T>::append
template<class T>
inline bool Foam::PtrList<T>::set(const label i) const
{
return this->ptrs_[i] != NULL;
return this->ptrs_[i] != nullptr;
}

View File

@ -74,10 +74,10 @@ void Foam::UPtrList<T>::setSize(const label newSize)
{
ptrs_.setSize(newSize);
// set new elements to NULL
// set new elements to nullptr
for (label i=oldSize; i<newSize; i++)
{
ptrs_[i] = NULL;
ptrs_[i] = nullptr;
}
}
}

View File

@ -200,7 +200,7 @@ public:
//- Is element set
inline bool set(const label) const;
//- Set element. Return old element (can be NULL).
//- Set element. Return old element (can be nullptr).
// No checks on new element
inline T* set(const label, T*);

View File

@ -77,7 +77,7 @@ inline void Foam::UPtrList<T>::resize(const label newSize)
template<class T>
inline bool Foam::UPtrList<T>::set(const label i) const
{
return ptrs_[i] != NULL;
return ptrs_[i] != nullptr;
}

View File

@ -387,12 +387,12 @@ Foam::Istream* Foam::IOobject::objectStream(const fileName& fName)
else
{
delete isPtr;
return NULL;
return nullptr;
}
}
else
{
return NULL;
return nullptr;
}
}

View File

@ -160,11 +160,11 @@ protected:
// Protected Member Functions
//- Construct and return an IFstream for the object.
// The results is NULL if the stream construction failed
// The results is nullptr if the stream construction failed
Istream* objectStream();
//- Construct and return an IFstream for the object given the
// exact file. The results is NULL if the stream construction failed
// exact file. The results is nullptr if the stream construction failed
Istream* objectStream(const fileName&);
//- Set the object state to bad

View File

@ -145,7 +145,7 @@ Foam::IOobject* Foam::IOobjectList::lookup(const word& name) const
InfoInFunction << "Could not find " << name << endl;
}
return NULL;
return nullptr;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,7 +92,7 @@ public:
//- Remove an IOobject from the list
bool remove(IOobject&);
//- Lookup a given name and return IOobject ptr if found else NULL
//- Lookup a given name and return IOobject ptr if found else nullptr
IOobject* lookup(const word& name) const;
//- Return the list for all IOobects whose name matches name

View File

@ -39,7 +39,7 @@ namespace Foam
Foam::IFstreamAllocator::IFstreamAllocator(const fileName& pathname)
:
ifPtr_(NULL),
ifPtr_(nullptr),
compression_(IOstream::UNCOMPRESSED)
{
if (pathname.empty())

View File

@ -43,7 +43,7 @@ Foam::OFstreamAllocator::OFstreamAllocator
IOstream::compressionType compression
)
:
ofPtr_(NULL)
ofPtr_(nullptr)
{
if (pathname.empty())
{

View File

@ -94,7 +94,7 @@ public:
//- Standard punctuation tokens
enum punctuationToken
{
NULL_TOKEN = '\0',
nullptr_TOKEN = '\0',
SPACE = ' ',
TAB = '\t',
NL = '\n',

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