summaryrefslogtreecommitdiff
path: root/TAO/examples/POA/Loader/Servant_Locator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/POA/Loader/Servant_Locator.cpp')
-rw-r--r--TAO/examples/POA/Loader/Servant_Locator.cpp36
1 files changed, 13 insertions, 23 deletions
diff --git a/TAO/examples/POA/Loader/Servant_Locator.cpp b/TAO/examples/POA/Loader/Servant_Locator.cpp
index d7cef6ebcc2..6c9a7503f7f 100644
--- a/TAO/examples/POA/Loader/Servant_Locator.cpp
+++ b/TAO/examples/POA/Loader/Servant_Locator.cpp
@@ -32,32 +32,22 @@ ServantLocator_i::ServantLocator_i (CORBA::ORB_ptr orb,
const char *garbage_collection_function)
: orb_ (CORBA::ORB::_duplicate (orb))
{
- // The dll is opened using the dllname passed.
- if (this->dll_.open (dllname) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p",
- this->dll_.error ()));
-
- // Obtain the symbol for the function that will get the servant
- // object.
-
- //
- // Cannot go from void* to function pointer directly. Cast the void*
- // to long first.
- //
- void *symbol = this->dll_.symbol (factory_function);
- long function = ACE_reinterpret_cast (long, symbol);
-
+ // The dll is opened using the dllname passed.
+ if (this->dll_.open (dllname) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "%p",
+ this->dll_.error ()));
+
+ // Obtain the symbol for the function that will
+ // get the servant object.
servant_supplier_ =
- ACE_reinterpret_cast (SERVANT_FACTORY, function);
-
- // Obtain the symbol for the function which will destroy the
- // servant.
- symbol = this->dll_.symbol (garbage_collection_function);
- function = ACE_reinterpret_cast (long, symbol);
+ (SERVANT_FACTORY) this->dll_.symbol (factory_function);
+ // Obtain tne symbol for the function which
+ // will destroy the servant.
servant_garbage_collector_ =
- ACE_reinterpret_cast (SERVANT_GARBAGE_COLLECTOR, function);
+ (SERVANT_GARBAGE_COLLECTOR) this->dll_.symbol (garbage_collection_function);
+
}
// This method associates an servant with the ObjectID.