summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a10
-rw-r--r--TAO/tao/ClientRequestInfo.cpp30
-rw-r--r--TAO/tao/PortableServer/ServerRequestInfo.cpp9
3 files changed, 40 insertions, 9 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 2ce64bbe447..30946872c5f 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,13 @@
+Thu Apr 12 12:07:05 2001 Ossama Othman <ossama@uci.edu>
+
+ * tao/ClientRequestInfo.cpp (request_id):
+ * tao/PortableServer/ServerRequestInfo.cpp (request_id):
+
+ 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.
+
Thu Apr 12 09:00:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
* examples/PluggableUDP/tests/SimplePerformance/client.cpp:
diff --git a/TAO/tao/ClientRequestInfo.cpp b/TAO/tao/ClientRequestInfo.cpp
index fc4239a3590..2e3aab087b5 100644
--- a/TAO/tao/ClientRequestInfo.cpp
+++ b/TAO/tao/ClientRequestInfo.cpp
@@ -6,6 +6,7 @@
#include "Invocation.h"
#include "Stub.h"
#include "Tagged_Components.h"
+#include "debug.h"
ACE_RCSID (TAO,
ClientRequestInfo,
@@ -277,7 +278,7 @@ TAO_ClientRequestInfo::add_request_service_context (
}
CORBA::ULong
-TAO_ClientRequestInfo::request_id (CORBA::Environment &)
+TAO_ClientRequestInfo::request_id (CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
// @todo We may have to worry about AMI once we support interceptors
@@ -304,9 +305,14 @@ TAO_ClientRequestInfo::request_id (CORBA::Environment &)
CORBA::ULong id = 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.
+
// 32 bit address
if (sizeof (this) == 4)
- id = ACE_reinterpret_cast (CORBA::ULong, this->invocation_);
+ id = ACE_reinterpret_cast (unsigned long, this->invocation_);
// 64 bit address -- bits 8 through 39 (see notes above!)
// In this case, we make sure this object is large enough to safely
@@ -315,13 +321,12 @@ TAO_ClientRequestInfo::request_id (CORBA::Environment &)
else if (sizeof (this) == 8
&& sizeof (*(this->invocation_)) > 256 /* 2 << 8 */)
id =
- (ACE_reinterpret_cast (CORBA::ULong,
+ (ACE_reinterpret_cast (unsigned long,
this->invocation_) >> 8) & 0xFFFFFFFFu;
// 64 bit address -- lower 32 bits
- //
else if (sizeof (this) == 8)
- id = ACE_reinterpret_cast (CORBA::ULong,
+ id = ACE_reinterpret_cast (unsigned long,
this->invocation_) & 0xFFFFFFFFu;
// @@ The following request ID generator prevents the
@@ -335,8 +340,19 @@ TAO_ClientRequestInfo::request_id (CORBA::Environment &)
//
// Ideally, this request ID generator should go away, especially
// since it adds a lock to the critical path.
- else // Fallback
- id = this->invocation_->request_id ();
+ // else // Fallback
+ // id = this->invocation_->request_id ();
+
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ClientRequestInfo::request_id() failed\n"
+ "(%P|%t) since its request ID generator is not\n"
+ "(%P|%t) supported on this platform.\n"));
+
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
return id;
}
diff --git a/TAO/tao/PortableServer/ServerRequestInfo.cpp b/TAO/tao/PortableServer/ServerRequestInfo.cpp
index 0650252ce8c..9a990de852b 100644
--- a/TAO/tao/PortableServer/ServerRequestInfo.cpp
+++ b/TAO/tao/PortableServer/ServerRequestInfo.cpp
@@ -48,13 +48,18 @@ TAO_ServerRequestInfo::request_id (CORBA::Environment &)
CORBA::ULong id = 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.
+
if (sizeof (this) == 4) // 32 bit address
id =
- ACE_reinterpret_cast (CORBA::ULong, &(this->server_request_));
+ ACE_reinterpret_cast (unsigned long, &(this->server_request_));
else if (sizeof (this) == 8) // 64 bit address -- use lower 32 bits
id =
- ACE_reinterpret_cast (CORBA::ULong,
+ ACE_reinterpret_cast (unsigned long,
&(this->server_request_)) & 0xFFFFFFFFu;
else