From 1a0095489b83a8941777ad9cfa0cca7a78678ef8 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Wed, 6 Apr 2011 22:55:47 +0100
Subject: [PATCH] gcc-4.6.0 warnings: removed initialised but unused variables

---
 .../utilities/mesh/conversion/sammToFoam/readPoints.C |  2 +-
 .../mesh/conversion/star3ToFoam/readPoints.C          |  9 ++++-----
 .../miscellaneous/foamDebugSwitches/Make/options      |  1 -
 .../PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C   | 10 +---------
 src/OpenFOAM/include/checkTimeOptions.H               |  8 ++++----
 .../meshes/primitiveMesh/primitiveMeshClear.C         |  3 ++-
 src/engine/ignition/ignitionSite.C                    |  4 +---
 .../basic/InteractionLists/InteractionLists.C         |  2 --
 src/lagrangian/dieselSpray/parcel/parcel.C            |  2 --
 .../spraySubModels/atomizationModel/LISA/LISA.C       |  3 +--
 .../dieselSpray/spraySubModels/breakupModel/SHF/SHF.C |  3 ---
 .../injectorModel/blobsSwirl/blobsSwirlInjector.C     |  9 +--------
 src/mesh/blockMesh/blockMesh/blockMeshMerge.C         | 11 +----------
 .../triSurface/triSurfaceTools/geompack/geompack.C    |  3 +--
 .../linearAxialAngularSpring.C                        | 11 +++--------
 .../tabulatedAxialAngularSpring.C                     |  8 +++-----
 16 files changed, 23 insertions(+), 66 deletions(-)

