diff --git a/include/loki/Factory.h b/include/loki/Factory.h index c1f67f5..53d2b1d 100644 --- a/include/loki/Factory.h +++ b/include/loki/Factory.h @@ -21,6 +21,12 @@ #include "AssocVector.h" #include "SmallObj.h" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4702) +//unreachable code if OnUnknownType throws an exception +#endif + namespace Loki { @@ -733,6 +739,10 @@ namespace Loki }; } // namespace Loki +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + //////////////////////////////////////////////////////////////////////////////// // Change log: // June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!! @@ -747,6 +757,9 @@ namespace Loki #endif // FACTORY_INC_ // $Log$ +// Revision 1.7 2005/10/05 09:57:37 syntheticpp +// move unreachable code warnings +// // Revision 1.6 2005/09/26 07:33:04 syntheticpp // move macros into LOKI_ namespace // diff --git a/include/loki/Singleton.h b/include/loki/Singleton.h index 5d874bd..00bdd9e 100644 --- a/include/loki/Singleton.h +++ b/include/loki/Singleton.h @@ -194,11 +194,13 @@ namespace Loki template struct CreateStatic { -#if defined(_MSC_VER) && _MSC_VER >= 1300 + +#ifdef _MSC_VER #pragma warning( push ) - // alignment of a member was sensitive to packing #pragma warning( disable : 4121 ) +// alignment of a member was sensitive to packing #endif // _MSC_VER + union MaxAlign { char t_[sizeof(T)]; @@ -212,7 +214,8 @@ namespace Loki int Test::* pMember_; int (Test::*pMemberFn_)(int); }; -#if defined(_MSC_VER) && _MSC_VER >= 1300 + +#ifdef _MSC_VER #pragma warning( pop ) #endif // _MSC_VER @@ -432,8 +435,8 @@ namespace Loki { if (destroyed_) { + destroyed_ = false; LifetimePolicy::OnDeadReference(); - destroyed_ = false; } pInstance_ = CreationPolicy::Create(); LifetimePolicy::ScheduleDestruction(pInstance_,