From 69526c6c1c1aca47f5d8d40644afae2b0716a9a4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 19 Aug 2010 15:44:17 +0100 Subject: [PATCH] BUG: various reinterpret_cast to enable strict-aliasing --- .../surface/surfaceInertia/surfaceInertia.C | 11 +++-- src/OpenFOAM/fields/Fields/Field/Field.C | 20 ++++---- src/OpenFOAM/fields/Fields/Field/Field.H | 20 ++++---- src/OpenFOAM/primitives/Tensor/Tensor.H | 23 ++++++---- src/OpenFOAM/primitives/Tensor/TensorI.H | 46 +++++++++---------- .../primitives/Tensor/tensor/tensor.C | 20 ++++---- src/OpenFOAM/primitives/Tensor2D/Tensor2D.H | 20 +++++--- src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H | 41 ++++++++--------- .../primitives/Tensor2D/tensor2D/tensor2D.C | 8 ++-- .../cfdTools/general/porousMedia/porousZone.H | 2 +- .../constraint/wedge/wedgeFvPatchField.C | 6 ++- .../cellLimitedGrad/cellLimitedGrads.C | 9 ++-- .../coordinateRotation/coordinateRotation.C | 14 ++---- .../coordinateRotation/coordinateRotation.H | 6 +-- .../coordinateSystems/coordinateSystem.H | 10 ++-- .../kinematicSingleLayer.C | 4 +- .../surfaceFilmModel/noFilm/noFilm.C | 12 ++--- wmake/rules/SiCortex64Gcc/c++ | 2 +- wmake/rules/SunOS64Gcc/c++ | 2 +- wmake/rules/linux64Gcc/c++ | 2 +- wmake/rules/linux64Gcc43/c++ | 2 +- wmake/rules/linux64Gcc44/c++ | 2 +- wmake/rules/linux64Gcc45/c++ | 2 +- wmake/rules/linuxGcc/c++ | 2 +- wmake/rules/linuxGcc43/c++ | 2 +- wmake/rules/linuxGcc44/c++ | 2 +- wmake/rules/linuxGcc45/c++ | 2 +- wmake/rules/linuxIA64Gcc/c++ | 2 +- wmake/rules/linuxPPC64Gcc/c++ | 2 +- wmake/rules/linuxmingw32/c++ | 2 +- wmake/rules/solarisGcc/c++ | 2 +- 31 files changed, 159 insertions(+), 141 deletions(-) diff --git a/applications/utilities/surface/surfaceInertia/surfaceInertia.C b/applications/utilities/surface/surfaceInertia/surfaceInertia.C index 380f7fb931..5c39ebd503 100644 --- a/applications/utilities/surface/surfaceInertia/surfaceInertia.C +++ b/applications/utilities/surface/surfaceInertia/surfaceInertia.C @@ -398,7 +398,12 @@ int main(int argc, char *argv[]) ) { // Make the eigenvectors a right handed orthogonal triplet - eVec.z() *= sign((eVec.x() ^ eVec.y()) & eVec.z()); + eVec = tensor + ( + eVec.x(), + eVec.y(), + eVec.z() * sign((eVec.x() ^ eVec.y()) & eVec.z()) + ); // Finding the most natural transformation. Using Lists // rather than tensors to allow indexed permutation. @@ -557,9 +562,7 @@ int main(int argc, char *argv[]) eVal = tEVal; } - eVec.x() = principal[0]; - eVec.y() = principal[1]; - eVec.z() = principal[2]; + eVec = tensor(principal[0], principal[1], principal[2]); // { // tensor R = rotationTensor(vector(1, 0, 0), eVec.x()); diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 531ae0443a..e5c5a7cced 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -66,7 +66,7 @@ template Field::Field ( const UList& mapF, - const labelList& mapAddressing + const UList