summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-07-16 19:00:39 +0000
committerSteve Huston <shuston@riverace.com>2002-07-16 19:00:39 +0000
commit0be5195b7f88ac879aa52e97867558dfd4312b27 (patch)
tree57c08e6dfa68c19ba8e487f511b486b385d031d7
parent85b45e42fac58396ea1f282d72f93f3c8965380f (diff)
downloadATCD-0be5195b7f88ac879aa52e97867558dfd4312b27.tar.gz
ChangeLogTag:Tue Jul 16 14:19:37 2002 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog12
-rw-r--r--ChangeLogs/ChangeLog-03a12
-rw-r--r--ace/DLL_Manager.cpp6
-rw-r--r--ace/Parse_Node.cpp5
-rw-r--r--tests/DLL_Test.cpp2
5 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 377ec3ec8e4..af2e7e7b8a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Tue Jul 16 14:19:37 2002 Steve Huston <shuston@riverace.com>
+
+ * ace/DLL_Manager.cpp:
+ * ace/Parse_Node.cpp: (also see Fri Jul 12 12:37:42 2002 Steve Huston)
+ Always use the ptrdiff_t trick to cast a void* to a func ptr.
+ Nanbor was right ;-) Thanks to Carlos O'Ryan <coryan@atdesk.com>
+ for clarifying this issue, including C++ chapter and verse.
+ (It's in ISO C++ section 5.2.10 for those interested).
+
+ * tests/DLL_Test.cpp: Use ptrdiff_t as a mediary to cast a void *
+ to a func ptr, not a long.
+
Mon Jul 15 21:23:47 2002 Balachandran Natarajan <bala@cs.wustl.edu>
* ace/Message_Block.i (base): Fixed a warning in TRU 64 builds.
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 377ec3ec8e4..af2e7e7b8a9 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,15 @@
+Tue Jul 16 14:19:37 2002 Steve Huston <shuston@riverace.com>
+
+ * ace/DLL_Manager.cpp:
+ * ace/Parse_Node.cpp: (also see Fri Jul 12 12:37:42 2002 Steve Huston)
+ Always use the ptrdiff_t trick to cast a void* to a func ptr.
+ Nanbor was right ;-) Thanks to Carlos O'Ryan <coryan@atdesk.com>
+ for clarifying this issue, including C++ chapter and verse.
+ (It's in ISO C++ section 5.2.10 for those interested).
+
+ * tests/DLL_Test.cpp: Use ptrdiff_t as a mediary to cast a void *
+ to a func ptr, not a long.
+
Mon Jul 15 21:23:47 2002 Balachandran Natarajan <bala@cs.wustl.edu>
* ace/Message_Block.i (base): Fixed a warning in TRU 64 builds.
diff --git a/ace/DLL_Manager.cpp b/ace/DLL_Manager.cpp
index d1edd19046c..2627e91fad1 100644
--- a/ace/DLL_Manager.cpp
+++ b/ace/DLL_Manager.cpp
@@ -463,16 +463,10 @@ ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload)
dll_unload_policy the_policy = 0;
void *unload_policy_ptr =
dll_handle->symbol (ACE_TEXT ("_get_dll_unload_policy"), 1);
-#if defined (__GNUG__)
- // g++ won't allow void*->func*
ptrdiff_t temp_p =
ACE_reinterpret_cast (ptrdiff_t, unload_policy_ptr);
the_policy =
ACE_reinterpret_cast (dll_unload_policy, temp_p);
-#else
- the_policy =
- ACE_reinterpret_cast (dll_unload_policy, unload_policy_ptr);
-#endif /* __GNUG__ */
if (the_policy != 0)
unload = ACE_BIT_DISABLED (the_policy (),
ACE_DLL_UNLOAD_POLICY_LAZY);
diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp
index 3e3818b3e71..45d863740bf 100644
--- a/ace/Parse_Node.cpp
+++ b/ace/Parse_Node.cpp
@@ -495,13 +495,8 @@ ACE_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler)
return 0;
}
}
-#if defined (__GNUG__)
- // g++ won't allow void*->func*
ptrdiff_t temp_p = ACE_reinterpret_cast (ptrdiff_t, func_p);
func = ACE_reinterpret_cast (ACE_Service_Factory_Ptr, temp_p);
-#else
- func = ACE_reinterpret_cast (ACE_Service_Factory_Ptr, func_p);
-#endif /* __GNUG__ */
// Invoke the factory function and record it's return value.
this->symbol_ = (*func) (gobbler);
diff --git a/tests/DLL_Test.cpp b/tests/DLL_Test.cpp
index 549842e01e4..526ff3d093d 100644
--- a/tests/DLL_Test.cpp
+++ b/tests/DLL_Test.cpp
@@ -92,7 +92,7 @@ int basic_test (ACE_DLL &dll)
foo = dll.symbol (ACE_TEXT ("get_hello"));
// Cast the void* to long first.
- long tmp = ACE_reinterpret_cast (long, foo);
+ ptrdiff_t tmp = ACE_reinterpret_cast (ptrdiff_t, foo);
Hello_Factory factory = ACE_reinterpret_cast (Hello_Factory, tmp);
if (factory == 0)
ACE_ERROR_RETURN ((LM_ERROR,