|
From: <ric...@us...> - 2010-09-16 17:22:59
|
Revision: 1074
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1074&view=rev
Author: rich_sposato
Date: 2010-09-16 17:22:53 +0000 (Thu, 16 Sep 2010)
Log Message:
-----------
Used initialization instead of assignment within constructor.
Modified Paths:
--------------
trunk/src/StrongPtr.cpp
Modified: trunk/src/StrongPtr.cpp
===================================================================
--- trunk/src/StrongPtr.cpp 2010-09-08 02:22:28 UTC (rev 1073)
+++ trunk/src/StrongPtr.cpp 2010-09-16 17:22:53 UTC (rev 1074)
@@ -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,7 +22,12 @@
#include <loki/SmallObj.h>
+#if defined( _MSC_VER )
+ #pragma warning( push )
+ #pragma warning( disable: 4355 )
+#endif
+
// ----------------------------------------------------------------------------
namespace Loki
@@ -134,8 +139,9 @@
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 @@
return false;
}
else if (m_next == this)
- {
+ {
#ifdef DO_EXTRA_LOKI_TESTS
assert(m_prev == this);
#endif
@@ -573,5 +579,8 @@
// ----------------------------------------------------------------------------
+#if defined( _MSC_VER )
+ #pragma warning( pop )
+#endif
+
} // end namespace Loki
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|