From: <lf...@us...> - 2007-05-08 10:48:47
|
Revision: 823 http://svn.sourceforge.net/loki-lib/?rev=823&view=rev Author: lfittl Date: 2007-05-08 03:48:40 -0700 (Tue, 08 May 2007) Log Message: ----------- - Fixed build failures with gcc 4.3 pre-release (http://bugs.debian.org/413432) Modified Paths: -------------- trunk/include/loki/CachedFactory.h trunk/include/loki/SPCachedFactory.h trunk/include/loki/SafeFormat.h trunk/include/loki/SmartPtr.h trunk/src/SmallObj.cpp trunk/test/CachedFactory/CachedFactoryTest.cpp trunk/test/DeletableSingleton/DeletableSingleton.cpp trunk/test/Factory/Factory.cpp trunk/test/LockingPtr/main.cpp trunk/test/Longevity/main.cpp trunk/test/Singleton/Dependencies.cpp trunk/test/SmallObj/timer.h trunk/test/SmartPtr/main.cpp Modified: trunk/include/loki/CachedFactory.h =================================================================== --- trunk/include/loki/CachedFactory.h 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/include/loki/CachedFactory.h 2007-05-08 10:48:40 UTC (rev 823) @@ -491,7 +491,7 @@ protected: - virtual ~EvictRandom(){}; + virtual ~EvictRandom(){} void onCreate(const DT&){ } @@ -662,7 +662,7 @@ 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 @@ 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 @@ ProductReturn CreateObject(const IdentifierType& id) { - Key key(id); + MyKey key(id); AbstractProduct *pProduct(getPointerToObjectInContainer(getContainerFromKey(key))); if(shouldCreateObject(pProduct)) { @@ -879,7 +879,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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)) { Modified: trunk/include/loki/SPCachedFactory.h =================================================================== --- trunk/include/loki/SPCachedFactory.h 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/include/loki/SPCachedFactory.h 2007-05-08 10:48:40 UTC (rev 823) @@ -171,7 +171,7 @@ protected: typedef CallBackSP ProductReturn; SmartPointer() : fun(this, &SmartPointer::smartPointerCallbackFunction) {} - virtual ~SmartPointer(){}; + virtual ~SmartPointer(){} ProductReturn encapsulate(AbstractProduct* pProduct) { Modified: trunk/include/loki/SafeFormat.h =================================================================== --- trunk/include/loki/SafeFormat.h 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/include/loki/SafeFormat.h 2007-05-08 10:48:40 UTC (rev 823) @@ -22,6 +22,7 @@ //////////////////////////////////////////////////////////////////////////////// #include <cstdio> +#include <climits> #include <string> #include <stdexcept> #include <utility> Modified: trunk/include/loki/SmartPtr.h =================================================================== --- trunk/include/loki/SmartPtr.h 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/include/loki/SmartPtr.h 2007-05-08 10:48:40 UTC (rev 823) @@ -188,6 +188,9 @@ 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_; Modified: trunk/src/SmallObj.cpp =================================================================== --- trunk/src/SmallObj.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/src/SmallObj.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -19,6 +19,7 @@ #include <loki/SmallObj.h> #include <cassert> +#include <climits> #include <vector> #include <bitset> Modified: trunk/test/CachedFactory/CachedFactoryTest.cpp =================================================================== --- trunk/test/CachedFactory/CachedFactoryTest.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/CachedFactory/CachedFactoryTest.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -72,7 +72,7 @@ class AbstractProduct{ public: - virtual ~AbstractProduct(){}; + virtual ~AbstractProduct(){} }; class Product : public AbstractProduct Modified: trunk/test/DeletableSingleton/DeletableSingleton.cpp =================================================================== --- trunk/test/DeletableSingleton/DeletableSingleton.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/DeletableSingleton/DeletableSingleton.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -40,7 +40,7 @@ LogClass() { print("LogClass::LogClass()"); - }; + } ~LogClass() { print("LogClass::~LogClass()"); Modified: trunk/test/Factory/Factory.cpp =================================================================== --- trunk/test/Factory/Factory.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/Factory/Factory.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -119,7 +119,7 @@ class Creator : public AbstractCreator{ public: - Creator(){}; + Creator(){} AbstractProduct* create() { cout << "Creator::create()" << endl; @@ -139,7 +139,7 @@ template< class T> class CreatorT{ public: - CreatorT(){}; + CreatorT(){} T* create() { cout << "CreatorT<T>::create()" << endl; Modified: trunk/test/LockingPtr/main.cpp =================================================================== --- trunk/test/LockingPtr/main.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/LockingPtr/main.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -33,7 +33,7 @@ struct A { - A(){}; + A(){} #define DO for(int i=0; i<10000000; i++) g++; Modified: trunk/test/Longevity/main.cpp =================================================================== --- trunk/test/Longevity/main.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/Longevity/main.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -76,7 +76,7 @@ Example(const char * s) { msg = s; - }; + } virtual ~Example() { echo(msg); Modified: trunk/test/Singleton/Dependencies.cpp =================================================================== --- trunk/test/Singleton/Dependencies.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/Singleton/Dependencies.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -248,7 +248,7 @@ { 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 @@ { 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 Modified: trunk/test/SmallObj/timer.h =================================================================== --- trunk/test/SmallObj/timer.h 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/SmallObj/timer.h 2007-05-08 10:48:40 UTC (rev 823) @@ -27,7 +27,7 @@ Timer() { t100 = 0; - }; + } void start() { Modified: trunk/test/SmartPtr/main.cpp =================================================================== --- trunk/test/SmartPtr/main.cpp 2007-05-07 14:23:19 UTC (rev 822) +++ trunk/test/SmartPtr/main.cpp 2007-05-08 10:48:40 UTC (rev 823) @@ -48,12 +48,9 @@ // ---------------------------------------------------------------------------- /// 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 @@ } -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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |