From d617910699a3346f7ff0d5d203c705727ee55241 Mon Sep 17 00:00:00 2001 From: rich_sposato Date: Thu, 16 Sep 2010 17:22:53 +0000 Subject: [PATCH] Used initialization instead of assignment within constructor. git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1074 7ec92016-0320-0410-acc4-a06ded1c099a --- src/StrongPtr.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/StrongPtr.cpp b/src/StrongPtr.cpp index 3ce2f01..d09526f 100644 --- a/src/StrongPtr.cpp +++ b/src/StrongPtr.cpp @@ -1,12 +1,12 @@ //////////////////////////////////////////////////////////////////////////////// // The Loki Library // Copyright (c) 2006 Rich Sposato -// Permission to use, copy, modify, distribute and sell this software for any -// purpose is hereby granted without fee, provided that the above copyright -// notice appear in all copies and that both that copyright notice and this +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this // permission notice appear in supporting documentation. -// The author makes no representations about the -// suitability of this software for any purpose. It is provided "as is" +// The author makes no representations about the +// suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// @@ -22,6 +22,11 @@ #include +#if defined( _MSC_VER ) + #pragma warning( push ) + #pragma warning( disable: 4355 ) +#endif + // ---------------------------------------------------------------------------- @@ -134,8 +139,9 @@ void TwoRefCounts::ZapPointer( void ) TwoRefLinks::TwoRefLinks( const void * p, bool strong ) : m_pointer( const_cast< void * >( p ) ) , m_strong( strong ) + , m_prev( this ) + , m_next( this ) { - m_prev = m_next = this; #ifdef DO_EXTRA_LOKI_TESTS assert( CountPrevCycle( this ) == CountNextCycle( this ) ); #endif @@ -246,7 +252,7 @@ bool TwoRefLinks::Release( bool strong ) return false; } else if (m_next == this) - { + { #ifdef DO_EXTRA_LOKI_TESTS assert(m_prev == this); #endif @@ -573,5 +579,8 @@ bool TwoRefLinks::Merge( TwoRefLinks & rhs ) // ---------------------------------------------------------------------------- -} // end namespace Loki +#if defined( _MSC_VER ) + #pragma warning( pop ) +#endif +} // end namespace Loki