- Fixed build failures with gcc 4.3 pre-release

(http://bugs.debian.org/413432)


git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@823 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
lfittl 2007-05-08 10:48:40 +00:00
parent 2fdafe3884
commit 214635bfc1
13 changed files with 41 additions and 39 deletions

View file

@ -491,7 +491,7 @@ namespace Loki
protected:
virtual ~EvictRandom(){};
virtual ~EvictRandom(){}
void onCreate(const DT&){
}
@ -662,7 +662,7 @@ namespace Loki
public CreationPolicy, public StatisticPolicy, EvictionPolicy< AbstractProduct * , unsigned >
{
private:
typedef Factory< AbstractProduct, IdentifierType, CreatorParmTList, FactoryErrorPolicy> Factory;
typedef Factory< AbstractProduct, IdentifierType, CreatorParmTList, FactoryErrorPolicy> MyFactory;
typedef FactoryImpl< AbstractProduct, IdentifierType, CreatorParmTList > Impl;
typedef Functor< AbstractProduct* , CreatorParmTList > ProductCreator;
typedef EncapsulationPolicy<AbstractProduct> NP;
@ -689,16 +689,16 @@ namespace Loki
public:
typedef typename NP::ProductReturn ProductReturn;
private:
typedef Key< Impl, IdentifierType > Key;
typedef std::map< Key, ObjVector > KeyToObjVectorMap;
typedef std::map< AbstractProduct*, Key > FetchedObjToKeyMap;
typedef Key< Impl, IdentifierType > MyKey;
typedef std::map< MyKey, ObjVector > KeyToObjVectorMap;
typedef std::map< AbstractProduct*, MyKey > FetchedObjToKeyMap;
Factory factory;
MyFactory factory;
KeyToObjVectorMap fromKeyToObjVector;
FetchedObjToKeyMap providedObjects;
unsigned outObjects;
ObjVector& getContainerFromKey(Key key){
ObjVector& getContainerFromKey(MyKey key){
return fromKeyToObjVector[key];
}
@ -864,7 +864,7 @@ namespace Loki
ProductReturn CreateObject(const IdentifierType& id)
{
Key key(id);
MyKey key(id);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -879,7 +879,7 @@ namespace Loki
ProductReturn CreateObject(const IdentifierType& id,
Parm1 p1)
{
Key key(id,p1);
MyKey key(id,p1);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -894,7 +894,7 @@ namespace Loki
ProductReturn CreateObject(const IdentifierType& id,
Parm1 p1, Parm2 p2)
{
Key key(id,p1,p2);
MyKey key(id,p1,p2);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -909,7 +909,7 @@ namespace Loki
ProductReturn CreateObject(const IdentifierType& id,
Parm1 p1, Parm2 p2, Parm3 p3)
{
Key key(id,p1,p2,p3);
MyKey key(id,p1,p2,p3);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -924,7 +924,7 @@ namespace Loki
ProductReturn CreateObject(const IdentifierType& id,
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4)
{
Key key(id,p1,p2,p3,p4);
MyKey key(id,p1,p2,p3,p4);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -940,7 +940,7 @@ namespace Loki
ProductReturn CreateObject(const IdentifierType& id,
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5)
{
Key key(id,p1,p2,p3,p4,p5);
MyKey key(id,p1,p2,p3,p4,p5);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -957,7 +957,7 @@ namespace Loki
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
Parm6 p6)
{
Key key(id,p1,p2,p3,p4,p5,p6);
MyKey key(id,p1,p2,p3,p4,p5,p6);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -974,7 +974,7 @@ namespace Loki
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
Parm6 p6, Parm7 p7 )
{
Key key(id,p1,p2,p3,p4,p5,p6,p7);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -991,7 +991,7 @@ namespace Loki
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
Parm6 p6, Parm7 p7, Parm8 p8)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1008,7 +1008,7 @@ namespace Loki
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1025,7 +1025,7 @@ namespace Loki
Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5,
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9,Parm10 p10)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1043,7 +1043,7 @@ namespace Loki
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10,
Parm11 p11)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1061,7 +1061,7 @@ namespace Loki
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10,
Parm11 p11, Parm12 p12)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1079,7 +1079,7 @@ namespace Loki
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10,
Parm11 p11, Parm12 p12, Parm13 p13)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1098,7 +1098,7 @@ namespace Loki
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10,
Parm11 p11, Parm12 p12, Parm13 p13, Parm14 p14)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{
@ -1117,7 +1117,7 @@ namespace Loki
Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10,
Parm11 p11, Parm12 p12, Parm13 p13, Parm14 p14, Parm15 p15)
{
Key key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15);
MyKey key(id,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15);
AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key)));
if(shouldCreateObject(pProduct))
{

View file

@ -171,7 +171,7 @@ namespace Loki
protected:
typedef CallBackSP ProductReturn;
SmartPointer() : fun(this, &SmartPointer::smartPointerCallbackFunction) {}
virtual ~SmartPointer(){};
virtual ~SmartPointer(){}
ProductReturn encapsulate(AbstractProduct* pProduct)
{

View file

@ -22,6 +22,7 @@
////////////////////////////////////////////////////////////////////////////////
#include <cstdio>
#include <climits>
#include <string>
#include <stdexcept>
#include <utility>

View file

@ -188,6 +188,9 @@ namespace Loki
protected:
// Destroys the data stored
// (Destruction might be taken over by the OwnershipPolicy)
//
// If your compiler gives you a warning in this area while
// compiling the tests, it is on purpose, please ignore it.
void Destroy()
{
delete pointee_;

View file

@ -19,6 +19,7 @@
#include <loki/SmallObj.h>
#include <cassert>
#include <climits>
#include <vector>
#include <bitset>

View file

@ -72,7 +72,7 @@ using namespace Loki;
class AbstractProduct{
public:
virtual ~AbstractProduct(){};
virtual ~AbstractProduct(){}
};
class Product : public AbstractProduct

View file

@ -40,7 +40,7 @@ public:
LogClass()
{
print("LogClass::LogClass()");
};
}
~LogClass()
{
print("LogClass::~LogClass()");

View file

@ -119,7 +119,7 @@ public:
class Creator : public AbstractCreator{
public:
Creator(){};
Creator(){}
AbstractProduct* create()
{
cout << "Creator::create()" << endl;
@ -139,7 +139,7 @@ public:
template< class T>
class CreatorT{
public:
CreatorT(){};
CreatorT(){}
T* create()
{
cout << "CreatorT<T>::create()" << endl;

View file

@ -33,7 +33,7 @@ int loop = 5;
struct A
{
A(){};
A(){}
#define DO for(int i=0; i<10000000; i++) g++;

View file

@ -76,7 +76,7 @@ public:
Example(const char * s)
{
msg = s;
};
}
virtual ~Example()
{
echo(msg);

View file

@ -248,7 +248,7 @@ class B1_NoDestroy : public Master1_NoDestroy
{
public:
B1_NoDestroy(){std::cout<<"new B1_NoDestroy. B1_NoDestroy must not be deleted\n";}
~B1_NoDestroy(){std::cout<<"delete B1_NoDestroy\n";};
~B1_NoDestroy(){std::cout<<"delete B1_NoDestroy\n";}
};
class B1_PhoenixSingleton : public Master1_PhoenixSingleton
@ -331,7 +331,7 @@ class B2_NoDestroy : public Master2_NoDestroy
{
public:
B2_NoDestroy(){std::cout<<"new B2_NoDestroy. B2_NoDestroy must not be deleted\n";}
~B2_NoDestroy(){std::cout<<"delete B2_NoDestroy\n";};
~B2_NoDestroy(){std::cout<<"delete B2_NoDestroy\n";}
};
class B2_PhoenixSingleton : public Master2_PhoenixSingleton

View file

@ -27,7 +27,7 @@ public:
Timer()
{
t100 = 0;
};
}
void start()
{

View file

@ -48,12 +48,9 @@ unsigned int MimicCOM::s_destructions = 0;
// ----------------------------------------------------------------------------
/// Used to check if SmartPtr can be used with a forward-reference.
/// GCC gives out warnings because of it, you can ignore them.
class Thingy;
#ifdef __GNUC__
#warning The warnings are by design: Check if SmartPtr can be used with a forward-reference.
#endif
typedef Loki::SmartPtr< Thingy, RefCounted, DisallowConversion,
AssertCheck, DefaultSPStorage, PropagateConst >
Thingy_DefaultStorage_ptr;
@ -1001,10 +998,10 @@ void DoForwardReferenceTest( void )
}
int main( unsigned int argc, const char * argv[] )
int main( int argc, const char * argv[] )
{
bool doThreadTest = false;
for ( unsigned int ii = 1; ii < argc; ++ii )
for ( int ii = 1; ii < argc; ++ii )
{
if ( ::strcmp( argv[ii], "-t" ) == 0 )
doThreadTest = true;