consistency update for null pointers

- uniform use of reinterpret_cast<foo*>(0) instead of
  reinterpret_cast<foo*>(NULL)

- make all static null() members inline since they are really only a cast:
      "*reinterpret_cast<foo*>(0)"
This commit is contained in:
Mark Olesen
2009-01-16 10:15:49 +01:00
parent a2b24d07a8
commit 246d569c4d
50 changed files with 164 additions and 178 deletions

View File

@ -3,7 +3,7 @@ int nFields = volScalarNames.size() + 3*volVectorNames.size();
List<volScalarField*> volFieldPtrs
(
nFields,
reinterpret_cast<volScalarField*>(NULL)
reinterpret_cast<volScalarField*>(0)
);
stringList volFieldNames(nFields);
@ -27,12 +27,11 @@ nFields = 0;
if (ioHeader.headerOk())
{
volFieldPtrs[nFields] =
new volScalarField
(
ioHeader,
mesh
);
volFieldPtrs[nFields] = new volScalarField
(
ioHeader,
mesh
);
}
fieldName = getFieldViewName(fieldName);
@ -106,7 +105,7 @@ int nSurfFields = surfScalarNames.size() + 3*surfVectorNames.size();
List<surfaceScalarField*> surfFieldPtrs
(
nSurfFields,
reinterpret_cast<surfaceScalarField*>(NULL)
reinterpret_cast<surfaceScalarField*>(0)
);
stringList surfFieldNames(nSurfFields);

View File

@ -2,13 +2,13 @@
List<IOField<scalar>* > sprayScalarFieldPtrs
(
sprayScalarNames.size(),
reinterpret_cast<IOField<scalar>*>(NULL)
reinterpret_cast<IOField<scalar>*>(0)
);
List<IOField<vector>* > sprayVectorFieldPtrs
(
sprayVectorNames.size(),
reinterpret_cast<IOField<vector>*>(NULL)
reinterpret_cast<IOField<vector>*>(0)
);
{

View File

@ -24,7 +24,7 @@ License
Description
Translates a STAR-CD SMAP data file into FOAM field format.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
@ -108,15 +108,15 @@ int main(int argc, char *argv[])
List<volScalarField*> sFields
(
nCols,
reinterpret_cast<volScalarField*>(NULL)
reinterpret_cast<volScalarField*>(0)
);
List<volVectorField*> vFields
(
nCols,
reinterpret_cast<volVectorField*>(NULL)
reinterpret_cast<volVectorField*>(0)
);
label i=0;
while (i < nCols)
{