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
|
// The Loki Library
|
||||||
// Copyright (c) 2006 Rich Sposato
|
// Copyright (c) 2006 Rich Sposato
|
||||||
// Permission to use, copy, modify, distribute and sell this software for any
|
// Permission to use, copy, modify, distribute and sell this software for any
|
||||||
// purpose is hereby granted without fee, provided that the above copyright
|
// purpose is hereby granted without fee, provided that the above copyright
|
||||||
// notice appear in all copies and that both that copyright notice and this
|
// notice appear in all copies and that both that copyright notice and this
|
||||||
// permission notice appear in supporting documentation.
|
// permission notice appear in supporting documentation.
|
||||||
// The author makes no representations about the
|
// The author makes no representations about the
|
||||||
// suitability of this software for any purpose. It is provided "as is"
|
// suitability of this software for any purpose. It is provided "as is"
|
||||||
// without express or implied warranty.
|
// without express or implied warranty.
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@
|
||||||
|
|
||||||
#include <loki/SmallObj.h>
|
#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 )
|
TwoRefLinks::TwoRefLinks( const void * p, bool strong )
|
||||||
: m_pointer( const_cast< void * >( p ) )
|
: m_pointer( const_cast< void * >( p ) )
|
||||||
, m_strong( strong )
|
, m_strong( strong )
|
||||||
|
, m_prev( this )
|
||||||
|
, m_next( this )
|
||||||
{
|
{
|
||||||
m_prev = m_next = this;
|
|
||||||
#ifdef DO_EXTRA_LOKI_TESTS
|
#ifdef DO_EXTRA_LOKI_TESTS
|
||||||
assert( CountPrevCycle( this ) == CountNextCycle( this ) );
|
assert( CountPrevCycle( this ) == CountNextCycle( this ) );
|
||||||
#endif
|
#endif
|
||||||
|
@ -246,7 +252,7 @@ bool TwoRefLinks::Release( bool strong )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (m_next == this)
|
else if (m_next == this)
|
||||||
{
|
{
|
||||||
#ifdef DO_EXTRA_LOKI_TESTS
|
#ifdef DO_EXTRA_LOKI_TESTS
|
||||||
assert(m_prev == this);
|
assert(m_prev == this);
|
||||||
#endif
|
#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…
Add table
Reference in a new issue