diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-07-16 19:38:59 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-07-16 19:38:59 +0000 |
commit | 949213d9446b145849c89ac6d15faa8e0f31150f (patch) | |
tree | cf037c3c7ee2677e17992ba7f80c9f2a980f2aad /TAO/tao/GIOP_Message_State.cpp | |
parent | 7fb78ea814cbc9abe6b436e687390ef0358a47db (diff) | |
download | ATCD-949213d9446b145849c89ac6d15faa8e0f31150f.tar.gz |
ChangeLogTag: Mon Jul 16 14:25:23 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/GIOP_Message_State.cpp')
-rw-r--r-- | TAO/tao/GIOP_Message_State.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp index 5c736573a2b..82ccec8d474 100644 --- a/TAO/tao/GIOP_Message_State.cpp +++ b/TAO/tao/GIOP_Message_State.cpp @@ -248,27 +248,27 @@ TAO_GIOP_Message_State::read_ulong (char *rd_ptr) { CORBA::ULong x = 0; - // @@todo: This is so funny.. I am not sure why and with what in - // mind I had aligned this to 4 byte boundary when I was reading - // from the stream. Maybe when I was a kid:-). This definitely - // creates problems. Maybe we should revisit this if there is a - // pellmell. - // size_t msg_size = 4; - - // char *buf = ACE_ptr_align_binary (rd_ptr, - // msg_size); + // We dont need to do this sort of copy. But some compilers (read it + // as solaris ones) have a problem in deferencing from the + // reinterpret_cast pointer of the <rd_ptr>, as the <rd_ptr> can be + // on stack. So let us go ahead with this copying... + char buf [4]; + buf[0] = *rd_ptr; + buf[1] = *(rd_ptr + 1); + buf[2] = *(rd_ptr + 2); + buf[3] = *(rd_ptr + 3); #if !defined (ACE_DISABLE_SWAP_ON_READ) if (!(this->byte_order_ != ACE_CDR_BYTE_ORDER)) { - x = *ACE_reinterpret_cast (ACE_CDR::ULong*, rd_ptr); + x = *ACE_reinterpret_cast (ACE_CDR::ULong*, buf); } else { - ACE_CDR::swap_4 (rd_ptr, ACE_reinterpret_cast (char*, &x)); + ACE_CDR::swap_4 (buf, ACE_reinterpret_cast (char*, &x)); } #else - x = *ACE_reinterpret_cast(ACE_CDR::ULong*, rd_ptr); + x = *ACE_reinterpret_cast(ACE_CDR::ULong*, buf); #endif /* ACE_DISABLE_SWAP_ON_READ */ return x; |