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

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