diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-05-16 12:36:32 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-05-16 12:36:32 +0000 |
commit | 6b9a34f450963770436c42b71459cd0fbc2bea10 (patch) | |
tree | 9fc1f64a9fd3b2de1a9070309997dd73e9ad6bde | |
parent | bd49e75038b39140be38ada832f3b03e2872681b (diff) | |
download | ATCD-6b9a34f450963770436c42b71459cd0fbc2bea10.tar.gz |
ChangeLogTag: Tue May 16 12:28:12 2006 UTC Johnny Willemsen <jwillemsen@remedy.nl>Fri May 12 11:26:12 2006 UTC Johnny Willemsen <jwillemsen@remedy.nl>Mon May 15 12:58:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>Tue May 16 12:10:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | TAO/ChangeLog | 21 | ||||
-rw-r--r-- | TAO/tao/Asynch_Queued_Message.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Generator_Parser_10.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_State.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.cpp | 3 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Object.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PolicyS_T.h | 34 | ||||
-rw-r--r-- | TAO/tao/Profile.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Acceptor.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Endpoint.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Synch_Queued_Message.cpp | 2 |
12 files changed, 68 insertions, 47 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index e7095ea6f50..225b96e9edc 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,24 @@ +Tue May 16 12:36:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/Asynch_Queued_Message.cpp: + * tao/Synch_Queued_Message.cpp: + * tao/GIOP_Message_Generator_Parser_10.cpp: + * tao/Object.cpp: + * tao/Profile.cpp: + * tao/IIOP_Profile.cpp: + * tao/Strategies/DIOP_Acceptor.cpp: + * tao/Strategies/DIOP_Endpoint.cpp: + Const improvements + + * tao/GIOP_Message_State.cpp: + Improved error message when the GIOP header can't be parsed + + * tao/ORB.cpp: + Initialise pointer with 0. + + * tao/PortableServer/PolicyS_T.h: + Use true instead of 1 + Tue May 16 05:22:15 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com> * tao/IIOP_Connector.cpp: diff --git a/TAO/tao/Asynch_Queued_Message.cpp b/TAO/tao/Asynch_Queued_Message.cpp index 212dd6ef809..7c6ec5020e8 100644 --- a/TAO/tao/Asynch_Queued_Message.cpp +++ b/TAO/tao/Asynch_Queued_Message.cpp @@ -87,7 +87,7 @@ TAO_Asynch_Queued_Message::bytes_transferred (size_t &byte_count) { this->state_changed_i (TAO_LF_Event::LFS_ACTIVE); - size_t remaining_bytes = this->size_ - this->offset_; + size_t const remaining_bytes = this->size_ - this->offset_; if (byte_count > remaining_bytes) { this->offset_ = this->size_; @@ -113,7 +113,7 @@ TAO_Asynch_Queued_Message::clone (ACE_Allocator *alloc) // Just allocate and copy data that needs to be sent, no point // copying the whole buffer. - const size_t sz = this->size_ - this->offset_; + size_t const sz = this->size_ - this->offset_; ACE_NEW_RETURN (buf, char[sz], diff --git a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp index f6d10cd7c2d..831b4e1b419 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp +++ b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp @@ -31,7 +31,7 @@ TAO_GIOP_Message_Generator_Parser_10::write_request_header ( // The request ID msg << opdetails.request_id (); - const CORBA::Octet response_flags = opdetails.response_flags (); + CORBA::Octet const response_flags = opdetails.response_flags (); // Write the response flags if (response_flags == TAO_TWOWAY_RESPONSE_FLAG) @@ -206,7 +206,7 @@ TAO_GIOP_Message_Generator_Parser_10::write_reply_header ( // @@ Much of this code is GIOP 1.1 specific and should be ptrdiff_t target = reply.dsi_nvlist_align_; - ptrdiff_t current = + ptrdiff_t const current = ptrdiff_t (output.current_alignment ()) % ACE_CDR::MAX_ALIGNMENT; CORBA::ULong pad = 0; @@ -418,7 +418,7 @@ TAO_GIOP_Message_Generator_Parser_10::parse_locate_header ( // Get the stream TAO_InputCDR &msg = request.incoming_stream (); - CORBA::Boolean hdr_status = 1; + CORBA::Boolean hdr_status = true; // Get the request id CORBA::ULong req_id = 0; diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp index 6f30b76136b..19f591b623c 100644 --- a/TAO/tao/GIOP_Message_State.cpp +++ b/TAO/tao/GIOP_Message_State.cpp @@ -114,8 +114,10 @@ TAO_GIOP_Message_State::parse_magic_bytes (char *buf) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - bad header, ") - ACE_TEXT ("magic word [%2.2x,%2.2x,%2.2x,%2.2x]\n"), + ACE_TEXT ("TAO (%P|%t) - ") + ACE_TEXT ("TAO_GIOP_Message_State::parse_magic_bytes, ") + ACE_TEXT ("bad header: ") + ACE_TEXT ("magic word [%02x,%02x,%02x,%02x]\n"), buf[0], buf[1], buf[2], @@ -230,7 +232,7 @@ TAO_GIOP_Message_State::get_payload_size (char *rd_ptr) } CORBA::ULong -TAO_GIOP_Message_State::read_ulong (const char *rd_ptr) const +TAO_GIOP_Message_State::read_ulong (const char *rd_ptr) const { CORBA::ULong x = 0; diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 4866b52a071..ac27fdfe4d0 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -109,7 +109,8 @@ TAO_IIOP_Profile::decode_profile (TAO_InputCDR& cdr) this->endpoint_.object_addr_.set_type (-1); const char* csv = this->orb_core()->orb_params()->preferred_interfaces(); - bool enforce = this->orb_core()->orb_params()->enforce_pref_interfaces(); + bool const enforce = + this->orb_core()->orb_params()->enforce_pref_interfaces(); this->count_ += this->endpoint_.preferred_interfaces(csv, enforce); return 1; diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index e25baaaa44a..e5aa29cd973 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1633,7 +1633,7 @@ CORBA::ORB::object_to_string (CORBA::Object_ptr obj const size_t total_len = cdr.total_length (); - char *cp; + char *cp = 0; ACE_ALLOCATOR_RETURN (cp, CORBA::string_alloc ( sizeof ior_prefix diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index e39e2e473a3..10c82a06df8 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -132,10 +132,10 @@ CORBA::Object::_remove_ref (void) mon, *this->refcount_lock_); - this->refcount_--; + this->refcount_--; - if (this->refcount_ != 0) - return; + if (this->refcount_ != 0) + return; } ACE_ASSERT (this->refcount_ == 0); @@ -732,7 +732,7 @@ operator<< (TAO_OutputCDR& cdr, const CORBA::Object* x) /*static*/ void CORBA::Object::tao_object_initialize (CORBA::Object *obj) { - CORBA::ULong profile_count = + CORBA::ULong const profile_count = obj->ior_->profiles.length (); // Assumption is that after calling this method, folks should test diff --git a/TAO/tao/PortableServer/PolicyS_T.h b/TAO/tao/PortableServer/PolicyS_T.h index f4ef428808e..6bf094e5c33 100644 --- a/TAO/tao/PortableServer/PolicyS_T.h +++ b/TAO/tao/PortableServer/PolicyS_T.h @@ -41,15 +41,15 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -// TAO_IDL - Generated from +// TAO_IDL - Generated from // be\be_visitor_root/root_sth.cpp:116 namespace POA_CORBA { - + // TAO_IDL - Generated from // be\be_visitor_interface/tie_sh.cpp:87 - + // TIE class: Refer to CORBA v2.2, Section 20.34.4 template <class T> class Policy_tie : public Policy @@ -59,76 +59,76 @@ namespace POA_CORBA // the T& ctor Policy_tie (T &t, PortableServer::POA_ptr poa); // ctor taking a POA - Policy_tie (T *tp, CORBA::Boolean release = 1); + Policy_tie (T *tp, CORBA::Boolean release = true); // ctor taking pointer and an ownership flag Policy_tie ( T *tp, PortableServer::POA_ptr poa, - CORBA::Boolean release = 1 + CORBA::Boolean release = true ); // ctor with T*, ownership flag and a POA ~Policy_tie (void); // dtor - + // TIE specific functions T *_tied_object (void); // return the underlying object void _tied_object (T &obj); // set the underlying object - void _tied_object (T *obj, CORBA::Boolean release = 1); + void _tied_object (T *obj, CORBA::Boolean release = true); // set the underlying object and the ownership flag CORBA::Boolean _is_owner (void); // do we own it void _is_owner (CORBA::Boolean b); // set the ownership - + // overridden ServantBase operations PortableServer::POA_ptr _default_POA ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ); - + // TAO_IDL - Generated from // be\be_visitor_operation/tie_sh.cpp:60 - + CORBA::PolicyType policy_type ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( CORBA::SystemException )); - + // TAO_IDL - Generated from // be\be_visitor_operation/tie_sh.cpp:60 - + ::CORBA::Policy_ptr copy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( CORBA::SystemException )); - + // TAO_IDL - Generated from // be\be_visitor_operation/tie_sh.cpp:60 - + void destroy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( CORBA::SystemException )); - + private: T *ptr_; PortableServer::POA_var poa_; CORBA::Boolean rel_; - + // copy and assignment are not allowed Policy_tie (const Policy_tie &); void operator= (const Policy_tie &); }; } // module CORBA -// TAO_IDL - Generated from +// TAO_IDL - Generated from // be\be_codegen.cpp:1096 TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp index 5ebffa48a07..0e9f6403f7f 100644 --- a/TAO/tao/Profile.cpp +++ b/TAO/tao/Profile.cpp @@ -25,7 +25,6 @@ ACE_RCSID (tao, Profile, "$Id$") - // **************************************************************** TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -166,7 +165,6 @@ TAO_Profile::encode (TAO_OutputCDR &stream) const this->create_profile_body (encap); // write the encapsulation as an octet sequence... - stream << CORBA::ULong (encap.total_length ()); stream.write_octet_array_mb (encap.begin ()); @@ -176,7 +174,7 @@ TAO_Profile::encode (TAO_OutputCDR &stream) const int TAO_Profile::decode (TAO_InputCDR& cdr) { - size_t encap_len = cdr.length (); + size_t const encap_len = cdr.length (); // Read and verify major, minor versions, ignoring profiles // whose versions we don't understand. @@ -290,7 +288,7 @@ TAO_Profile::create_tagged_profile (void) // Create the profile body this->create_profile_body (encap); - CORBA::ULong length = + CORBA::ULong const length = static_cast <CORBA::ULong> (encap.total_length ()); #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) @@ -319,7 +317,7 @@ TAO_Profile::create_tagged_profile (void) void TAO_Profile::set_tagged_components (TAO_OutputCDR &out_cdr) { - CORBA::ULong length = static_cast <CORBA::ULong> (out_cdr.total_length ()); + CORBA::ULong const length = static_cast <CORBA::ULong> (out_cdr.total_length ()); IOP::TaggedComponent tagged_component; tagged_component.tag = TAO_TAG_ENDPOINTS; @@ -331,7 +329,7 @@ TAO_Profile::set_tagged_components (TAO_OutputCDR &out_cdr) iterator != 0; iterator = iterator->cont ()) { - size_t i_length = iterator->length (); + size_t const i_length = iterator->length (); ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length); buf += i_length; @@ -418,7 +416,7 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list iterator != 0; iterator = iterator->cont ()) { - size_t i_length = iterator->length (); + size_t const i_length = iterator->length (); ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length); buf += i_length; @@ -427,7 +425,7 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list // Eventually we add the TaggedComponent to the TAO_TaggedComponents // member variable. tagged_components_.set_component (tagged_component); - this->are_policies_parsed_ = 1; + this->are_policies_parsed_ = true; #else /* TAO_HAS_CORBA_MESSAGING == 1 */ @@ -484,7 +482,7 @@ TAO_Profile::get_policies (CORBA::PolicyList& pl // and we convert those into the proper CORBA::Policy CORBA::Policy_var policy; - CORBA::ULong length = policy_value_seq.length (); + CORBA::ULong const length = policy_value_seq.length (); // Set the policy list length. pl.length (length); @@ -507,7 +505,6 @@ TAO_Profile::get_policies (CORBA::PolicyList& pl reinterpret_cast <const char*> (buf), policy_value_seq[i].pvalue.length ()); - if (!(in_cdr >> ACE_InputCDR::to_boolean (byte_order))) ACE_TRY_THROW (CORBA::INV_OBJREF ()); @@ -944,7 +941,7 @@ TAO_Unknown_Profile::create_profile_body (TAO_OutputCDR &) const CORBA::Boolean operator<< (TAO_OutputCDR& cdr, const TAO_opaque& x) { - CORBA::ULong length = x.length (); + CORBA::ULong const length = x.length (); cdr.write_ulong (length); #if (TAO_NO_COPY_OCTET_SEQUENCES == 1) diff --git a/TAO/tao/Strategies/DIOP_Acceptor.cpp b/TAO/tao/Strategies/DIOP_Acceptor.cpp index 2e527cea8ec..b0dfb89101a 100644 --- a/TAO/tao/Strategies/DIOP_Acceptor.cpp +++ b/TAO/tao/Strategies/DIOP_Acceptor.cpp @@ -84,7 +84,7 @@ TAO_DIOP_Acceptor::create_new_profile (const TAO::ObjectKey &object_key, CORBA::Short priority) { // Adding this->endpoint_count_ to the TAO_MProfile. - int count = mprofile.profile_count (); + int const count = mprofile.profile_count (); if ((mprofile.size () - count) < this->endpoint_count_ && mprofile.grow (count + this->endpoint_count_) == -1) return -1; @@ -399,7 +399,7 @@ TAO_DIOP_Acceptor::open_i (const ACE_INET_Addr& addr, this->connection_handler_->open_server (); // Register only with a valid handle - int result = + int const result = reactor->register_handler (this->connection_handler_, ACE_Event_Handler::READ_MASK); if (result == -1) @@ -426,7 +426,7 @@ TAO_DIOP_Acceptor::open_i (const ACE_INET_Addr& addr, // interface then the endpoint created on each interface will be on // the same port. This is how a wildcard socket bind() is supposed // to work. - u_short port = address.get_port_number (); + u_short const port = address.get_port_number (); for (size_t j = 0; j < this->endpoint_count_; ++j) this->addrs_[j].set_port_number (port, 1); diff --git a/TAO/tao/Strategies/DIOP_Endpoint.cpp b/TAO/tao/Strategies/DIOP_Endpoint.cpp index 43657b6d783..922e355cc28 100644 --- a/TAO/tao/Strategies/DIOP_Endpoint.cpp +++ b/TAO/tao/Strategies/DIOP_Endpoint.cpp @@ -121,7 +121,7 @@ TAO_DIOP_Endpoint::set (const ACE_INET_Addr &addr, int TAO_DIOP_Endpoint::addr_to_string (char *buffer, size_t length) { - size_t actual_len = + size_t const actual_len = ACE_OS::strlen (this->host_.in ()) // chars in host name + sizeof (':') // delimiter + ACE_OS::strlen ("65536") // max port diff --git a/TAO/tao/Synch_Queued_Message.cpp b/TAO/tao/Synch_Queued_Message.cpp index a991a38dda9..59fecb37311 100644 --- a/TAO/tao/Synch_Queued_Message.cpp +++ b/TAO/tao/Synch_Queued_Message.cpp @@ -85,7 +85,7 @@ TAO_Synch_Queued_Message::bytes_transferred (size_t &byte_count) while (this->current_block_ != 0 && byte_count > 0) { - size_t l = this->current_block_->length (); + size_t const l = this->current_block_->length (); if (byte_count < l) { |