summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2007-07-24 22:48:19 +0000
committerSteve Huston <shuston@riverace.com>2007-07-24 22:48:19 +0000
commit75df48ce51a93c54b5799b799057e042655eefae (patch)
tree2fdf62f6fdb3412c56f4a0e4b9972b47c2573552
parente1c5a7946c765b5e70f9eb0300f7fc0bc54247d1 (diff)
downloadATCD-75df48ce51a93c54b5799b799057e042655eefae.tar.gz
ChangeLogTag:Tue Jul 24 22:45:37 UTC 2007 Steve Huston <shuston@riverace.com>
-rw-r--r--ACE/ChangeLog6
-rw-r--r--ACE/ace/Bound_Ptr.inl10
2 files changed, 14 insertions, 2 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 7fdabed8c83..5a5008c2e41 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 24 22:45:37 UTC 2007 Steve Huston <shuston@riverace.com>
+
+ * ace/Bound_Ptr.inl (operator=): Check for assign-to-self first;
+ the code would work assigning to self (as the comment states) but
+ why do it? Also resolves some compile warnings on HP aC++.
+
Tue Jul 24 20:38:50 UTC 2007 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
* COPYING: Updated this file to reflect 2007.
diff --git a/ACE/ace/Bound_Ptr.inl b/ACE/ace/Bound_Ptr.inl
index c99cf0843f3..6bc1e993e20 100644
--- a/ACE/ace/Bound_Ptr.inl
+++ b/ACE/ace/Bound_Ptr.inl
@@ -191,7 +191,10 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::~ACE_Strong_Bound_Ptr (void)
template <class X, class ACE_LOCK> inline void
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::operator = (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &rhs)
{
- // This will work if &r == this, by first increasing the ref count
+ // This will work if &r == this, by first increasing the ref count, but
+ // why go through all that?
+ if (&rhs == this)
+ return;
COUNTER *new_counter = rhs.counter_;
X_t *new_ptr = rhs.ptr_;
@@ -205,7 +208,10 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::operator = (const ACE_Strong_Bound_Ptr<X, ACE
template <class X, class ACE_LOCK> inline void
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::operator = (const ACE_Weak_Bound_Ptr<X, ACE_LOCK> &rhs)
{
- // This will work if &r == this, by first increasing the ref count
+ // This will work if &r == this, by first increasing the ref count, but
+ // why go through all that?
+ if (&rhs == this)
+ return;
COUNTER *new_counter = rhs.counter_;
X_t *new_ptr = rhs.ptr_;