diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-04-22 23:28:31 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-04-22 23:28:31 +0000 |
commit | d5f240e9830d00d8ca6dd98fe28b97ce4c9fc25f (patch) | |
tree | 58b8011552505bde36aa32c757d8ccc013ee0c8e /TAO/tao/LocalObject.cpp | |
parent | 3cf35fe2caa54b8144abbff7ec0c7882a67c7759 (diff) | |
download | ATCD-d5f240e9830d00d8ca6dd98fe28b97ce4c9fc25f.tar.gz |
ChangeLogTag:Sun Apr 22 16:27:20 2001 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/tao/LocalObject.cpp')
-rw-r--r-- | TAO/tao/LocalObject.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/TAO/tao/LocalObject.cpp b/TAO/tao/LocalObject.cpp index 87e479d5867..45843769958 100644 --- a/TAO/tao/LocalObject.cpp +++ b/TAO/tao/LocalObject.cpp @@ -2,18 +2,19 @@ // $Id$ // -#include "tao/LocalObject.h" -#include "tao/Stub.h" -#include "tao/IFR_Client_Adapter.h" +#include "LocalObject.h" +#include "Stub.h" +#include "IFR_Client_Adapter.h" -#include "ace/Auto_Ptr.h" #include "ace/Dynamic_Service.h" #if !defined (__ACE_INLINE__) -# include "tao/LocalObject.i" +# include "LocalObject.i" #endif /* ! __ACE_INLINE__ */ -ACE_RCSID(tao, LocalObject, "$Id$") +ACE_RCSID (tao, + LocalObject, + "$Id$") CORBA_LocalObject::~CORBA_LocalObject (void) { @@ -35,11 +36,17 @@ CORBA_LocalObject::_remove_ref (void) // create hash tables. CORBA::ULong -CORBA_LocalObject::_hash (CORBA::ULong /* maximum */, - CORBA_Environment &ACE_TRY_ENV) +CORBA_LocalObject::_hash (CORBA::ULong maximum, + CORBA_Environment & /* ACE_TRY_ENV */) { - // @@ We need a different hash function here. - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + // Note that we reinterpret_cast to an "unsigned long" instead of + // CORBA::ULong since we need to first cast to an integer large + // enough to hold an address to avoid compile-time warnings on some + // 64-bit platforms. + + CORBA::ULong hash = ACE_reinterpret_cast (unsigned long, this); + + return hash % maximum; } // Compare two object references to see if they point to the same @@ -50,8 +57,8 @@ CORBA_LocalObject::_hash (CORBA::ULong /* maximum */, CORBA::Boolean CORBA_LocalObject::_is_equivalent (CORBA_Object_ptr other_obj, - CORBA_Environment &) - ACE_THROW_SPEC (()) + CORBA_Environment &) + ACE_THROW_SPEC (()) { return (other_obj == this) ? 1 : 0; } @@ -61,7 +68,9 @@ CORBA_LocalObject::_is_equivalent (CORBA_Object_ptr other_obj, TAO_ObjectKey * CORBA_LocalObject::_key (CORBA_Environment &ACE_TRY_ENV) { - ACE_ERROR((LM_ERROR, ACE_TEXT ("(%P|%t) Cannot get _key froma LocalObject!!!\n"))); + ACE_ERROR((LM_ERROR, + ACE_TEXT ("(%P|%t) Cannot get _key froma LocalObject!!!\n"))); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); } |