Minimum changes to compile everything with gcc-4.3.0

This commit is contained in:
henry
2008-05-26 19:27:23 +01:00
parent f6107f4033
commit 0f687ccd76
22 changed files with 158 additions and 135 deletions

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
<< "reactions" << cr.reactions() << ';' << endl; << "reactions" << cr.reactions() << ';' << endl;
OFstream thermoFile(FOAMThermodynamicsFileName); OFstream thermoFile(FOAMThermodynamicsFileName);
thermoFile<< cr.specieThermo() << endl; thermoFile<< cr.speciesThermo() << endl;
Info << "End\n" << endl; Info << "End\n" << endl;

View File

@ -86,7 +86,14 @@ set WM_COMPILER_INST=OpenFOAM
switch ("$WM_COMPILER_INST") switch ("$WM_COMPILER_INST")
case OpenFOAM: case OpenFOAM:
setenv WM_COMPILER_DIR $FOAM_INST_DIR/$WM_ARCH/gcc-4.2.2$WM_COMPILER_ARCH switch ("$WM_COMPILER")
case Gcc43:
setenv WM_COMPILER_DIR $FOAM_INST_DIR/$WM_ARCH/gcc-4.3.0$WM_COMPILER_ARCH
breaksw
case Gcc:
setenv WM_COMPILER_DIR $FOAM_INST_DIR/$WM_ARCH/gcc-4.2.2$WM_COMPILER_ARCH
breaksw
endsw
# Check that the compiler directory can be found # Check that the compiler directory can be found
if ( ! -d "$WM_COMPILER_DIR" ) then if ( ! -d "$WM_COMPILER_DIR" ) then

View File

