diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 946b5dd01..0bee4eb58 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -962,11 +962,12 @@ void Foam::ensightMesh::writeAllFacePrims { if (nPrims) { + const labelList* pPrims = &prims; if (Pstream::master()) { ensightGeometryFile << key << nl << setw(10) << nPrims << nl; - if (&prims != nullptr) + if (pPrims != nullptr) { writeFacePrims ( @@ -993,7 +994,7 @@ void Foam::ensightMesh::writeAllFacePrims } } } - else if (&prims != nullptr) + else if (pPrims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1050,10 +1051,11 @@ void Foam::ensightMesh::writeAllNSided << "nsided" << nl << setw(10) << nPrims << nl; } + const labelList* pPrims = &prims; // Number of points for each face if (Pstream::master()) { - if (&prims != nullptr) + if (pPrims != nullptr) { writeNSidedNPointsPerFace ( @@ -1078,7 +1080,7 @@ void Foam::ensightMesh::writeAllNSided } } } - else if (&prims != nullptr) + else if (pPrims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1087,7 +1089,7 @@ void Foam::ensightMesh::writeAllNSided // List of points id for each face if (Pstream::master()) { - if (&prims != nullptr) + if (pPrims != nullptr) { writeNSidedPoints ( @@ -1114,7 +1116,7 @@ void Foam::ensightMesh::writeAllNSided } } } - else if (&prims != nullptr) + else if (pPrims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1174,10 +1176,11 @@ void Foam::ensightMesh::writeAllNSidedBinary writeEnsDataBinary(nPrims,ensightGeometryFile); } + const labelList* pPrims = &prims; // Number of points for each face if (Pstream::master()) { - if (&prims != nullptr) + if (pPrims != nullptr) { writeNSidedNPointsPerFaceBinary ( @@ -1202,7 +1205,7 @@ void Foam::ensightMesh::writeAllNSidedBinary } } } - else if (&prims != nullptr) + else if (pPrims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1211,7 +1214,7 @@ void Foam::ensightMesh::writeAllNSidedBinary // List of points id for each face if (Pstream::master()) { - if (&prims != nullptr) + if (pPrims != nullptr) { writeNSidedPointsBinary ( @@ -1238,7 +1241,7 @@ void Foam::ensightMesh::writeAllNSidedBinary } } } - else if (&prims != nullptr) + else if (pPrims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1260,12 +1263,13 @@ void Foam::ensightMesh::writeAllFacePrimsBinary { if (nPrims) { + const labelList* pPrims = &prims; if (Pstream::master()) { writeEnsDataBinary(key,ensightGeometryFile); writeEnsDataBinary(nPrims,ensightGeometryFile); - if (&prims != nullptr) + if (pPrims != nullptr) { writeFacePrimsBinary ( @@ -1292,7 +1296,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary } } } - else if (&prims != nullptr) + else if (pPrims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); diff --git a/src/conversion/ensight/part/ensightPartCells.C b/src/conversion/ensight/part/ensightPartCells.C index 7b89c4be5..bf174ef54 100644 --- a/src/conversion/ensight/part/ensightPartCells.C +++ b/src/conversion/ensight/part/ensightPartCells.C @@ -65,7 +65,8 @@ void Foam::ensightPartCells::classify(const labelList& idList) size_ = mesh.nCells(); bool limited = false; - if (&idList) + const labelList* pIdList = &idList; + if (pIdList) { limited = true; size_ = idList.size(); diff --git a/src/foam/db/typeInfo/typeInfo.H b/src/foam/db/typeInfo/typeInfo.H index 2c8e96335..e9fc4d352 100644 --- a/src/foam/db/typeInfo/typeInfo.H +++ b/src/foam/db/typeInfo/typeInfo.H @@ -133,7 +133,8 @@ inline bool isType(const Type& t) template inline bool isA(const Type& t) { - return dynamic_cast(&t); + const Type* p = &t; + return dynamic_cast(p); } diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C index bb19b3d92..8762012c9 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C @@ -154,7 +154,8 @@ void Foam::sampledPatch::remapFaces ) { // recalculate the cells cut - if (&faceMap && faceMap.size()) + const UList