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
This commit is contained in:
parent
92aa90cc6f
commit
d617910699
1 changed files with 17 additions and 8 deletions
|
@ -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 <loki/SmallObj.h>
|
||||
|
||||
#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
|
||||
|
|
Loading…
Reference in a new issue