diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-27 02:09:49 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-27 02:09:49 +0000 |
commit | ae45d29dd1e817e1a60628d26213611bf777d712 (patch) | |
tree | a452eb38b0706749c5cf99ef5b72c40373a27ec6 | |
parent | 2fd3a3beab0ab23616986568df68de9682fe81b5 (diff) | |
download | ATCD-ae45d29dd1e817e1a60628d26213611bf777d712.tar.gz |
ChangeLogTag:Wed Aug 26 19:13:49 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-98c | 19 | ||||
-rw-r--r-- | TAO/tao/CDR.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Sequence.cpp | 50 | ||||
-rw-r--r-- | TAO/tao/Sequence.i | 52 |
4 files changed, 72 insertions, 51 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index c7dd703f2d0..18df4d317f0 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,15 @@ +Wed Aug 26 19:13:49 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/Sequence.i: + * tao/Sequence.cpp: + Moved the sequence<octet>::get_buffer method to the .i file to + work around a Sun/C++ bug (apparently it only shows up on + Solaris 2.6 for x86). + + * tao/CDR.cpp: + Fixed syntax error when compiling without + TAO_NO_COPY_OCTET_SEQUENCES. + Wed Aug 26 20:37:33 1998 Sergio Flores <sergio@tango.cs.wustl.edu> * tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp: @@ -36,6 +48,13 @@ Wed Aug 26 17:00:38 1998 Nanbor Wang <nanbor@cs.wustl.edu> * TAO_IDL/driver/drv_preproc.cpp (DRV_check_for_include): Removed an unused local variable <nm>. +Wed Aug 26 19:13:33 1998 Darrell Brunsch <brunsch@cs.wustl.edu> + + * utils/catior/*: Added this little utility (which was donated + by Jeff Hopper <jhopper@nosc.mil>) which will take in a + stringified IOR and decode it, printing out the information + contained in it. + Wed Aug 26 18:15:37 1998 Nagarajan Surendran <naga@cs.wustl.edu> * orbsvcs/tests/AVStreams/mpeg/: Added a README file and diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp index 408b62a65f9..cff85493b6e 100644 --- a/TAO/tao/CDR.cpp +++ b/TAO/tao/CDR.cpp @@ -554,8 +554,8 @@ TAO_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb) this->good_bit_ = 0; return CORBA::B_FALSE; } - } #endif /* TAO_NO_COPY_OCTET_SEQUENCES */ + } return CORBA::B_TRUE; } diff --git a/TAO/tao/Sequence.cpp b/TAO/tao/Sequence.cpp index aa5faa52340..eec46c409f4 100644 --- a/TAO/tao/Sequence.cpp +++ b/TAO/tao/Sequence.cpp @@ -374,56 +374,6 @@ TAO_Unbounded_Sequence<CORBA::Octet>::_allocate_buffer (CORBA::ULong length) this->buffer_ = tmp; } -CORBA::Octet * -TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) -{ - CORBA::Octet *result = 0; - if (orphan == CORBA::B_FALSE) - { - // We retain ownership. - - if (this->buffer_ == 0) - { - // The buffer was not allocated, we must allocate it now. - result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); - this->buffer_ = result; - } - else - { - result = - ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); - } - } - else if (this->mb_ != 0) // (orphan == CORBA::B_TRUE) - { - // We must create a copy anyway: - // the user is supposed to call freebuf() to release the - // buffer, but the buffer is inside a Message_Block... - // We thought about storing the pointer to the Message_Block - // somewhere at the beginning of the buffer (before the actual - // data), but that will not work in 64 bit machines when the - // buffer comes from a CDR stream. - // - result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); - ACE_OS::memcpy (result, this->buffer_, this->length_); - } - else if (this->release_ != CORBA::B_FALSE) - { - // We set the state back to default and relinquish - // ownership. - result = ACE_reinterpret_cast(CORBA::Octet*,this->buffer_); - this->maximum_ = 0; - this->length_ = 0; - this->buffer_ = 0; - this->release_ = CORBA::B_FALSE; - } - /* else - // Oops, it's not our buffer to relinquish... - return 0; - */ - return result; -} - void TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong max, CORBA::ULong length, diff --git a/TAO/tao/Sequence.i b/TAO/tao/Sequence.i index 93f5f40c6cd..4fdad1f141c 100644 --- a/TAO/tao/Sequence.i +++ b/TAO/tao/Sequence.i @@ -268,6 +268,58 @@ TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (void) const return ACE_reinterpret_cast(const CORBA::Octet * ACE_CAST_CONST, this->buffer_); } +// This function is a little too big to be inlined, but some compilers +// (Sun/CC 4.1?) die if it isn't :-( +ACE_INLINE CORBA::Octet * +TAO_Unbounded_Sequence<CORBA::Octet>::get_buffer (CORBA::Boolean orphan) +{ + CORBA::Octet *result = 0; + if (orphan == CORBA::B_FALSE) + { + // We retain ownership. + + if (this->buffer_ == 0) + { + // The buffer was not allocated, we must allocate it now. + result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); + this->buffer_ = result; + } + else + { + result = + ACE_reinterpret_cast (CORBA::Octet*,this->buffer_); + } + } + else if (this->mb_ != 0) // (orphan == CORBA::B_TRUE) + { + // We must create a copy anyway: + // the user is supposed to call freebuf() to release the + // buffer, but the buffer is inside a Message_Block... + // We thought about storing the pointer to the Message_Block + // somewhere at the beginning of the buffer (before the actual + // data), but that will not work in 64 bit machines when the + // buffer comes from a CDR stream. + // + result = TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (this->length_); + ACE_OS::memcpy (result, this->buffer_, this->length_); + } + else if (this->release_ != CORBA::B_FALSE) + { + // We set the state back to default and relinquish + // ownership. + result = ACE_reinterpret_cast(CORBA::Octet*,this->buffer_); + this->maximum_ = 0; + this->length_ = 0; + this->buffer_ = 0; + this->release_ = CORBA::B_FALSE; + } + /* else + // Oops, it's not our buffer to relinquish... + return 0; + */ + return result; +} + ACE_INLINE CORBA::Octet & TAO_Unbounded_Sequence<CORBA::Octet>::operator[] (CORBA::ULong i) { |