diff --git a/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C b/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C index 13a28663c5..31e4a274be 100644 --- a/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C +++ b/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C @@ -2572,7 +2572,7 @@ Foam::label Foam::fileOperations::masterUncollatedFileOperation::addWatch const fileName& fName ) const { - label watchFd; + label watchFd = -1; if (Pstream::master()) // comm_)) { watchFd = monitor().addWatch(fName); @@ -2587,7 +2587,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::removeWatch const label watchIndex ) const { - bool ok; + bool ok = false; if (Pstream::master()) // comm_)) { ok = monitor().removeWatch(watchIndex); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index 9288f7809b..435095bf37 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -998,7 +998,7 @@ bool Foam::processorPolyPatch::order // aspect ratios) we will probably also have problems with // reliable normals calculation labelList faceMap2(faceMap.size(), -1); - matchedAll = matchPoints + matchPoints ( facePointAverages, masterFacePointAverages, @@ -1007,21 +1007,18 @@ bool Foam::processorPolyPatch::order faceMap2 ); - forAll(faceMap, oldFacei) - { - if (faceMap[oldFacei] == -1) - { - faceMap[oldFacei] = faceMap2[oldFacei]; - } - } - matchedAll = true; forAll(faceMap, oldFacei) { if (faceMap[oldFacei] == -1) { - matchedAll = false; + faceMap[oldFacei] = faceMap2[oldFacei]; + + if (faceMap[oldFacei] == -1) + { + matchedAll = false; + } } } } diff --git a/src/OpenFOAM/primitives/direction/directionIO.C b/src/OpenFOAM/primitives/direction/directionIO.C index fa234ccd3f..8e7f92edfb 100644 --- a/src/OpenFOAM/primitives/direction/directionIO.C +++ b/src/OpenFOAM/primitives/direction/directionIO.C @@ -30,7 +30,7 @@ License Foam::direction Foam::readDirection(Istream& is) { - direction val; + direction val(0); is >> val; return val; diff --git a/src/OpenFOAM/primitives/ints/int/intIO.C b/src/OpenFOAM/primitives/ints/int/intIO.C index f9a8e2a58b..12f3f334c4 100644 --- a/src/OpenFOAM/primitives/ints/int/intIO.C +++ b/src/OpenFOAM/primitives/ints/int/intIO.C @@ -76,7 +76,7 @@ bool Foam::readInt(const char* buf, int& val) int Foam::readInt(Istream& is) { - int val; + int val(0); is >> val; return val; diff --git a/src/OpenFOAM/primitives/ints/int32/int32IO.C b/src/OpenFOAM/primitives/ints/int32/int32IO.C index b49a9cb8f8..cf671420da 100644 --- a/src/OpenFOAM/primitives/ints/int32/int32IO.C +++ b/src/OpenFOAM/primitives/ints/int32/int32IO.C @@ -108,7 +108,7 @@ Foam::Istream& Foam::operator>>(Istream& is, int32_t& val) int32_t Foam::readInt32(Istream& is) { - int32_t val; + int32_t val(0); is >> val; return val; diff --git a/src/OpenFOAM/primitives/ints/int64/int64IO.C b/src/OpenFOAM/primitives/ints/int64/int64IO.C index e23b406f51..e70dea6c01 100644 --- a/src/OpenFOAM/primitives/ints/int64/int64IO.C +++ b/src/OpenFOAM/primitives/ints/int64/int64IO.C @@ -108,7 +108,7 @@ Foam::Istream& Foam::operator>>(Istream& is, int64_t& val) int64_t Foam::readInt64(Istream& is) { - int64_t val; + int64_t val(0); is >> val; return val; diff --git a/src/OpenFOAM/primitives/ints/uint/uintIO.C b/src/OpenFOAM/primitives/ints/uint/uintIO.C index eb591db54c..b53531c1cd 100644 --- a/src/OpenFOAM/primitives/ints/uint/uintIO.C +++ b/src/OpenFOAM/primitives/ints/uint/uintIO.C @@ -30,7 +30,7 @@ License unsigned int Foam::readUint(Istream& is) { - unsigned int val; + unsigned int val(0); is >> val; return val; diff --git a/src/OpenFOAM/primitives/ints/uint32/uint32IO.C b/src/OpenFOAM/primitives/ints/uint32/uint32IO.C index a3bc90d5ea..7e02a3d1aa 100644 --- a/src/OpenFOAM/primitives/ints/uint32/uint32IO.C +++ b/src/OpenFOAM/primitives/ints/uint32/uint32IO.C @@ -107,7 +107,7 @@ Foam::Istream& Foam::operator>>(Istream& is, uint32_t& val) uint32_t Foam::readUint32(Istream& is) { - uint32_t val; + uint32_t val(0); is >> val; return val; diff --git a/src/OpenFOAM/primitives/ints/uint64/uint64IO.C b/src/OpenFOAM/primitives/ints/uint64/uint64IO.C index 7eb9c30888..3184260ca5 100644 --- a/src/OpenFOAM/primitives/ints/uint64/uint64IO.C +++ b/src/OpenFOAM/primitives/ints/uint64/uint64IO.C @@ -107,7 +107,7 @@ Foam::Istream& Foam::operator>>(Istream& is, uint64_t& val) uint64_t Foam::readUint64(Istream& is) { - uint64_t val; + uint64_t val(0); is >> val; return val; diff --git a/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutFace/isoCutFace.C b/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutFace/isoCutFace.C index 9bca4c3f63..f685f4a200 100644 --- a/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutFace/isoCutFace.C +++ b/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutFace/isoCutFace.C @@ -128,8 +128,7 @@ Foam::label Foam::isoCutFace::calcSubFace // +1: face is fully above the isosurface label faceStatus; - label pl1 = pLabels[0]; - scalar f1 = f[pl1]; + scalar f1 = f[pLabels[0]]; // If vertex values are very close to isoValue lift them slightly to avoid // dealing with the many special cases of a face being touched either at a @@ -186,7 +185,6 @@ Foam::label Foam::isoCutFace::calcSubFace } } } - pl1 = pl2; f1 = f2; } diff --git a/src/functionObjects/field/nearWallFields/nearWallFields.C b/src/functionObjects/field/nearWallFields/nearWallFields.C index 214bea81de..5d28fbec41 100644 --- a/src/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/functionObjects/field/nearWallFields/nearWallFields.C @@ -111,7 +111,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing() start = startInfo.hitPoint(); //// Uncomment below to shift slightly in: - tetIndices tet(celli, meshFacei, tetPti); + tetIndices tet(celli, tetFacei, tetPti); start = (1.0 - 1e-6)*startInfo.hitPoint() + 1e-6*tet.tet(mesh_).centre(); diff --git a/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C b/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C index 7af0320a15..8a72c7a639 100644 --- a/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C +++ b/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C @@ -76,7 +76,7 @@ Foam::label Foam::blockMeshTools::read const dictionary& dict ) { - label val; + label val(0); read(is, val, dict); return val; } diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C index ba763939b7..9ceedc6187 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C @@ -2050,7 +2050,6 @@ void Foam::snappySnapDriver::avoidDiagonalAttraction scalar distSqr = magSqr(mid-pt); if (distSqr < minDistSqr) { - distSqr = minDistSqr; minFp = fp; } } diff --git a/src/meshTools/output/foamVtkIndPatchWriter.C b/src/meshTools/output/foamVtkIndPatchWriter.C index 1dc96724f7..91b74332ce 100644 --- a/src/meshTools/output/foamVtkIndPatchWriter.C +++ b/src/meshTools/output/foamVtkIndPatchWriter.C @@ -193,7 +193,7 @@ void Foam::vtk::indirectPatchWriter::writePolysLegacy(const label pointOffset) ++iter; } } - off += pp_.nPoints(); + // off += pp_.nPoints(); } } @@ -259,7 +259,7 @@ void Foam::vtk::indirectPatchWriter::writePolys(const label pointOffset) ++iter; } } - off += pp_.nPoints(); + // off += pp_.nPoints(); } } diff --git a/src/meshTools/output/foamVtkSurfaceWriter.C b/src/meshTools/output/foamVtkSurfaceWriter.C index 5face8ad41..f21ca93f7e 100644 --- a/src/meshTools/output/foamVtkSurfaceWriter.C +++ b/src/meshTools/output/foamVtkSurfaceWriter.C @@ -193,7 +193,7 @@ void Foam::vtk::surfaceWriter::writePolysLegacy(const label pointOffset) ++iter; } } - off += points_.size(); + // off += points_.size(); } } @@ -259,7 +259,7 @@ void Foam::vtk::surfaceWriter::writePolys(const label pointOffset) ++iter; } } - off += points_.size(); + // off += points_.size(); } }