@ -318,7 +318,8 @@ bool HashTable<T, Key, Hash>::erase(const iterator& cit)
delete it.elmtPtr_; delete it.elmtPtr_;
// Search back for previous non-zero table entry // Search back for previous non-zero table entry
while (--it.hashIndex_ >= 0 && !table_[it.hashIndex_]); while (--it.hashIndex_ >= 0 && !table_[it.hashIndex_])
{}
if (it.hashIndex_ >= 0) if (it.hashIndex_ >= 0)
{ {

View File

@ -220,7 +220,8 @@ HashTable<T, Key, Hash>::iterator::operator++()
( (
++hashIndex_ < curHashTable_.tableSize_ ++hashIndex_ < curHashTable_.tableSize_
&& !(elmtPtr_ = curHashTable_.table_[hashIndex_]) && !(elmtPtr_ = curHashTable_.table_[hashIndex_])
); )
{}
if (hashIndex_ == curHashTable_.tableSize_) if (hashIndex_ == curHashTable_.tableSize_)
{ {
@ -259,7 +260,8 @@ HashTable<T, Key, Hash>::begin()
{ {
label i = 0; label i = 0;
while (table_ && !table_[i] && ++i < tableSize_); while (table_ && !table_[i] && ++i < tableSize_)
{}
if (i == tableSize_) if (i == tableSize_)
{ {
@ -396,7 +398,8 @@ HashTable<T, Key, Hash>::const_iterator::operator++()
( (
++hashIndex_ < curHashTable_.tableSize_ ++hashIndex_ < curHashTable_.tableSize_
&& !(elmtPtr_ = curHashTable_.table_[hashIndex_]) && !(elmtPtr_ = curHashTable_.table_[hashIndex_])
); )
{}
} }
return *this; return *this;
@ -430,7 +433,8 @@ HashTable<T, Key, Hash>::begin() const
{ {
label i = 0; label i = 0;
while (table_ && !table_[i] && ++i < tableSize_); while (table_ && !table_[i] && ++i < tableSize_)
{}
if (i == tableSize_) if (i == tableSize_)
{ {

View File

@ -34,6 +34,7 @@ License
#include "JobInfo.H" #include "JobInfo.H"
#include "labelList.H" #include "labelList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
@ -389,7 +390,8 @@ Foam::argList::argList
rootPath_/globalCase_/"processor" rootPath_/globalCase_/"processor"
+ name(++nProcDirs) + name(++nProcDirs)
) )
); )
{}
if (nProcDirs != Pstream::nProcs()) if (nProcDirs != Pstream::nProcs())
{ {

View File

@ -29,6 +29,7 @@ Description
#include <new> #include <new>
#include <iostream> #include <iostream>
#include <cstdlib>
namespace Foam namespace Foam
{ {

View File

@ -64,7 +64,8 @@ Type interpolateXY
label n = xOld.size(); label n = xOld.size();
label lo = 0; label lo = 0;
for (lo=0; lo<n && xOld[lo]>x; ++lo); for (lo=0; lo<n && xOld[lo]>x; ++lo)
{}
label low = lo; label low = lo;
if (low < n) if (low < n)
@ -79,7 +80,8 @@ Type interpolateXY
} }
label hi = 0; label hi = 0;
for (hi=0; hi<n && xOld[hi]<x; ++hi); for (hi=0; hi<n && xOld[hi]<x; ++hi)
{}
label high = hi; label high = hi;
if (high < n) if (high < n)

View File

@ -397,7 +397,7 @@ inline pointHit triangle<Point, PointRef>::ray
bool eligible = bool eligible =
alg == intersection::FULL_RAY alg == intersection::FULL_RAY
|| alg == intersection::HALF_RAY && dist > -planarPointTol || (alg == intersection::HALF_RAY && dist > -planarPointTol)
|| ( || (
alg == intersection::VISIBLE alg == intersection::VISIBLE
&& ((q1 & normal()) < -VSMALL) && ((q1 & normal()) < -VSMALL)

View File

@ -73,7 +73,8 @@ long long readLongLong(Istream& is)
static const label zeroOffset = int('0'); static const label zeroOffset = int('0');
// Get next non-whitespace character // Get next non-whitespace character
while (is.read(c) && isspace(c)); while (is.read(c) && isspace(c))
{}
do do
{ {

View File

@ -49,6 +49,8 @@ SourceFiles
#include "char.H" #include "char.H"
#include <string> #include <string>
#include <cstring>
#include <cstdlib>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -180,7 +180,7 @@ public:
return meshInfo_; return meshInfo_;
} }
const label size() const label size() const
{ {
return IDLList<ParticleType>::size(); return IDLList<ParticleType>::size();
}; };

View File

@ -1055,7 +1055,7 @@ pointIndexHit indexedOctree<Type>::findLine
direction startBit = treeBb.posBits(start); direction startBit = treeBb.posBits(start);
direction endBit = treeBb.posBits(end); direction endBit = treeBb.posBits(end);
if (startBit&endBit != 0) if ((startBit & endBit) != 0)
{ {
// Both start and end outside domain and in same block. // Both start and end outside domain and in same block.
return pointIndexHit(false, vector::zero, -1); return pointIndexHit(false, vector::zero, -1);

View File

@ -4,6 +4,7 @@
# include <fstream> # include <fstream>
# include <cmath> # include <cmath>
# include <ctime> # include <ctime>
# include <cstring>
using namespace std; using namespace std;

View File

@ -118,7 +118,7 @@ public:
// Member Functions // Member Functions
virtual const speciesTable& species() const = 0; virtual const speciesTable& species() const = 0;
virtual const HashPtrTable<reactionThermo>& specieThermo() const = 0; virtual const HashPtrTable<reactionThermo>& speciesThermo() const = 0;
virtual const SLPtrList<reaction>& reactions() const = 0; virtual const SLPtrList<reaction>& reactions() const = 0;
}; };

View File

@ -607,15 +607,15 @@ bool finishReaction = false;
HashPtrTable<reactionThermo>::iterator specieThermoIter HashPtrTable<reactionThermo>::iterator specieThermoIter
( (
specieThermo_.find(currentSpecieName) speciesThermo_.find(currentSpecieName)
); );
if (specieThermoIter != specieThermo_.end()) if (specieThermoIter != speciesThermo_.end())
{ {
specieThermo_.erase(specieThermoIter); speciesThermo_.erase(specieThermoIter);
} }
specieThermo_.insert speciesThermo_.insert
( (
currentSpecieName, currentSpecieName,
new reactionThermo new reactionThermo

View File

@ -182,7 +182,7 @@ void Foam::chemkinReader::addReactionType
speciesTable_, speciesTable_,
lhs.shrink(), lhs.shrink(),
rhs.shrink(), rhs.shrink(),
specieThermo_ speciesThermo_
), ),
rr rr
) )
@ -201,7 +201,7 @@ void Foam::chemkinReader::addReactionType
speciesTable_, speciesTable_,
lhs.shrink(), lhs.shrink(),
rhs.shrink(), rhs.shrink(),
specieThermo_ speciesThermo_
), ),
rr rr
) )
@ -500,7 +500,7 @@ void Foam::chemkinReader::addReaction
speciesTable_, speciesTable_,
lhs.shrink(), lhs.shrink(),
rhs.shrink(), rhs.shrink(),
specieThermo_ speciesThermo_
), ),
ArrheniusReactionRate ArrheniusReactionRate
( (
@ -553,7 +553,7 @@ void Foam::chemkinReader::addReaction
speciesTable_, speciesTable_,
lhs.shrink(), lhs.shrink(),
rhs.shrink(), rhs.shrink(),
specieThermo_ speciesThermo_
), ),
thirdBodyArrheniusReactionRate thirdBodyArrheniusReactionRate
( (
@ -658,7 +658,7 @@ void Foam::chemkinReader::addReaction
speciesTable_, speciesTable_,
lhs.shrink(), lhs.shrink(),
rhs.shrink(), rhs.shrink(),
specieThermo_ speciesThermo_
), ),
LandauTellerReactionRate LandauTellerReactionRate
( (
@ -814,7 +814,8 @@ void Foam::chemkinReader::read
yy_buffer_state* bufferPtr(yy_create_buffer(&thermoStream, yyBufSize)); yy_buffer_state* bufferPtr(yy_create_buffer(&thermoStream, yyBufSize));
yy_switch_to_buffer(bufferPtr); yy_switch_to_buffer(bufferPtr);
while(lex() != 0); while(lex() != 0)
{}
yy_delete_buffer(bufferPtr); yy_delete_buffer(bufferPtr);
@ -838,7 +839,8 @@ void Foam::chemkinReader::read
initReactionKeywordTable(); initReactionKeywordTable();
while(lex() != 0); while(lex() != 0)
{}
yy_delete_buffer(bufferPtr); yy_delete_buffer(bufferPtr);
} }

View File

@ -198,7 +198,7 @@ private:
HashTable<phase> speciePhase_; HashTable<phase> speciePhase_;
//- Table of the thermodynamic data given in the CHEMKIN file //- Table of the thermodynamic data given in the CHEMKIN file
HashPtrTable<reactionThermo> specieThermo_; HashPtrTable<reactionThermo> speciesThermo_;
//- Table of species composition //- Table of species composition
HashTable<List<specieElement> > specieComposition_; HashTable<List<specieElement> > specieComposition_;
@ -363,9 +363,9 @@ public:
} }
//- Table of the thermodynamic data given in the CHEMKIN file //- Table of the thermodynamic data given in the CHEMKIN file
const HashPtrTable<reactionThermo>& specieThermo() const const HashPtrTable<reactionThermo>& speciesThermo() const
{ {
return specieThermo_; return speciesThermo_;
} }
//- Table of species composition //- Table of species composition