diff --git a/applications/utilities/mesh/conversion/sammToFoam/readPoints.C b/applications/utilities/mesh/conversion/sammToFoam/readPoints.C
index c6b793ff821..00c0a3cc370 100644
--- a/applications/utilities/mesh/conversion/sammToFoam/readPoints.C
+++ b/applications/utilities/mesh/conversion/sammToFoam/readPoints.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/applications/utilities/mesh/conversion/star3ToFoam/readPoints.C b/applications/utilities/mesh/conversion/star3ToFoam/readPoints.C
index 5c364266f65..bc931fd5c7f 100644
--- a/applications/utilities/mesh/conversion/star3ToFoam/readPoints.C
+++ b/applications/utilities/mesh/conversion/star3ToFoam/readPoints.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -86,7 +86,6 @@ void starMesh::readPoints(const scalar scaleFactor)
         if (pointsFile.good())
         {
             label pointLabel;
-            scalar x, y, z;
 
             maxLabel = -1;
             while (pointsFile)
@@ -97,9 +96,9 @@ void starMesh::readPoints(const scalar scaleFactor)
 
                 maxLabel = max(maxLabel, pointLabel);
 
-                x = readVtxCmpt(pointsFile);
-                y = readVtxCmpt(pointsFile);
-                z = readVtxCmpt(pointsFile);
+                readVtxCmpt(pointsFile);
+                readVtxCmpt(pointsFile);
+                readVtxCmpt(pointsFile);
 
                 readToNl(pointsFile);
 
diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
index abee4af7ebc..988d2a4edb7 100644
--- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
+++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
@@ -33,7 +33,6 @@ EXE_LIBS = \
     -linterfaceProperties \
     -lIOFunctionObjects \
     -ljobControl \
-    -lkineticTheoryModel \
     -llagrangian \
     -llagrangianIntermediate \
     -llaminarFlameSpeedModels \
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
index 099e8d4f37d..77b53c5815e 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -383,16 +383,12 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
 
                 forAll(quadFcs, quadI)
                 {
-                    label thisCellI;
-
                     if (substituteCell)
                     {
-                        thisCellI = cellI;
                         substituteCell = false;
                     }
                     else
                     {
-                        thisCellI = mesh.nCells() + addCellI;
                         superCells[addCellI++] = cellI;
                     }
 
@@ -430,16 +426,12 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
 
                 forAll(triFcs, triI)
                 {
-                    label thisCellI;
-
                     if (substituteCell)
                     {
-                        thisCellI = cellI;
                         substituteCell = false;
                     }
                     else
                     {
-                        thisCellI = mesh.nCells() + addCellI;
                         superCells[addCellI++] = cellI;
                     }
 
diff --git a/src/OpenFOAM/include/checkTimeOptions.H b/src/OpenFOAM/include/checkTimeOptions.H
index f5e72483224..a52fc1d05ba 100644
--- a/src/OpenFOAM/include/checkTimeOptions.H
+++ b/src/OpenFOAM/include/checkTimeOptions.H
@@ -2,11 +2,11 @@
 // checkTimeOptions.H
 // ~~~~~~~~~~~~~~~~~~
 
-    Foam::label startTime = 0;
-    Foam::label endTime = Times.size();
+Foam::label startTime = 0;
+Foam::label endTime = Times.size();
 
 // unless -constant is present, skip startTime if it is "constant"
-#   include "checkConstantOption.H"
+#include "checkConstantOption.H"
 
 // check -time and -latestTime options
-#   include "checkTimeOption.H"
+#include "checkTimeOption.H"
diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C
index cc232c162f7..13c94fcfae5 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C
+++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C
@@ -24,9 +24,10 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "primitiveMesh.H"
+#include "indexedOctree.H"
+#include "treeDataCell.H"
 #include "demandDrivenData.H"
 
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 void Foam::primitiveMesh::printAllocated() const
diff --git a/src/engine/ignition/ignitionSite.C b/src/engine/ignition/ignitionSite.C
index b83580bd92e..866dfb5ae8b 100644
--- a/src/engine/ignition/ignitionSite.C
+++ b/src/engine/ignition/ignitionSite.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -51,7 +51,6 @@ void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh)
     cellVolumes_[0] = vols[ignCell];
 
     scalar minDist = GREAT;
-    label nearestCell = 0;
     label nIgnCells = 1;
 
     forAll(centres, celli)
@@ -60,7 +59,6 @@ void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh)
 
         if (dist < minDist)
         {
-            nearestCell = celli;
             minDist = dist;
         }
 
diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C
index 3a138449b5f..552ae6fb700 100644
--- a/src/lagrangian/basic/InteractionLists/InteractionLists.C
+++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C
@@ -654,8 +654,6 @@ void Foam::InteractionLists<ParticleType>::findExtendedProcBbsInRange
     {
         List<label> permutationIndices(nTrans, 0);
 
-        vector s = vector::zero;
-
         if (nTrans == 0 && procI != Pstream::myProcNo())
         {
             treeBoundBox extendedReferredProcBb = allExtendedProcBbs[procI];
diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C
index deb25f37e48..dd2aa354d2d 100644
--- a/src/lagrangian/dieselSpray/parcel/parcel.C
+++ b/src/lagrangian/dieselSpray/parcel/parcel.C
@@ -440,7 +440,6 @@ void Foam::parcel::updateParcelProperties
     scalar oldhv = fuels.hl(pg, T(), X());
     scalar Np = N(oldDensity);
 
-    scalar newDensity = oldDensity;
     scalar newMass    = oldMass;
     scalar newhg      = oldhg;
     scalar newhv      = oldhv;
@@ -460,7 +459,6 @@ void Foam::parcel::updateParcelProperties
         // first time
         if (n > 1)
         {
-            newDensity = fuels.rho(pg, Tnew, X());
             newMass = m();
             newhg = 0.0;
             scalarField Ynew(fuels.Y(X()));
diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C
index b0bf8b74ebf..bbce1c49d29 100644
--- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C
+++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C
@@ -112,11 +112,10 @@ void Foam::LISA::atomizeParcel
     vector uDir = p.U()/mag(p.U());
 
     scalar uGas = mag(vel & uDir);
-    vector Ug = uGas*uDir;
 
     // Might be the relative velocity between Liquid and Gas, but using the
     // absolute velocity of the parcel as suggested by the authors
-//    scalar U = mag(p.Urel(vel));
+    // scalar U = mag(p.Urel(vel));
     scalar U = mag(p.U());
 
     p.ct() += deltaT;
diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C
index a4ff12b6bbb..6a378fff5d7 100644
--- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C
+++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C
@@ -118,9 +118,6 @@ void Foam::SHF::breakupParcel
     scalar reLiquid   = p.Re(rhoLiquid, vel, muLiquid);
     scalar ohnesorge  = sqrt(weLiquid)/(reLiquid + VSMALL);
 
-    vector acceleration = p.Urel(vel)/p.tMom();
-    vector trajectory = p.U()/mag(p.U());
-
     vector vRel = p.Urel(vel);
 
     scalar weGasCorr = weGas/(1.0 + weCorrCoeff_*ohnesorge);
diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C
index 3cb6f881f4e..afbdc6de894 100644
--- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C
+++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -246,9 +246,6 @@ void Foam::blobsSwirlInjector::calculateHX
             )
         );
 
-    scalar hOLD = -100.0;
-    scalar xOLD = -100.0;
-
     label i;
 
     for (i=0; i<20; i++)
@@ -267,10 +264,6 @@ void Foam::blobsSwirlInjector::calculateHX
             );
 
         x_ = sqr(1.0 - 2.0*h_/injectorDiameter);
-
-        hOLD = h_;
-        xOLD = x_;
-
     }
 
     x_ = sqr(1.0 - 2.0*h_/injectorDiameter);
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
index 2c63b4f7f5b..a8cd42eced0 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -225,8 +225,6 @@ void Foam::blockMesh::calcMergeInfo()
         }
 
 
