diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2006-03-12 16:32:53 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2006-03-12 16:32:53 +0000 |
commit | 6a58d941f3cb6a60076e60452939729fe7029401 (patch) | |
tree | fe9b8a04a572a1f0d4e33561b88f2c150c7363c7 /ace/CDR_Stream.inl | |
parent | c51e3e42cc4ad79e1d846e71ae97c908bacf989d (diff) | |
download | ATCD-6a58d941f3cb6a60076e60452939729fe7029401.tar.gz |
ChangeLogTag:Sun Mar 12 09:10:01 2006 Douglas C. Schmidt <schmidt@cse.wustl.edu>
Diffstat (limited to 'ace/CDR_Stream.inl')
-rw-r--r-- | ace/CDR_Stream.inl | 98 |
1 files changed, 66 insertions, 32 deletions
diff --git a/ace/CDR_Stream.inl b/ace/CDR_Stream.inl index a494f3dd0be..cbcb6638bf1 100644 --- a/ace/CDR_Stream.inl +++ b/ace/CDR_Stream.inl @@ -170,7 +170,6 @@ ACE_OutputCDR::reset (void) ACE_Message_Block::release (cont); this->start_.cont (0); } - } // Encode the CDR stream. @@ -178,7 +177,8 @@ ACE_OutputCDR::reset (void) ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_octet (ACE_CDR::Octet x) { - return this->write_1 (reinterpret_cast<const ACE_CDR::Octet *> (&x)); + const void *temp = &x; + return this->write_1 (reinterpret_cast<const ACE_CDR::Octet *> (temp)); } ACE_INLINE ACE_CDR::Boolean @@ -191,62 +191,74 @@ ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_char (ACE_CDR::Char x) { if (this->char_translator_ == 0) - return this->write_1 (reinterpret_cast<const ACE_CDR::Octet*> (&x)); + { + const void *temp = &x; + return this->write_1 (reinterpret_cast<const ACE_CDR::Octet*> (temp)); + } return this->char_translator_->write_char (*this, x); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_short (ACE_CDR::Short x) { - return this->write_2 (reinterpret_cast<const ACE_CDR::UShort*> (&x)); + const void *temp = &x; + return this->write_2 (reinterpret_cast<const ACE_CDR::UShort*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ushort (ACE_CDR::UShort x) { - return this->write_2 (reinterpret_cast<const ACE_CDR::UShort*> (&x)); + const void *temp = &x; + return this->write_2 (reinterpret_cast<const ACE_CDR::UShort*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_long (ACE_CDR::Long x) { - return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); + const void *temp = &x; + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ulong (ACE_CDR::ULong x) { - return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); + const void *temp = &x; + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_longlong (const ACE_CDR::LongLong &x) { - return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (&x)); + const void *temp = &x; + return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ulonglong (const ACE_CDR::ULongLong &x) { - return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (&x)); + const void *temp = &x; + return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_float (ACE_CDR::Float x) { - return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); + const void *temp = &x; + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_double (const ACE_CDR::Double &x) { - return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (&x)); + const void *temp = &x; + return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_longdouble (const ACE_CDR::LongDouble &x) { - return this->write_16 (reinterpret_cast<const ACE_CDR::LongDouble*> (&x)); + const void *temp = &x; + return this->write_16 (reinterpret_cast<const ACE_CDR::LongDouble*> (temp)); } ACE_INLINE ACE_CDR::Boolean @@ -602,7 +614,10 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_char (ACE_CDR::Char &x) { if (this->char_translator_ == 0) - return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (&x)); + { + void *temp = &x; + return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (temp)); + } return this->char_translator_->read_char (*this, x); } @@ -610,58 +625,67 @@ ACE_InputCDR::read_char (ACE_CDR::Char &x) ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_short (ACE_CDR::Short &x) { - return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); + void *temp = &x; + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ushort (ACE_CDR::UShort &x) { - return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); + void *temp = &x; + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_long (ACE_CDR::Long &x) { - return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); + void *temp = &x; + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulong (ACE_CDR::ULong &x) { - return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); + void *temp = &x; + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longlong (ACE_CDR::LongLong &x) { - return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); + void *temp = &x; + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulonglong (ACE_CDR::ULongLong &x) { - return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); + void *temp = &x; + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_float (ACE_CDR::Float &x) { - return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); + void *temp = &x; + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_double (ACE_CDR::Double &x) { - return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); + void *temp = &x; + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longdouble (ACE_CDR::LongDouble &x) { - return this->read_16 (reinterpret_cast<ACE_CDR::LongDouble*> (&x)); + void *temp = &x; + return this->read_16 (reinterpret_cast<ACE_CDR::LongDouble*> (temp)); } ACE_INLINE size_t @@ -898,7 +922,8 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_char (void) { ACE_CDR::Char x; - return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (&x)); + void *temp = &x; + return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (temp)); } ACE_INLINE ACE_CDR::Boolean @@ -920,42 +945,48 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_short (void) { ACE_CDR::Short x; - return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); + void *temp = &x; + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_ushort (void) { ACE_CDR::UShort x; - return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); + void *temp = &x; + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_long (void) { ACE_CDR::Long x; - return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); + void *temp = &x; + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_ulong (void) { ACE_CDR::ULong x; - return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); + void *temp = &x; + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_longlong (void) { ACE_CDR::LongLong x; - return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); + void *temp = &x; + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_ulonglong (void) { ACE_CDR::ULongLong x; - return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); + void *temp = &x; + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean @@ -964,21 +995,24 @@ ACE_InputCDR::skip_float (void) // Changing this removes the warning for GHS and it // stops the compiler from getting an internal error. ACE_CDR::ULong value; - return this->read_4 (&value); + void *temp = &value; + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_double (void) { double x; - return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); + void *temp = &x; + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_longdouble (void) { ACE_CDR::LongDouble x; - return this->read_16 (reinterpret_cast<ACE_CDR::LongDouble*> (&x)); + void *temp = &x; + return this->read_16 (reinterpret_cast<ACE_CDR::LongDouble*> (temp)); } ACE_INLINE char* |