View File

@ -45,12 +45,12 @@ Foam::foamChemistryReader::foamChemistryReader
const fileName& thermoFileName const fileName& thermoFileName
) )
: :
specieThermo_(IFstream(thermoFileName)()), speciesThermo_(IFstream(thermoFileName)()),
speciesTable_(dictionary(IFstream(reactionsFileName)()).lookup("species")), speciesTable_(dictionary(IFstream(reactionsFileName)()).lookup("species")),
reactions_ reactions_
( (
dictionary(IFstream(reactionsFileName)()).lookup("reactions"), dictionary(IFstream(reactionsFileName)()).lookup("reactions"),
reaction::iNew(speciesTable_, specieThermo_) reaction::iNew(speciesTable_, speciesThermo_)
) )
{} {}
@ -58,7 +58,7 @@ Foam::foamChemistryReader::foamChemistryReader
// Construct from components // Construct from components
Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict)
: :
specieThermo_ speciesThermo_
( (
IFstream IFstream
( (
@ -84,7 +84,7 @@ Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict)
fileName(thermoDict.lookup("foamChemistryFile")).expand() fileName(thermoDict.lookup("foamChemistryFile")).expand()
)() )()
).lookup("reactions"), ).lookup("reactions"),
reaction::iNew(speciesTable_, specieThermo_) reaction::iNew(speciesTable_, speciesThermo_)
) )
{} {}

View File

@ -60,7 +60,7 @@ class foamChemistryReader
public chemistryReader public chemistryReader
{ {
//- Table of the thermodynamic data given in the foamChemistry file //- Table of the thermodynamic data given in the foamChemistry file
HashPtrTable<reactionThermo> specieThermo_; HashPtrTable<reactionThermo> speciesThermo_;
//- Table of species //- Table of species
speciesTable speciesTable_; speciesTable speciesTable_;
@ -113,9 +113,9 @@ public:
} }
//- Table of the thermodynamic data given in the foamChemistry file //- Table of the thermodynamic data given in the foamChemistry file
const HashPtrTable<reactionThermo>& specieThermo() const const HashPtrTable<reactionThermo>& speciesThermo() const
{ {
return specieThermo_; return speciesThermo_;
} }
//- List of the reactions //- List of the reactions

View File

@ -45,7 +45,7 @@ reactingMixture::reactingMixture
( (
thermoDict, thermoDict,
autoPtr<chemistryReader>::operator()().species(), autoPtr<chemistryReader>::operator()().species(),
autoPtr<chemistryReader>::operator()().specieThermo(), autoPtr<chemistryReader>::operator()().speciesThermo(),
mesh mesh
), ),
PtrList<chemistryReader::reaction> PtrList<chemistryReader::reaction>