-        bool found = false;
-
         // N-squared point search over all points of all faces of
         // master block over all point of all faces of slave block
         forAll(blockPfaceFaces, blockPfaceFaceLabel)
@@ -240,8 +238,6 @@ void Foam::blockMesh::calcMergeInfo()
 
             forAll(blockPfaceFacePoints, blockPfaceFacePointLabel)
             {
-                found = false;
-
                 forAll(blockNfaceFaces, blockNfaceFaceLabel)
                 {
                     const labelList& blockNfaceFacePoints
@@ -261,7 +257,6 @@ void Foam::blockMesh::calcMergeInfo()
                         )
                         {
                             // Found a new pair
-                            found = true;
 
                             cp[blockPfaceFacePointLabel] =
                                 blockNfaceFacePoints[blockNfaceFacePointLabel];
@@ -332,7 +327,6 @@ void Foam::blockMesh::calcMergeInfo()
 
             const labelListList& curPairs = glueMergePairs[blockFaceLabel];
 
-            bool foundFace = false;
             label blockPfaceLabel;
             for
             (
@@ -347,14 +341,12 @@ void Foam::blockMesh::calcMergeInfo()
                  == blockInternalFaces[blockFaceLabel]
                 )
                 {
-                    foundFace = true;
                     break;
                 }
             }
 
 // FIXME? - there seems to be some logic missing here
 
-            foundFace = false;
             label blockNfaceLabel;
             for
             (
@@ -369,7 +361,6 @@ void Foam::blockMesh::calcMergeInfo()
                  == blockInternalFaces[blockFaceLabel]
                 )
                 {
-                    foundFace = true;
                     break;
                 }
             }
diff --git a/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C b/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C
index d34c4c9e661..1bcc5fd7b3f 100644
--- a/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C
+++ b/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C
@@ -2958,7 +2958,6 @@ char *timestring ( void )
 # define TIME_SIZE 29
 
   const struct tm *tm;
-  size_t len;
   time_t now;
   char *s;
 
@@ -2967,7 +2966,7 @@ char *timestring ( void )
 
   s = new char[TIME_SIZE];
 
-  len = strftime ( s, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm );
+  strftime ( s, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm );
 
   return s;
 # undef TIME_SIZE
diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C
index b3ef7962260..0322954df0d 100644
--- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C
+++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -83,20 +83,15 @@ Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain
 ) const
 {
     vector refDir = rotationTensor(vector(1, 0 ,0), axis_) & vector(0, 1, 0);
-
     vector oldDir = refQ_ & refDir;
-
     vector newDir = motion.orientation() & refDir;
 
     if (mag(oldDir & axis_) > 0.95 || mag(newDir & axis_) > 0.95)
     {
         // Directions getting close to the axis, change reference
-
         refDir = rotationTensor(vector(1, 0 ,0), axis_) & vector(0, 0, 1);
-
-        vector oldDir = refQ_ & refDir;
-
-        vector newDir = motion.orientation() & refDir;
+        oldDir = refQ_ & refDir;
+        newDir = motion.orientation() & refDir;
     }
 
     // Removing any axis component from oldDir and newDir and normalising
diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
index a94a8853603..00a08fc7f25 100644
--- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
+++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -87,7 +87,6 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
     vector refDir = rotationTensor(vector(1, 0 ,0), axis_) & vector(0, 1, 0);
 
     vector oldDir = refQ_ & refDir;
-
     vector newDir = motion.orientation() & refDir;
 
     if (mag(oldDir & axis_) > 0.95 || mag(newDir & axis_) > 0.95)
@@ -96,9 +95,8 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
 
         refDir = rotationTensor(vector(1, 0 ,0), axis_) & vector(0, 0, 1);
 
-        vector oldDir = refQ_ & refDir;
-
-        vector newDir = motion.orientation() & refDir;
+        oldDir = refQ_ & refDir;
+        newDir = motion.orientation() & refDir;
     }
 
     // Removing any axis component from oldDir and newDir and normalising
-- 
GitLab