diff options
52 files changed, 1062 insertions, 882 deletions
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp index c85dc46abec..5d262e6f616 100644 --- a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp +++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (TAO_AV_ENDPOINT_STRATEGY_T_C) +#ifndef TAO_AV_ENDPOINT_STRATEGY_T_C #define TAO_AV_ENDPOINT_STRATEGY_T_C #include "Endpoint_Strategy_T.h" @@ -31,10 +31,10 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ this->activate_stream_endpoint (TAO_TRY_ENV); TAO_CHECK_ENV; ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated stream_endpoint\n")); - + this->activate_vdev (TAO_TRY_ENV); TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated vdev\n")); + ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated vdev\n")); this->activate_mediactrl (TAO_TRY_ENV); TAO_CHECK_ENV; @@ -91,13 +91,13 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activate_mediactrl , media_ctrl ior is :%s\n", mediactrl_ior.in ())); - + // Associate the media controller object reference with the vdev, as per the OMG spec CORBA::Any anyval; anyval <<= this->orb_manager_->orb ()->object_to_string (media_ctrl->_this (env), env); TAO_CHECK_ENV_RETURN (env, -1); - + this->vdev_->define_property ("Related_MediaCtrl", anyval, env); @@ -112,7 +112,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_stream_endpoint (T_StreamEndpoint *&stream_endpoint) { - ACE_NEW_RETURN (stream_endpoint, + ACE_NEW_RETURN (stream_endpoint, T_StreamEndpoint, -1); @@ -124,7 +124,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_vdev (T_VDev *&vdev) { - ACE_NEW_RETURN (vdev, + ACE_NEW_RETURN (vdev, T_VDev, -1); return 0; @@ -135,7 +135,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_mediactrl (T_MediaCtrl *&media_ctrl) { - ACE_NEW_RETURN (media_ctrl, + ACE_NEW_RETURN (media_ctrl, T_MediaCtrl, -1); return 0; @@ -169,14 +169,14 @@ TAO_AV_Endpoint_Reactive_Strategy_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::crea CORBA::Environment &env) { if (this->activate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_A: Error in activate ()\n"), -1); - + stream_endpoint = this->stream_endpoint_a_; vdev = this->vdev_; return 0; - + } // Put the stream_endpoint into the POA @@ -189,11 +189,11 @@ TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::act // Use the bridge method if (this->make_stream_endpoint (stream_endpoint_a) == -1) return -1; - + CORBA::String_var stream_endpoint_ior = this->orb_manager_->activate (stream_endpoint_a, env); TAO_CHECK_ENV_RETURN (env, -1); - ACE_DEBUG ((LM_DEBUG,"TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint,Stream Endpoint ior is : %s\n",stream_endpoint_ior.in ())); + ACE_DEBUG ((LM_DEBUG,"TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint,Stream Endpoint ior is : %s\n",stream_endpoint_ior.in ())); // Save the object references, so that create_a can return them this->stream_endpoint_a_ = stream_endpoint_a->_this (env); @@ -231,7 +231,7 @@ TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::act CORBA::String_var stream_endpoint_ior = this->orb_manager_->activate (stream_endpoint_b, env); TAO_CHECK_ENV_RETURN (env, -1); - ACE_DEBUG ((LM_DEBUG,"TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint,Stream Endpoint ior is : %s\n",stream_endpoint_ior.in ())); + ACE_DEBUG ((LM_DEBUG,"TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint,Stream Endpoint ior is : %s\n",stream_endpoint_ior.in ())); this->stream_endpoint_b_ = stream_endpoint_b->_this (env); TAO_CHECK_ENV_RETURN (env, -1); @@ -247,14 +247,14 @@ TAO_AV_Endpoint_Reactive_Strategy_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::crea CORBA::Environment &env) { if (this->activate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_B: Error in activate ()\n"), -1); - + stream_endpoint = this->stream_endpoint_b_; vdev = this->vdev_; return 0; - + } // ---------------------------------------------------------------------- @@ -311,14 +311,14 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc, ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) Error releasing semaphores\n"), -1); - + return 0; } // initializes the orb, and activates the objects template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int -TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects (int argc, +TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects (int argc, char **argv, CORBA::Environment &env) { @@ -331,7 +331,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects // bridge method to make a new stream endpoint if (this->make_stream_endpoint (this->stream_endpoint_) == -1) return -1; - + // bridge method to make a new vdev if (this->make_vdev (this->vdev_) == -1) return -1; @@ -388,7 +388,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::bind_to_naming_se template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (CORBA::Environment &env) -{ +{ char vdev_name [BUFSIZ]; ACE_OS::sprintf (vdev_name, "%s:%s:%d", @@ -409,12 +409,12 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (CO media_ctrl_property, env); TAO_CHECK_ENV_RETURN (env,-1); - + // Register the vdev with the naming server. this->naming_context_->bind (this->vdev_name_, this->vdev_->_this (env), env); - + // If the object was already there, replace the older reference // with this one if (env.exception () != 0) @@ -425,7 +425,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (CO env); TAO_CHECK_ENV_RETURN (env, -1); } - + return 0; } @@ -470,14 +470,14 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::release_semapho ACE_Process_Semaphore semaphore (0, // 0 means that the semaphore is // initially locked sem_str); - + if (semaphore.release () == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) Error releasing semaphore %s: %p\n", sem_str, "semaphore.release ()"), -1); - + return 0; } @@ -485,7 +485,7 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::release_semapho template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_endpoint (CORBA::Environment &env) -{ +{ // ACE_DEBUG ((LM_DEBUG, "(%P|%t) %s:%d\n", __FILE__, __LINE__)); // Create a name for the video control object // subclasses can define their own name for the streamendpoint @@ -493,7 +493,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_e this->naming_context_->bind (this->stream_endpoint_name_, this->stream_endpoint_->_this (env), env); - + // if the name was already there, replace the reference with the new one if (env.exception () != 0) { @@ -512,7 +512,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_stream_endpoint (T_StreamEndpoint *&stream_endpoint) { - ACE_NEW_RETURN (stream_endpoint, + ACE_NEW_RETURN (stream_endpoint, T_StreamEndpoint, -1); return 0; @@ -523,7 +523,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> int TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_vdev (T_VDev *&vdev) { - ACE_NEW_RETURN (vdev, + ACE_NEW_RETURN (vdev, T_VDev, -1); return 0; @@ -535,7 +535,7 @@ int TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_mediactrl (T_MediaCtrl *&media_ctrl) { ACE_DEBUG ((LM_DEBUG,"(%P|%t) TAO_AV_Child_Process::make_mediactrl ()\n")); - ACE_NEW_RETURN (media_ctrl, + ACE_NEW_RETURN (media_ctrl, T_MediaCtrl, -1); return 0; @@ -565,13 +565,13 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Pro TAO_CATCHANY { TAO_TRY_ENV.print_exception ("TAO_Endpoint_Process_Strategy::activate"); - } + } TAO_ENDTRY; - + // if (this->stream_endpoint_ != 0) // delete this->stream_endpoint_; -// if (this->vdev_ != 0) -// delete this->vdev_; +// if (this->vdev_ != 0) +// delete this->vdev_; // if (this->media_ctrl_ != 0) // delete this->media_ctrl_; } @@ -584,7 +584,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Pro // the naming service template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> TAO_AV_Child_Process_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process_A () -{ +{ char stream_endpoint_name[BUFSIZ]; ACE_OS::sprintf (stream_endpoint_name, "%s:%s:%d", @@ -610,7 +610,7 @@ TAO_AV_Child_Process_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_P // the naming service template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl> TAO_AV_Child_Process_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process_B () -{ +{ char stream_endpoint_name[BUFSIZ]; ACE_OS::sprintf (stream_endpoint_name, "%s:%s:%d", @@ -628,4 +628,4 @@ TAO_AV_Child_Process_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_P { } -#endif /*TAO_AV_ENDPOINT_STRATEGY_T_C */ +#endif /* TAO_AV_ENDPOINT_STRATEGY_T_C */ diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp index 07f01c66d4f..3ae7c92ba74 100644 --- a/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp @@ -13,7 +13,7 @@ // Irfan Pyarali <irfan@cs.wustl.edu> // ============================================================================ -#if !defined (TAO_OFFER_ITERATORS_T_C) +#ifndef TAO_OFFER_ITERATORS_T_C #define TAO_OFFER_ITERATORS_T_C #include "Offer_Iterators_T.h" diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp index 936adb1bb3a..b9b554bde36 100644 --- a/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp @@ -1,9 +1,9 @@ // ============================================================================ // $Id$ -// +// // = LIBRARY // orbsvcs -// +// // = FILENAME // Trader.cpp // @@ -11,10 +11,10 @@ // Marina Spivak <marina@cs.wustl.edu> // Seth Widoff <sbw1@cs.wustl.edu> // Irfan Pyarali <irfan@cs.wustl.edu> -// +// // ============================================================================ -#if !defined (TAO_TRADER_C) +#ifndef TAO_TRADER_C #define TAO_TRADER_C #include "Trader_T.h" @@ -26,14 +26,14 @@ ACE_RCSID(Trader, Trader_T, "$Id$") // TAO_Trader // ************************************************************* -template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> +template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>:: TAO_Trader (TAO_Trader_Base::Trader_Components components) { CORBA::Environment env; for (int i = LOOKUP_IF; i <= LINK_IF; i++) this->ifs_[i] = 0; - + if (ACE_BIT_ENABLED (components, LOOKUP)) { TAO_Lookup<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* lookup = @@ -65,13 +65,13 @@ TAO_Trader (TAO_Trader_Base::Trader_Components components) if (ACE_BIT_ENABLED (components, LINK)) { TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* link = - new TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE> (*this); + new TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE> (*this); this->trading_components ().link_if (link->_this (env)); this->ifs_[LINK_IF] = link; } } -template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> +template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::~TAO_Trader (void) { // Remove Trading Components from POA @@ -83,30 +83,30 @@ TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::~TAO_Trader (void) for (int i = LOOKUP_IF; i <= LINK_IF; i++) { if (this->ifs_[i] != 0) - { - TAO_TRY - { - PortableServer::POA_var poa = - this->ifs_[i]->_default_POA (TAO_TRY_ENV); - TAO_CHECK_ENV; - PortableServer::ObjectId_var id = - poa->servant_to_id (this->ifs_[i], TAO_TRY_ENV); - TAO_CHECK_ENV; - poa->deactivate_object (id.in (), TAO_TRY_ENV); - } - TAO_CATCHANY - { - } - TAO_ENDTRY; - - delete this->ifs_[i]; - } + { + TAO_TRY + { + PortableServer::POA_var poa = + this->ifs_[i]->_default_POA (TAO_TRY_ENV); + TAO_CHECK_ENV; + PortableServer::ObjectId_var id = + poa->servant_to_id (this->ifs_[i], TAO_TRY_ENV); + TAO_CHECK_ENV; + poa->deactivate_object (id.in (), TAO_TRY_ENV); + } + TAO_CATCHANY + { + } + TAO_ENDTRY; + + delete this->ifs_[i]; + } } } template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> TAO_Offer_Database<MAP_LOCK_TYPE>& -TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::offer_database (void) +TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::offer_database (void) { return this->offer_database_; } @@ -123,7 +123,7 @@ TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::lock (void) template <class IF> TAO_Trader_Components<IF>:: -TAO_Trader_Components (const TAO_Trading_Components_i& comps) +TAO_Trader_Components (const TAO_Trading_Components_i& comps) : comps_ (comps) { } @@ -157,131 +157,131 @@ TAO_Trader_Components<IF>::proxy_if (CORBA::Environment& _env) } template <class IF> CosTrading::Link_ptr -TAO_Trader_Components<IF>::link_if (CORBA::Environment& _env) +TAO_Trader_Components<IF>::link_if (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return CosTrading::Link::_duplicate (this->comps_.link_if ()); } -template <class IF> +template <class IF> TAO_Support_Attributes<IF>:: -TAO_Support_Attributes (const TAO_Support_Attributes_i& attrs) +TAO_Support_Attributes (const TAO_Support_Attributes_i& attrs) : attrs_ (attrs) { } -template <class IF> CORBA::Boolean +template <class IF> CORBA::Boolean TAO_Support_Attributes<IF>::supports_modifiable_properties (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.supports_modifiable_properties (); } -template <class IF> CORBA::Boolean +template <class IF> CORBA::Boolean TAO_Support_Attributes<IF>::supports_dynamic_properties (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.supports_dynamic_properties (); } -template <class IF> CORBA::Boolean +template <class IF> CORBA::Boolean TAO_Support_Attributes<IF>::supports_proxy_offers (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.supports_proxy_offers (); } -template <class IF> CosTrading::TypeRepository_ptr +template <class IF> CosTrading::TypeRepository_ptr TAO_Support_Attributes<IF>::type_repos (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return CosTrading::TypeRepository::_duplicate (this->attrs_.type_repos ()); } -template <class IF> +template <class IF> TAO_Import_Attributes<IF>:: TAO_Import_Attributes (const TAO_Import_Attributes_i& attrs) : attrs_ (attrs) { } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::def_search_card (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.def_search_card (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::max_search_card (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.max_search_card (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::def_match_card (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.def_match_card (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::max_match_card (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.max_match_card (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::def_return_card (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.def_return_card (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::max_return_card (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.max_return_card (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::max_list (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.max_list (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::def_hop_count (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.def_hop_count (); } -template <class IF> CORBA::ULong +template <class IF> CORBA::ULong TAO_Import_Attributes<IF>::max_hop_count (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.max_hop_count (); } -template <class IF> CosTrading::FollowOption +template <class IF> CosTrading::FollowOption TAO_Import_Attributes<IF>::def_follow_policy (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.def_follow_policy (); } -template <class IF> CosTrading::FollowOption +template <class IF> CosTrading::FollowOption TAO_Import_Attributes<IF>::max_follow_policy (CORBA::Environment& _env) TAO_THROW_SPEC ((CORBA::SystemException)) { return this->attrs_.max_follow_policy (); } -template <class IF> +template <class IF> TAO_Link_Attributes<IF>:: TAO_Link_Attributes (const TAO_Link_Attributes_i& attrs) : attrs_ (attrs) @@ -312,7 +312,7 @@ extract (const CORBA::Any& any_value, SEQ_TYPE *& seq) CORBA::TCKind kind_1 = TAO_Sequence_Extracter_Base::sequence_type (any_type.in (), TAO_TRY_ENV); TAO_CHECK_ENV; - + CORBA::TCKind kind_2 = TAO_Sequence_Extracter_Base::sequence_type (this->typecode_.in (), TAO_TRY_ENV); @@ -332,7 +332,7 @@ extract (const CORBA::Any& any_value, SEQ_TYPE *& seq) (stream.decode (this->typecode_.in (), seq, 0, TAO_TRY_ENV) == CORBA::TypeCode::TRAVERSE_CONTINUE); TAO_CHECK_ENV; - + if (decode_succeded) { CORBA::TypeCode_var type = any_value.type (); @@ -346,7 +346,7 @@ extract (const CORBA::Any& any_value, SEQ_TYPE *& seq) else delete seq; } - else + else { seq = (SEQ_TYPE*) any_value.value (); return_value = 1; @@ -358,8 +358,8 @@ extract (const CORBA::Any& any_value, SEQ_TYPE *& seq) if (seq != 0) delete seq; } - TAO_ENDTRY; - + TAO_ENDTRY; + return return_value; } @@ -374,10 +374,10 @@ TAO_find (const SEQ& sequence, const OPERAND_TYPE element) { OPERAND_TYPE sequence_element = sequence[i]; if (sequence_element == element) - { - return_value = 1; - break; - } + { + return_value = 1; + break; + } } return (CORBA::Boolean) return_value; diff --git a/TAO/tao/DynUnion_i_T.cpp b/TAO/tao/DynUnion_i_T.cpp index 05f13314d89..242e41b9d5b 100644 --- a/TAO/tao/DynUnion_i_T.cpp +++ b/TAO/tao/DynUnion_i_T.cpp @@ -13,7 +13,7 @@ // // ======================================================================== -#if !defined TAO_DYNUNION_I_T_C +#ifndef TAO_DYNUNION_I_T_C #define TAO_DYNUNION_I_T_C #include "tao/DynUnion_i_T.h" diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp index 34ca0ad9d28..2cc68c56d66 100644 --- a/TAO/tao/Sequence_T.cpp +++ b/TAO/tao/Sequence_T.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (TAO_SEQUENCE_T_C) +#ifndef TAO_SEQUENCE_T_C #define TAO_SEQUENCE_T_C #include "tao/Sequence_T.h" @@ -372,11 +372,11 @@ TAO_Unbounded_Object_Sequence<T>::_shrink_buffer (CORBA::ULong nl, template <class T> void TAO_Unbounded_Object_Sequence<T>::_downcast (void* target, - CORBA_Object* src, - CORBA_Environment &env) + CORBA_Object* src, + CORBA_Environment &env) { T **tmp = ACE_static_cast (T**, target); - + *tmp = T::_narrow (src, env); } @@ -384,7 +384,7 @@ template <class T> CORBA_Object* TAO_Unbounded_Object_Sequence<T>::_upcast (void* src) const { T **tmp = ACE_static_cast (T**, src); - + return *tmp; } @@ -509,11 +509,11 @@ TAO_Bounded_Object_Sequence<T, MAX>::_shrink_buffer (CORBA::ULong nl, template <class T, CORBA::ULong MAX> void TAO_Bounded_Object_Sequence<T, MAX>::_downcast (void* target, - CORBA_Object* src, - CORBA_Environment &env) + CORBA_Object* src, + CORBA_Environment &env) { T **tmp = ACE_static_cast (T**, target); - + *tmp = T::_narrow (src, env); } @@ -521,7 +521,7 @@ template <class T, CORBA::ULong MAX> CORBA_Object* TAO_Bounded_Object_Sequence<T, MAX>::_upcast (void* src) const { T **tmp = ACE_static_cast (T**, src); - + return *tmp; } diff --git a/TAO/tao/poa_T.cpp b/TAO/tao/poa_T.cpp index 8bebdd971c2..9c669762f08 100644 --- a/TAO/tao/poa_T.cpp +++ b/TAO/tao/poa_T.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (POA_T_CPP) +#ifndef POA_T_CPP #define POA_T_CPP #include "tao/poa_T.h" diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index 1af27753cf7..26dfbf6229a 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -1,11 +1,16 @@ // Acceptor.cpp // $Id$ -#if !defined (ACE_ACCEPTOR_C) +#ifndef ACE_ACCEPTOR_C #define ACE_ACCEPTOR_C #define ACE_BUILD_DLL #include "ace/ACE.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Acceptor.h" #include "ace/Handle_Set.h" #include "ace/WFMO_Reactor.h" @@ -76,12 +81,12 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open reuse_addr) == -1) return -1; - int result = reactor->register_handler - (this, + int result = reactor->register_handler + (this, ACE_Event_Handler::ACCEPT_MASK); if (result != -1) this->reactor (reactor); - + return result; } @@ -300,7 +305,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::activate_svc_handler if (result == 0 && svc_handler->open ((void *) this) == -1) result = -1; - + if (result == -1) svc_handler->close (0); @@ -341,7 +346,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_input (ACE_HANDLE listene SVC_HANDLER *svc_handler = 0; if (this->make_svc_handler (svc_handler) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("make_svc_handler")), 0); @@ -1033,7 +1038,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_input (ACE_HANDLE reset_new_handle // reset new handle ) == -1) result = -1; - if (this->reactor () + if (this->reactor () && this->reactor ()->remove_handler (this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL) == -1) diff --git a/ace/Asynch_Acceptor.cpp b/ace/Asynch_Acceptor.cpp index af5fe26cd69..3f92569b94e 100644 --- a/ace/Asynch_Acceptor.cpp +++ b/ace/Asynch_Acceptor.cpp @@ -1,11 +1,15 @@ // $Id$ -#if !defined (ACE_ASYNCH_ACCEPTOR_C) +#ifndef ACE_ASYNCH_ACCEPTOR_C #define ACE_ASYNCH_ACCEPTOR_C #define ACE_BUILD_DLL #include "ace/Asynch_Acceptor.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Asynch_Acceptor, "$Id$") #if defined (ACE_WIN32) || defined (ACE_HAS_AIO_CALLS) @@ -38,11 +42,11 @@ ACE_Asynch_Acceptor<HANDLER>::~ACE_Asynch_Acceptor (void) template <class HANDLER> int ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, - size_t bytes_to_read, - int pass_addresses, - int backlog, - int reuse_addr, - ACE_Proactor *proactor, + size_t bytes_to_read, + int pass_addresses, + int backlog, + int reuse_addr, + ACE_Proactor *proactor, int validate_new_connection, int reissue_accept, int number_of_initial_accepts) @@ -60,9 +64,9 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, // Initialize the ACE_Asynch_Accept if (this->asynch_accept_.open (*this, - this->listen_handle_, - 0, - this->proactor ()) == -1) + this->listen_handle_, + 0, + this->proactor ()) == -1) ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Asynch_Accept::open")), -1); if (reuse_addr) @@ -70,11 +74,11 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, // Reuse the address int one = 1; if (ACE_OS::setsockopt (this->listen_handle_, - SOL_SOCKET, - SO_REUSEADDR, - (const char*) &one, - sizeof one) == -1) - ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_OS::setsockopt")), -1); + SOL_SOCKET, + SO_REUSEADDR, + (const char*) &one, + sizeof one) == -1) + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_OS::setsockopt")), -1); } // If port is not specified, bind to any port. @@ -85,9 +89,9 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, // Bind to the specified port. if (ACE_OS::bind (this->listen_handle_, - ACE_reinterpret_cast (sockaddr *, + ACE_reinterpret_cast (sockaddr *, address.get_addr ()), - address.get_size ()) == -1) + address.get_size ()) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_OS::bind"), @@ -121,9 +125,9 @@ ACE_Asynch_Acceptor<HANDLER>::set_handle (ACE_HANDLE listen_handle) // Reinitialize the ACE_Asynch_Accept if (this->asynch_accept_.open (*this, - this->listen_handle_, - 0, - this->proactor ()) == -1) + this->listen_handle_, + 0, + this->proactor ()) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Asynch_Accept::open"))); } @@ -144,7 +148,7 @@ ACE_Asynch_Acceptor<HANDLER>::accept (size_t bytes_to_read, const void *act) // Initiate asynchronous accepts if (this->asynch_accept_.accept (*message_block, - bytes_to_read, + bytes_to_read, ACE_INVALID_HANDLE, act) == -1) { @@ -288,8 +292,8 @@ ACE_Asynch_Acceptor<HANDLER>::cancel (void) template <class HANDLER> void ACE_Asynch_Acceptor<HANDLER>::parse_address (const ACE_Asynch_Accept::Result &result, - ACE_INET_Addr &remote_address, - ACE_INET_Addr &local_address) + ACE_INET_Addr &remote_address, + ACE_INET_Addr &local_address) { #if defined (ACE_HAS_AIO_CALLS) // Getting the addresses. @@ -355,13 +359,13 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (const int remote_size = 0; ::GetAcceptExSockaddrs (message_block.rd_ptr (), - message_block.size () - 2 * this->address_size (), - this->address_size (), - this->address_size (), - &local_addr, - &local_size, - &remote_addr, - &remote_size); + message_block.size () - 2 * this->address_size (), + this->address_size (), + this->address_size (), + &local_addr, + &local_size, + &remote_addr, + &remote_size); local_address.set_addr (ACE_reinterpret_cast (sockaddr_in *, local_addr), diff --git a/ace/Connector.cpp b/ace/Connector.cpp index b52d85e464f..cccd932ac52 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -1,12 +1,16 @@ // Connector.cpp // $Id$ -#if !defined (ACE_CONNECTOR_C) +#ifndef ACE_CONNECTOR_C #define ACE_CONNECTOR_C #define ACE_BUILD_DLL #include "ace/Connector.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Connector, "$Id$") // Shorthand names. @@ -59,7 +63,7 @@ ACE_Connector<SH, PR_CO_2>::activate_svc_handler (SVC_HANDLER *svc_handler) if (ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK) != 0) { if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1) - error = 1; + error = 1; } // Otherwise, make sure it's disabled by default. else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1) @@ -79,22 +83,22 @@ ACE_Connector<SH, PR_CO_2>::activate_svc_handler (SVC_HANDLER *svc_handler) template <class SH, PR_CO_1> int ACE_Connector<SH, PR_CO_2>::connect_svc_handler (SVC_HANDLER *&svc_handler, - const PR_AD &remote_addr, - ACE_Time_Value *timeout, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) + const PR_AD &remote_addr, + ACE_Time_Value *timeout, + const PR_AD &local_addr, + int reuse_addr, + int flags, + int perms) { ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::connect_svc_handler"); return this->connector_.connect (svc_handler->peer (), - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); + remote_addr, + timeout, + local_addr, + reuse_addr, + flags, + perms); } template <class SH, PR_CO_1> int @@ -116,9 +120,9 @@ ACE_Connector<SH, PR_CO_2>::ACE_Connector (ACE_Reactor *r, int flags) template <class SH> ACE_Svc_Tuple<SH>::ACE_Svc_Tuple (SVC_HANDLER *sh, - ACE_HANDLE handle, - const void *arg, - long id) + ACE_HANDLE handle, + const void *arg, + long id) : svc_handler_ (sh), handle_ (handle), arg_ (arg), @@ -194,13 +198,13 @@ ACE_Svc_Tuple<SH>::dump (void) const template <class SH, PR_CO_1> int ACE_Connector<SH, PR_CO_2>::handle_timeout (const ACE_Time_Value &tv, - const void *arg) + const void *arg) { ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::handle_timeout"); AST *ast = 0; if (this->cleanup_AST (((AST *) arg)->handle (), - ast) == -1) + ast) == -1) return -1; else { @@ -215,7 +219,7 @@ ACE_Connector<SH, PR_CO_2>::handle_timeout (const ACE_Time_Value &tv, // SVC_HANDLER an opportunity to take corrective action (e.g., // wait a few milliseconds and try to reconnect again. if (sh->handle_timeout (tv, ast->arg ()) == -1) - sh->handle_close (sh->get_handle (), ACE_Event_Handler::TIMER_MASK); + sh->handle_close (sh->get_handle (), ACE_Event_Handler::TIMER_MASK); delete ast; return 0; @@ -224,7 +228,7 @@ ACE_Connector<SH, PR_CO_2>::handle_timeout (const ACE_Time_Value &tv, template <class SH, PR_CO_1> int ACE_Connector<SH, PR_CO_2>::cleanup_AST (ACE_HANDLE handle, - ACE_Svc_Tuple<SH> *&ast) + ACE_Svc_Tuple<SH> *&ast) { ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::cleanup_AST"); @@ -235,7 +239,7 @@ ACE_Connector<SH, PR_CO_2>::cleanup_AST (ACE_HANDLE handle, // Error, entry not found in map. errno = ENOENT; ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p %d not found in map\n"), - ASYS_TEXT ("find"), handle), -1); + ASYS_TEXT ("find"), handle), -1); } // Try to remove from ACE_Timer_Queue but if it's not there we @@ -327,12 +331,12 @@ ACE_Connector<SH, PR_CO_2>::handle_exception (ACE_HANDLE h) template <class SH, PR_CO_1> int ACE_Connector<SH, PR_CO_2>::connect (SH *&sh, - const PR_AD &remote_addr, - const ACE_Synch_Options &synch_options, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) + const PR_AD &remote_addr, + const ACE_Synch_Options &synch_options, + const PR_AD &local_addr, + int reuse_addr, + int flags, + int perms) { ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::connect"); @@ -353,37 +357,37 @@ ACE_Connector<SH, PR_CO_2>::connect (SH *&sh, // Delegate to connection strategy. if (this->connect_svc_handler (new_sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) + remote_addr, + timeout, + local_addr, + reuse_addr, + flags, + perms) == -1) { if (use_reactor && errno == EWOULDBLOCK) - { - // If the connection hasn't completed and we are using - // non-blocking semantics then register ourselves with the - // ACE_Reactor so that it will call us back when the - // connection is complete or we timeout, whichever comes - // first... Note that we needn't check the return value - // here because if something goes wrong that will reset - // errno this will be detected by the caller (since -1 is - // being returned...). + { + // If the connection hasn't completed and we are using + // non-blocking semantics then register ourselves with the + // ACE_Reactor so that it will call us back when the + // connection is complete or we timeout, whichever comes + // first... Note that we needn't check the return value + // here because if something goes wrong that will reset + // errno this will be detected by the caller (since -1 is + // being returned...). sh = new_sh; - this->create_AST (sh, synch_options); - } + this->create_AST (sh, synch_options); + } else - { - // Make sure to save/restore the errno since <close> may - // change it. - - int error = errno; - // Make sure to close down the Channel to avoid descriptor - // leaks. - new_sh->close (0); - errno = error; - } + { + // Make sure to save/restore the errno since <close> may + // change it. + + int error = errno; + // Make sure to close down the Channel to avoid descriptor + // leaks. + new_sh->close (0); + errno = error; + } return -1; } else @@ -398,10 +402,10 @@ ACE_Connector<SH, PR_CO_2>::connect (SH *&sh, template <class SH, PR_CO_1> int ACE_Connector<SH, PR_CO_2>::connect_n (size_t n, - SH *sh[], - PR_AD remote_addrs[], + SH *sh[], + PR_AD remote_addrs[], ASYS_TCHAR *failed_svc_handlers, - const ACE_Synch_Options &synch_options) + const ACE_Synch_Options &synch_options) { int result = 0; @@ -436,11 +440,11 @@ ACE_Connector<SH, PR_CO_2>::cancel (SH *sh) mi.advance ()) if (me->int_id_->svc_handler () == sh) { - AST *ast = 0; - this->cleanup_AST (me->ext_id_, ast); - ACE_ASSERT (ast == me->int_id_); - delete ast; - return 0; + AST *ast = 0; + this->cleanup_AST (me->ext_id_, ast); + ACE_ASSERT (ast == me->int_id_); + delete ast; + return 0; } return -1; @@ -451,17 +455,17 @@ ACE_Connector<SH, PR_CO_2>::cancel (SH *sh) template <class SH, PR_CO_1> int ACE_Connector<SH, PR_CO_2>::create_AST (SH *sh, - const ACE_Synch_Options &synch_options) + const ACE_Synch_Options &synch_options) { int error = errno; ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::create_AST"); AST *ast; ACE_NEW_RETURN (ast, - AST (sh, - sh->get_handle (), - synch_options.arg (), -1), - -1); + AST (sh, + sh->get_handle (), + synch_options.arg (), -1), + -1); // Register this with the reactor for connection events. ACE_Reactor_Mask mask = ACE_Event_Handler::CONNECT_MASK; @@ -479,33 +483,33 @@ ACE_Connector<SH, PR_CO_2>::create_AST (SH *sh, ACE_Time_Value *tv = (ACE_Time_Value *) synch_options.time_value (); if (tv != 0) - { - int cancellation_id = - this->reactor ()->schedule_timer - (this, (const void *) ast, *tv); - if (cancellation_id == -1) - goto fail3; - - ast->cancellation_id (cancellation_id); - // Reset this because something might have gone wrong - // elsewhere... + { + int cancellation_id = + this->reactor ()->schedule_timer + (this, (const void *) ast, *tv); + if (cancellation_id == -1) + goto fail3; + + ast->cancellation_id (cancellation_id); + // Reset this because something might have gone wrong + // elsewhere... errno = error; - return 0; - } + return 0; + } else - { - // Reset this because something might have gone wrong - // elsewhere... + { + // Reset this because something might have gone wrong + // elsewhere... errno = error; // EWOULDBLOCK - return 0; // Ok, everything worked just fine... - } + return 0; // Ok, everything worked just fine... + } } // Undo previous actions using the ol' "goto label and fallthru" // trick... fail3: this->reactor ()->remove_handler (this, - mask | ACE_Event_Handler::DONT_CALL); + mask | ACE_Event_Handler::DONT_CALL); /* FALLTHRU */ fail2: this->handler_map_.unbind (sh->get_handle ()); @@ -553,21 +557,21 @@ ACE_Connector<SH, PR_CO_2>::handle_close (ACE_HANDLE, ACE_Reactor_Mask mask) // Iterate through the map and shut down all the pending handlers. for (MAP_ENTRY *me = 0; - mi.next (me) != 0; - mi.advance ()) - { - this->reactor ()->remove_handler (me->ext_id_, - mask | ACE_Event_Handler::DONT_CALL); + mi.next (me) != 0; + mi.advance ()) + { + this->reactor ()->remove_handler (me->ext_id_, + mask | ACE_Event_Handler::DONT_CALL); - AST *ast = 0; - this->cleanup_AST (me->ext_id_, ast); + AST *ast = 0; + this->cleanup_AST (me->ext_id_, ast); - // Close the svc_handler - ACE_ASSERT (ast == me->int_id_); - me->int_id_->svc_handler ()->close (0); + // Close the svc_handler + ACE_ASSERT (ast == me->int_id_); + me->int_id_->svc_handler ()->close (0); - delete ast; - } + delete ast; + } } return 0; @@ -615,9 +619,9 @@ ACE_Connector<SH, PR_CO_2>::info (ASYS_TCHAR **strp, size_t length) const ASYS_TCHAR buf[BUFSIZ]; ACE_OS::sprintf (buf, - ASYS_TEXT ("%s\t %s"), - ASYS_TEXT ("ACE_Connector"), - ASYS_TEXT ("# connector factory\n")); + ASYS_TEXT ("%s\t %s"), + ASYS_TEXT ("ACE_Connector"), + ASYS_TEXT ("# connector factory\n")); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; @@ -791,12 +795,12 @@ ACE_Strategy_Connector<SH, PR_CO_2>::connect_svc_handler int perms) { return this->connect_strategy_->connect_svc_handler (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); + remote_addr, + timeout, + local_addr, + reuse_addr, + flags, + perms); } template <class SH, PR_CO_1> int diff --git a/ace/Containers_T.cpp b/ace/Containers_T.cpp index 87f5cc15706..44e94308c4e 100644 --- a/ace/Containers_T.cpp +++ b/ace/Containers_T.cpp @@ -1,11 +1,16 @@ // $Id$ -#if !defined (ACE_CONTAINERS_T_C) +#ifndef ACE_CONTAINERS_T_C #define ACE_CONTAINERS_T_C #define ACE_BUILD_DLL #include "ace/Malloc.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Containers.h" #if !defined (__ACE_INLINE__) @@ -2302,7 +2307,7 @@ ACE_Array<T>::get (T &item, size_t index) const return -1; } -template<class T> int +template<class T> int ACE_Array<T>::size (size_t new_size) { if (new_size >= this->max_size_) @@ -2310,7 +2315,7 @@ ACE_Array<T>::size (size_t new_size) // @@ We should use auto_ptr<>! T* tmp; ACE_NEW_RETURN (tmp, T[new_size], -1); - + for (size_t i = 0; i < this->cur_size_; ++i) tmp[i] = this->array_[i]; delete[] this->array_; diff --git a/ace/Dump_T.cpp b/ace/Dump_T.cpp index 5b826bc315a..97386d4ba31 100644 --- a/ace/Dump_T.cpp +++ b/ace/Dump_T.cpp @@ -1,11 +1,15 @@ // Dump_T.cpp // $Id$ -#if !defined (ACE_DUMP_T_C) +#ifndef ACE_DUMP_T_C #define ACE_DUMP_T_C #include "ace/Dump_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Dump_T, "$Id$") template <class Concrete> @@ -27,9 +31,9 @@ ACE_Dumpable_Adapter<Concrete>::operator->() const return (Concrete *) this->this_; } -template <class Concrete> void +template <class Concrete> void ACE_Dumpable_Adapter<Concrete>::dump (void) const -{ +{ ACE_TRACE ("ACE_Dumpable_Adapter<Concrete>::dump"); this->this_->dump (); } diff --git a/ace/Dynamic_Service.cpp b/ace/Dynamic_Service.cpp index 4685b8fb003..e102ec2cab3 100644 --- a/ace/Dynamic_Service.cpp +++ b/ace/Dynamic_Service.cpp @@ -1,11 +1,16 @@ // Dynamic_Service.cpp // $Id$ -#if !defined (ACE_DYNAMIC_SERVICE_C) +#ifndef ACE_DYNAMIC_SERVICE_C #define ACE_DYNAMIC_SERVICE_C #define ACE_BUILD_DLL #include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Service_Repository.h" #include "ace/Dynamic_Service.h" diff --git a/ace/Event_Handler_T.cpp b/ace/Event_Handler_T.cpp index 2fe65f1576e..7c02be558d6 100644 --- a/ace/Event_Handler_T.cpp +++ b/ace/Event_Handler_T.cpp @@ -1,12 +1,16 @@ // Event_Handler_T.cpp // $Id$ -#if !defined (EVENT_HANDLER_T_C) +#ifndef EVENT_HANDLER_T_C #define EVENT_HANDLER_T_C #define ACE_BUILD_DLL #include "ace/Event_Handler_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Event_Handler_T, "$Id$") #if defined (ACE_HAS_TEMPLATE_TYPEDEFS) @@ -33,14 +37,14 @@ ACE_Event_Handler_T<T>::~ACE_Event_Handler_T (void) template <class T> ACE_Event_Handler_T<T>::ACE_Event_Handler_T (T *op_handler, int delete_handler, - GET_HANDLE get_handle, - IO_HANDLER input_h, - CL_HANDLER close_h, - SIG_HANDLER sig_h, - TO_HANDLER timeout_h, - IO_HANDLER output_h, - SET_HANDLE set_handle, - IO_HANDLER except_h) + GET_HANDLE get_handle, + IO_HANDLER input_h, + CL_HANDLER close_h, + SIG_HANDLER sig_h, + TO_HANDLER timeout_h, + IO_HANDLER output_h, + SET_HANDLE set_handle, + IO_HANDLER except_h) : op_handler_ (op_handler), input_handler_ (input_h), output_handler_ (output_h), diff --git a/ace/Free_List.cpp b/ace/Free_List.cpp index 48bf98f7bdc..7bb41473bed 100644 --- a/ace/Free_List.cpp +++ b/ace/Free_List.cpp @@ -1,10 +1,14 @@ // $Id$ -#if !defined (ACE_FREE_LIST_C) +#ifndef ACE_FREE_LIST_C #define ACE_FREE_LIST_C #include "ace/Free_List.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Free_List.i" #endif /* __ACE_INLINE__ */ @@ -25,7 +29,7 @@ ACE_Free_List<T>::~ACE_Free_List (void) template <class T, class ACE_LOCK> ACE_Locked_Free_List<T, ACE_LOCK>::ACE_Locked_Free_List (int mode, - size_t prealloc, + size_t prealloc, size_t lwm, size_t hwm, size_t inc) @@ -47,9 +51,9 @@ ACE_Locked_Free_List<T, ACE_LOCK>::~ACE_Locked_Free_List (void) if (this->mode_ != ACE_PURE_FREE_LIST) while (this->free_list_ != 0) { - T *temp = this->free_list_; - this->free_list_ = this->free_list_->get_next (); - delete temp; + T *temp = this->free_list_; + this->free_list_ = this->free_list_->get_next (); + delete temp; } } diff --git a/ace/Functor_T.cpp b/ace/Functor_T.cpp index 98758932b5d..534edb64401 100644 --- a/ace/Functor_T.cpp +++ b/ace/Functor_T.cpp @@ -25,12 +25,16 @@ // // ============================================================================ -#if !defined (ACE_FUNCTOR_T_C) +#ifndef ACE_FUNCTOR_T_C #define ACE_FUNCTOR_T_C #define ACE_BUILD_DLL #include "ace/Functor_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Functor_T.i" #endif /* __ACE_INLINE__ */ @@ -59,5 +63,3 @@ ACE_Command_Callback<RECEIVER, ACTION>::execute (void *arg) #endif /* ACE_FUNCTOR_T_C */ - -// EOF diff --git a/ace/Future.cpp b/ace/Future.cpp index 41be67947d2..236b2d681bf 100644 --- a/ace/Future.cpp +++ b/ace/Future.cpp @@ -3,11 +3,15 @@ #define ACE_BUILD_DLL -#if !defined (ACE_FUTURE_CPP) +#ifndef ACE_FUTURE_CPP #define ACE_FUTURE_CPP #include "ace/Future.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Future, "$Id$") #if defined (ACE_HAS_THREADS) diff --git a/ace/Hash_Map_Manager.cpp b/ace/Hash_Map_Manager.cpp index 025a92f7b5c..ddd56223807 100644 --- a/ace/Hash_Map_Manager.cpp +++ b/ace/Hash_Map_Manager.cpp @@ -13,10 +13,15 @@ // // ============================================================================ -#if !defined (ACE_HASH_MAP_MANAGER_C) +#ifndef ACE_HASH_MAP_MANAGER_C #define ACE_HASH_MAP_MANAGER_C #include "ace/Hash_Map_Manager.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Service_Config.h" #include "ace/Malloc.h" diff --git a/ace/IOStream_T.cpp b/ace/IOStream_T.cpp index 5e5d2e896c7..a0b868a5513 100644 --- a/ace/IOStream_T.cpp +++ b/ace/IOStream_T.cpp @@ -1,12 +1,16 @@ // $Id$ -#if !defined (ACE_IOSTREAM_T_C) +#ifndef ACE_IOSTREAM_T_C #define ACE_IOSTREAM_T_C #define ACE_BUILD_DLL #include "ace/IOStream_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, IOStream_T, "$Id$") #if !defined (ACE_LACKS_ACE_IOSTREAM) @@ -70,7 +74,7 @@ ACE_IOStream<STREAM>::ACE_IOStream (STREAM &stream, STREAM (stream) { ACE_NEW (streambuf_, - ACE_Streambuf_T<STREAM> ((STREAM *) this, + ACE_Streambuf_T<STREAM> ((STREAM *) this, streambuf_size)); iostream::init (this->streambuf_); } @@ -80,7 +84,7 @@ ACE_IOStream<STREAM>::ACE_IOStream (u_int streambuf_size) : iostream (0) { ACE_NEW (this->streambuf_, - ACE_Streambuf_T<STREAM> ((STREAM *) this, + ACE_Streambuf_T<STREAM> ((STREAM *) this, streambuf_size)); iostream::init (this->streambuf_); } diff --git a/ace/IO_Cntl_Msg.cpp b/ace/IO_Cntl_Msg.cpp index 1986e517d0c..aa8281f63d4 100644 --- a/ace/IO_Cntl_Msg.cpp +++ b/ace/IO_Cntl_Msg.cpp @@ -13,7 +13,7 @@ template <class SYNCH> class ACE_Module; class ACE_Module_Link { // = TITLE - // Data structure used to link two modules together + // Data structure used to link two modules together // // = DESCRIPTION // @@ -21,18 +21,18 @@ public: ACE_Module_Link (ACE_Module *m1, ACE_Module *m2): mod_upper_ (m1), mod_lower_ (m2), count_ (0) {} ACE_Module *upper (void) { return this->mod_upper_; } - void upper (ACE_Module *u) { this->mod_upper_ = u; } - + void upper (ACE_Module *u) { this->mod_upper_ = u; } + ACE_Module *lower (void) { return this->mod_lower_; } void lower (ACE_Module *l) { this->mod_lower_ = l; } int count (void) { return this->count_; } - void count (int c) { this->count_ = c; } + void count (int c) { this->count_ = c; } private: ACE_Module *mod_upper_; ACE_Module *mod_lower_; - int count_; + int count_; }; -#endif +#endif diff --git a/ace/LOCK_SOCK_Acceptor.cpp b/ace/LOCK_SOCK_Acceptor.cpp index d9efd416a02..ff208366cae 100644 --- a/ace/LOCK_SOCK_Acceptor.cpp +++ b/ace/LOCK_SOCK_Acceptor.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (ACE_LOCK_SOCK_ACCEPTOR_CPP) +#ifndef ACE_LOCK_SOCK_ACCEPTOR_CPP #define ACE_LOCK_SOCK_ACCEPTOR_CPP #include /**/ "ace/Synch.h" @@ -16,11 +16,11 @@ ACE_LOCK_SOCK_Acceptor<ACE_LOCK>::accept (ACE_SOCK_Stream &stream, int reset_new_handle) const { ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, -1); - - return ACE_SOCK_Acceptor::accept (stream, - remote_address, - timeout, - restart, + + return ACE_SOCK_Acceptor::accept (stream, + remote_address, + timeout, + restart, reset_new_handle); } diff --git a/ace/Local_Name_Space_T.cpp b/ace/Local_Name_Space_T.cpp index b3af4a6b533..4513bf3a459 100644 --- a/ace/Local_Name_Space_T.cpp +++ b/ace/Local_Name_Space_T.cpp @@ -1,11 +1,16 @@ // Local_Name_Space_T.cpp // $Id$ -#if !defined (ACE_LOCAL_NAME_SPACE_T_C) +#ifndef ACE_LOCAL_NAME_SPACE_T_C #define ACE_LOCAL_NAME_SPACE_T_C #define ACE_BUILD_DLL #include "ace/ACE.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Local_Name_Space.h" ACE_RCSID(ace, Local_Name_Space_T, "$Id$") @@ -17,7 +22,7 @@ ACE_Name_Space_Map<ALLOCATOR>::ACE_Name_Space_Map (ALLOCATOR *alloc) ACE_TRACE ("ACE_Name_Space_Map::ACE_Name_Space_Map"); } -template <class ALLOCATOR> int +template <class ALLOCATOR> int ACE_Name_Space_Map<ALLOCATOR>::close (ALLOCATOR *alloc) { ACE_TRACE ("ACE_Name_Space_Map::close"); @@ -26,10 +31,10 @@ ACE_Name_Space_Map<ALLOCATOR>::close (ALLOCATOR *alloc) return this->close_i (); } -template <class ALLOCATOR> int +template <class ALLOCATOR> int ACE_Name_Space_Map<ALLOCATOR>::bind (const ACE_NS_String &ext_id, - const ACE_NS_Internal &int_id, - ALLOCATOR *alloc) + const ACE_NS_Internal &int_id, + ALLOCATOR *alloc) { ACE_TRACE ("ACE_Name_Space_Map::bind"); @@ -37,10 +42,10 @@ ACE_Name_Space_Map<ALLOCATOR>::bind (const ACE_NS_String &ext_id, return this->bind_i (ext_id, int_id); } -template <class ALLOCATOR> int -ACE_Name_Space_Map<ALLOCATOR>::unbind (const ACE_NS_String &ext_id, - ACE_NS_Internal &int_id, - ALLOCATOR *alloc) +template <class ALLOCATOR> int +ACE_Name_Space_Map<ALLOCATOR>::unbind (const ACE_NS_String &ext_id, + ACE_NS_Internal &int_id, + ALLOCATOR *alloc) { ACE_TRACE ("ACE_Name_Space_Map::unbind"); @@ -48,12 +53,12 @@ ACE_Name_Space_Map<ALLOCATOR>::unbind (const ACE_NS_String &ext_id, return this->unbind_i (ext_id, int_id); } -template <class ALLOCATOR> int +template <class ALLOCATOR> int ACE_Name_Space_Map<ALLOCATOR>::rebind (const ACE_NS_String &ext_id, - const ACE_NS_Internal &int_id, - ACE_NS_String &old_ext_id, - ACE_NS_Internal &old_int_id, - ALLOCATOR *alloc) + const ACE_NS_Internal &int_id, + ACE_NS_String &old_ext_id, + ACE_NS_Internal &old_int_id, + ALLOCATOR *alloc) { ACE_TRACE ("ACE_Name_Space_Map::rebind"); @@ -61,10 +66,10 @@ ACE_Name_Space_Map<ALLOCATOR>::rebind (const ACE_NS_String &ext_id, return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id); } -template <class ALLOCATOR> int +template <class ALLOCATOR> int ACE_Name_Space_Map<ALLOCATOR>::find (const ACE_NS_String &ext_id, - ACE_NS_Internal &int_id, - ALLOCATOR *alloc) + ACE_NS_Internal &int_id, + ALLOCATOR *alloc) { ACE_TRACE ("ACE_Name_Space_Map::find"); @@ -73,7 +78,7 @@ ACE_Name_Space_Map<ALLOCATOR>::find (const ACE_NS_String &ext_id, } #if defined (ACE_WIN32) -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::remap (EXCEPTION_POINTERS *ep) { ACE_TRACE ("ACE_Name_Space_Map::remap"); @@ -96,21 +101,21 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::remap (EXCEPTION_POINTERS *ep) ep->ContextRecord->IntT5 = ep->ContextRecord->IntA0 + 3; #endif /* __X86__ */ // Resume execution at the original point of "failure." - return (DWORD) EXCEPTION_CONTINUE_EXECUTION; + return (DWORD) EXCEPTION_CONTINUE_EXECUTION; } #endif /* ACE_WIN32 */ -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind (const ACE_WString &name, - const ACE_WString &value, - const char *type, - int rebind) + const ACE_WString &value, + const char *type, + int rebind) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->shared_bind_i (name, value, type, rebind); } @@ -120,11 +125,11 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind (const ACE_WString & return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (const ACE_WString &name, - const ACE_WString &value, - const char *type, - int rebind) + const ACE_WString &value, + const char *type, + int rebind) { ACE_TRACE ("ACE_Local_Name_Space::shared_bind"); @@ -150,69 +155,69 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (const ACE_WString int result = -1; if (rebind == 0) - { - // Do a normal bind. This will fail if there's already an - // <new_internal> with the same name. - result = this->name_space_map_->bind (new_name, new_internal, this->allocator_); - - if (result == 1) - { - // Entry already existed so bind failed. Free our dynamically allocated memory. - this->allocator_->free ((void *) ptr); - return result; - } - } + { + // Do a normal bind. This will fail if there's already an + // <new_internal> with the same name. + result = this->name_space_map_->bind (new_name, new_internal, this->allocator_); + + if (result == 1) + { + // Entry already existed so bind failed. Free our dynamically allocated memory. + this->allocator_->free ((void *) ptr); + return result; + } + } else - { - // Do a rebind. If there's already any entry, this will return the existing - // <new_name> and <new_internal> and overwrite the existing name binding. - ACE_NS_String old_name; - ACE_NS_Internal old_internal; - - result = this->name_space_map_->rebind (new_name, new_internal, - old_name, old_internal, - this->allocator_); - if (result == 1) - { - // Free up the memory we allocated in shared_bind(). Note that this - // assumes that the "value" pointer comes first and that the value, - // name, and type are contiguously allocated (see above for details) - this->allocator_->free ((void *) (old_internal.value ()).fast_rep ()); - } - } + { + // Do a rebind. If there's already any entry, this will return the existing + // <new_name> and <new_internal> and overwrite the existing name binding. + ACE_NS_String old_name; + ACE_NS_Internal old_internal; + + result = this->name_space_map_->rebind (new_name, new_internal, + old_name, old_internal, + this->allocator_); + if (result == 1) + { + // Free up the memory we allocated in shared_bind(). Note that this + // assumes that the "value" pointer comes first and that the value, + // name, and type are contiguously allocated (see above for details) + this->allocator_->free ((void *) (old_internal.value ()).fast_rep ()); + } + } if (result == -1) - // Free our dynamically allocated memory. - this->allocator_->free ((void *) ptr); + // Free our dynamically allocated memory. + this->allocator_->free ((void *) ptr); else - // If bind() or rebind() succeed, they will automatically sync - // up the map manager entry. However, we must sync up our - // name/value memory. - this->allocator_->sync (ptr, total_len); + // If bind() or rebind() succeed, they will automatically sync + // up the map manager entry. However, we must sync up our + // name/value memory. + this->allocator_->sync (ptr, total_len); return result; } } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind (const ACE_WString &name) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->unbind_i (name); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind_i (const ACE_WString &name) { ACE_TRACE ("ACE_Local_Name_Space::unbind"); @@ -233,9 +238,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind_i (const ACE_WString &nam } } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::bind (const ACE_WString &name, - const ACE_WString &value, + const ACE_WString &value, const char *type) { ACE_TRACE ("ACE_Local_Name_Space::bind"); @@ -244,9 +249,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::bind (const ACE_WString &name, return this->shared_bind (name, value, type, 0); } -template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::rebind (const ACE_WString &name, - const ACE_WString &value, +template <ACE_MEM_POOL_1, class ACE_LOCK> int +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::rebind (const ACE_WString &name, + const ACE_WString &value, const char *type) { ACE_TRACE ("ACE_Local_Name_Space::rebind"); @@ -255,29 +260,29 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::rebind (const ACE_WString &name, return this->shared_bind (name, value, type, 1); } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve (const ACE_WString &name, - ACE_WString &value, + ACE_WString &value, char *&type) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->resolve_i (name, value, type); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve_i (const ACE_WString &name, - ACE_WString &value, + ACE_WString &value, char *&type) { ACE_TRACE ("ACE_Local_Name_Space::resolve"); @@ -317,7 +322,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve_i (const ACE_WString &na } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::open (ACE_Naming_Context::Context_Scope_Type scope_in) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::open (ACE_Naming_Context::Context_Scope_Type scope_in) { ACE_TRACE ("ACE_Local_Name_Space::open"); this->ns_scope_ = scope_in; @@ -325,7 +330,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::open (ACE_Naming_Context::Contex return this->create_manager (); } -template <ACE_MEM_POOL_1, class ACE_LOCK> +template <ACE_MEM_POOL_1, class ACE_LOCK> ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space (void) : allocator_ (0), name_space_map_ (0), @@ -334,17 +339,17 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space (void) ACE_TRACE ("ACE_Local_Name_Space::ACE_Local_Name_Space"); } -template <ACE_MEM_POOL_1, class ACE_LOCK> -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space (ACE_Naming_Context::Context_Scope_Type scope_in, +template <ACE_MEM_POOL_1, class ACE_LOCK> +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space (ACE_Naming_Context::Context_Scope_Type scope_in, ACE_Name_Options *name_options) : name_options_ (name_options) -{ +{ ACE_TRACE ("ACE_Local_Name_Space::ACE_Local_Name_Space"); if (this->open (scope_in) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Local_Name_Space::ACE_Local_Name_Space"))); } -template <ACE_MEM_POOL_1, class ACE_LOCK> +template <ACE_MEM_POOL_1, class ACE_LOCK> ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::~ACE_Local_Name_Space (void) { ACE_TRACE ("ACE_Local_Name_Space::~ACE_Local_Name_Space"); @@ -354,25 +359,25 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::~ACE_Local_Name_Space (void) delete this->lock_; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager (void) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->create_manager_i (); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) { ACE_TRACE ("ACE_Local_Name_Space::create_manager"); @@ -402,7 +407,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) ACE_MEM_POOL_OPTIONS options (0, 0, 0, - ACE_CHORUS_LOCAL_NAME_SPACE_T_SIZE); + ACE_CHORUS_LOCAL_NAME_SPACE_T_SIZE); #endif /* CHORUS */ TCHAR lock_name_for_local_name_space [MAXNAMELEN + MAXPATHLEN]; @@ -411,32 +416,32 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) size_t length = 0; length = sizeof lock_name_for_local_name_space / sizeof (TCHAR); - ACE_OS::strncpy (lock_name_for_local_name_space, - ACE_TEXT ("name_space_"), - length); - ACE_OS::strncat (lock_name_for_local_name_space, - postfix, - length - ACE_OS::strlen (ACE_TEXT ("name_space_"))); - + ACE_OS::strncpy (lock_name_for_local_name_space, + ACE_TEXT ("name_space_"), + length); + ACE_OS::strncat (lock_name_for_local_name_space, + postfix, + length - ACE_OS::strlen (ACE_TEXT ("name_space_"))); + length = sizeof lock_name_for_backing_store / sizeof (TCHAR); - ACE_OS::strncpy (lock_name_for_backing_store, - ACE_TEXT ("backing_store_"), - length); - ACE_OS::strncat (lock_name_for_backing_store, - postfix, - length - ACE_OS::strlen (ACE_TEXT ("backing_store_"))); + ACE_OS::strncpy (lock_name_for_backing_store, + ACE_TEXT ("backing_store_"), + length); + ACE_OS::strncat (lock_name_for_backing_store, + postfix, + length - ACE_OS::strlen (ACE_TEXT ("backing_store_"))); // Create the allocator with the appropriate options. - ACE_NEW_RETURN (this->allocator_, - ALLOCATOR (this->context_file_, - lock_name_for_backing_store, - &options), -1); + ACE_NEW_RETURN (this->allocator_, + ALLOCATOR (this->context_file_, + lock_name_for_backing_store, + &options), -1); if (ACE_LOG_MSG->op_status ()) - ACE_ERROR_RETURN ((LM_ERROR, "Allocator::Allocator\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "Allocator::Allocator\n"), -1); ACE_NEW_RETURN (this->lock_, ACE_LOCK (lock_name_for_local_name_space), -1); - + #if !defined (ACE_LACKS_ACCESS) // Now check if the backing store has been created successfully if (ACE_OS::access (this->context_file_, F_OK) != 0) @@ -453,7 +458,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) { this->name_space_map_ = (ACE_Name_Space_Map <ALLOCATOR> *) ns_map; ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("name_space_map_ = %d, ns_map = %d\n"), - this->name_space_map_, ns_map)); + this->name_space_map_, ns_map)); } // This is the hard part since we have to avoid potential race @@ -465,68 +470,68 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) // This is the easy case since if we find the Name Server Map // Manager we know it's already initialized. if (this->allocator_->find (ACE_NAME_SERVER_MAP, ns_map) == 0) - { - this->name_space_map_ = (ACE_Name_Space_Map <ALLOCATOR> *) ns_map; - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("name_space_map_ = %d, ns_map = %d\n"), - this->name_space_map_, ns_map)); - } + { + this->name_space_map_ = (ACE_Name_Space_Map <ALLOCATOR> *) ns_map; + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("name_space_map_ = %d, ns_map = %d\n"), + this->name_space_map_, ns_map)); + } else - { - size_t map_size = sizeof *this->name_space_map_; - ns_map = this->allocator_->malloc (map_size); + { + size_t map_size = sizeof *this->name_space_map_; + ns_map = this->allocator_->malloc (map_size); - // Initialize the map into its memory location (e.g., shared memory). - ACE_NEW_RETURN (this->name_space_map_, - (ns_map) ACE_Name_Space_Map <ALLOCATOR> (this->allocator_), - -1); + // Initialize the map into its memory location (e.g., shared memory). + ACE_NEW_RETURN (this->name_space_map_, + (ns_map) ACE_Name_Space_Map <ALLOCATOR> (this->allocator_), + -1); - if (this->allocator_->bind (ACE_NAME_SERVER_MAP, ns_map) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "create_manager\n"), -1); - } + if (this->allocator_->bind (ACE_NAME_SERVER_MAP, ns_map) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "create_manager\n"), -1); + } ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("name_space_map_ = %d, ns_map = %d\n"), - this->name_space_map_, ns_map)); + this->name_space_map_, ns_map)); } return 0; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names_i (ACE_PWSTRING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_names"); ACE_READ_GUARD_RETURN (ACE_RW_Process_Mutex, ace_mon, *this->lock_, -1); - + MAP_ITERATOR map_iterator (*this->name_space_map_); MAP_ENTRY *map_entry; - + int result = 1; - + for (map_entry = 0; map_iterator.next (map_entry) != 0; map_iterator.advance()) { if (map_entry->ext_id_.strstr (pattern) != -1) - { - ACE_WString entry (map_entry->ext_id_ ); - - if (set.insert (entry) == -1) - { - result = -1; - break; - } - else - result = 0; - } + { + ACE_WString entry (map_entry->ext_id_ ); + + if (set.insert (entry) == -1) + { + result = -1; + break; + } + else + result = 0; + } } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values_i (ACE_PWSTRING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_values"); ACE_READ_GUARD_RETURN (ACE_RW_Process_Mutex, ace_mon, *this->lock_, -1); @@ -541,25 +546,25 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values_i (ACE_PWSTRING_SET map_iterator.advance ()) { if (map_entry->int_id_.value ().strstr (pattern) != -1) - { - ACE_WString entry (map_entry->int_id_.value ()); + { + ACE_WString entry (map_entry->int_id_.value ()); - if (set.insert (entry) == -1) - { - result = -1; - break; + if (set.insert (entry) == -1) + { + result = -1; + break; } - else - result = 0; - } + else + result = 0; + } } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types_i (ACE_PWSTRING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_types"); ACE_READ_GUARD_RETURN (ACE_RW_Process_Mutex, ace_mon, *this->lock_, -1); @@ -571,63 +576,63 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types_i (ACE_PWSTRING_SET & // Note that char_rep() allocates memory so we need to delete it char *pattern_rep = pattern.char_rep (); - + // Check for wildcard case first. if (ACE_OS::strcmp ("", pattern_rep) == 0) ACE_ALLOCATOR_RETURN (compiled_regexp, ACE_OS::strdup (""), -1); - else + else // Compile the regular expression (the 0's cause ACE_OS::compile // to allocate space). #if defined (ACE_HAS_REGEX) compiled_regexp = ACE_OS::compile (pattern_rep, 0, 0); -#else +#else // If we don't have regular expressions just use the pattern // directly. compiled_regexp = pattern_rep; #endif /* ACE_HAS_REGEX */ - + int result = 1; - + for (map_entry = 0; map_iterator.next (map_entry) != 0; map_iterator.advance ()) { // Get the type const char *type = map_entry->int_id_.type (); - + // Everything matches the wildcard. - if (ACE_OS::strcmp ("", pattern_rep) == 0 + if (ACE_OS::strcmp ("", pattern_rep) == 0 #if defined (ACE_HAS_REGEX) - || ACE_OS::step (type, compiled_regexp) != 0) + || ACE_OS::step (type, compiled_regexp) != 0) #else // If we don't have regular expressions just use strstr() for // substring matching. - || ACE_OS::strstr (type, compiled_regexp) != 0) + || ACE_OS::strstr (type, compiled_regexp) != 0) #endif /* ACE_HAS_REGEX */ { ACE_WString entry (type); - - if (set.insert (entry) == -1) - { - result = -1; - break; - } - else - result = 0; - } + + if (set.insert (entry) == -1) + { + result = -1; + break; + } + else + result = 0; + } } #if defined (ACE_HAS_REGEX) if (compiled_regexp) ACE_OS::free ((void *) compiled_regexp); #endif /* ACE_HAS_REGEX */ - delete [] pattern_rep; // delete pattern_rep; + delete [] pattern_rep; // delete pattern_rep; return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries_i (ACE_BINDING_SET &set, const ACE_WString &pattern) { @@ -642,22 +647,22 @@ ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries_i (ACE_BINDIN map_iterator.advance()) { if (map_entry->ext_id_.strstr (pattern) != -1) - { - ACE_Name_Binding entry (map_entry->ext_id_, - map_entry->int_id_.value (), - map_entry->int_id_.type ()); + { + ACE_Name_Binding entry (map_entry->ext_id_, + map_entry->int_id_.value (), + map_entry->int_id_.type ()); - if (set.insert (entry) == -1) - return -1; - } + if (set.insert (entry) == -1) + return -1; + } } return 0; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries_i (ACE_BINDING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_value_entries"); ACE_READ_GUARD_RETURN (ACE_RW_Process_Mutex, ace_mon, *this->lock_, -1); @@ -670,21 +675,21 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries_i (ACE_BINDIN map_iterator.advance ()) { if (map_entry->int_id_.value ().strstr (pattern) != -1) - { - ACE_Name_Binding entry (map_entry->ext_id_, - map_entry->int_id_.value (), - map_entry->int_id_.type ()); + { + ACE_Name_Binding entry (map_entry->ext_id_, + map_entry->int_id_.value (), + map_entry->int_id_.type ()); - if (set.insert (entry) == -1) - return -1; - } + if (set.insert (entry) == -1) + return -1; + } } return 0; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i (ACE_BINDING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_type_entries"); ACE_READ_GUARD_RETURN (ACE_RW_Process_Mutex, ace_mon, *this->lock_, -1); @@ -699,7 +704,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i (ACE_BINDING // Check for wildcard case first. if (ACE_OS::strcmp ("", pattern_rep) == 0) compiled_regexp = ACE_OS::strdup (""); - else + else // Compile the regular expression (the 0's cause ACE_OS::compile to allocate space). #if defined (ACE_HAS_REGEX) compiled_regexp = ACE_OS::compile (pattern_rep, 0, 0); @@ -716,24 +721,24 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i (ACE_BINDING if (ACE_OS::strcmp ("", pattern_rep) == 0 // Everything matches the wildcard. #if defined (ACE_HAS_REGEX) - || ACE_OS::step (type, compiled_regexp) != 0) + || ACE_OS::step (type, compiled_regexp) != 0) #else /* If we don't have regular expressions just use strstr() for substring matching. */ - || ACE_OS::strstr (type, compiled_regexp) != 0) + || ACE_OS::strstr (type, compiled_regexp) != 0) #endif /* ACE_HAS_REGEX */ { - ACE_Name_Binding entry (map_entry->ext_id_, - map_entry->int_id_.value (), - map_entry->int_id_.type ()); + ACE_Name_Binding entry (map_entry->ext_id_, + map_entry->int_id_.value (), + map_entry->int_id_.type ()); - if (set.insert (entry) == -1) - return -1; - } + if (set.insert (entry) == -1) + return -1; + } } #if defined (ACE_HAS_REGEX) if (compiled_regexp) ACE_OS::free ((void *) compiled_regexp); #endif /* ACE_HAS_REGEX */ - delete [] pattern_rep; // delete pattern_rep; + delete [] pattern_rep; // delete pattern_rep; return 0; } @@ -746,7 +751,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump_i (void) const MAP_ITERATOR map_iterator (*this->name_space_map_); MAP_ENTRY *map_entry; - + for (map_entry = 0; map_iterator.next (map_entry) != 0; map_iterator.advance()) @@ -756,7 +761,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump_i (void) const const char *type = map_entry->int_id_.type (); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("key=%s\nvalue=%s\ntype=%s\n"), - key, value, type)); + key, value, type)); // We need to delete key and value since char_rep allocates memory for them delete [] key; delete [] value; @@ -765,109 +770,109 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump_i (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names (ACE_PWSTRING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->list_names_i (set, pattern); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values (ACE_PWSTRING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->list_values_i (set, pattern); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types (ACE_PWSTRING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->list_types_i (set, pattern); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->list_name_entries_i (set, pattern); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->list_value_entries_i (set, pattern); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; } -template <ACE_MEM_POOL_1, class ACE_LOCK> int +template <ACE_MEM_POOL_1, class ACE_LOCK> int ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) + const ACE_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) // C++ exception handling doesn't support resumption. int result = 0; - ACE_SEH_TRY + ACE_SEH_TRY { result = this->list_type_entries_i (set, pattern); } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) { } return result; @@ -881,15 +886,15 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump (void) const // C++ exception handling doesn't support resumption. // This should really be a const cast - ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK> *fake_this = + ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK> *fake_this = (ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK> *) this; ACE_UNUSED_ARG (fake_this); - ACE_SEH_TRY + ACE_SEH_TRY { this->dump_i (); } - ACE_SEH_EXCEPT (fake_this->remap (GetExceptionInformation ())) + ACE_SEH_EXCEPT (fake_this->remap (GetExceptionInformation ())) { } } diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp index 1a8b2a1c55f..359d8f480fe 100644 --- a/ace/Malloc_T.cpp +++ b/ace/Malloc_T.cpp @@ -1,12 +1,16 @@ // Malloc_T.cpp // $Id$ -#if !defined (ACE_MALLOC_T_C) +#ifndef ACE_MALLOC_T_C #define ACE_MALLOC_T_C #define ACE_BUILD_DLL #include "ace/Malloc_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Malloc_T.i" #endif /* __ACE_INLINE__ */ diff --git a/ace/Managed_Object.cpp b/ace/Managed_Object.cpp index d12508f625f..a3673f7eefa 100644 --- a/ace/Managed_Object.cpp +++ b/ace/Managed_Object.cpp @@ -2,11 +2,15 @@ #define ACE_BUILD_DLL -#if !defined (ACE_MANAGED_OBJECT_CPP) +#ifndef ACE_MANAGED_OBJECT_CPP #define ACE_MANAGED_OBJECT_CPP #include "ace/Managed_Object.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Managed_Object.i" #endif /* __ACE_INLINE__ */ diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp index e75c2bf23c3..b8f54316d26 100644 --- a/ace/Map_Manager.cpp +++ b/ace/Map_Manager.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_MAP_MANAGER_C) +#ifndef ACE_MAP_MANAGER_C #define ACE_MAP_MANAGER_C #define ACE_BUILD_DLL #include "ace/Malloc.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Service_Config.h" #include "ace/Map_Manager.h" diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index a1533092297..ff1df7d53d5 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (ACE_MESSAGE_QUEUE_T_C) +#ifndef ACE_MESSAGE_QUEUE_T_C #define ACE_MESSAGE_QUEUE_T_C #define ACE_BUILD_DLL @@ -8,6 +8,10 @@ // circular include problems. #include "ace/Message_Queue.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Message_Queue_T.i" #endif /* __ACE_INLINE__ */ @@ -483,7 +487,7 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item if (this->cur_bytes_ <= this->low_water_mark_ && this->signal_enqueue_waiters () == -1) return -1; - else + else return this->cur_count_; } @@ -1168,7 +1172,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::sublist_enqueue_i (ACE_Message_Block * new_item->prev (0); new_item->next (this->head_); if (this->head_ != 0) - { + { this->head_->prev (new_item); } else @@ -1393,7 +1397,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_pending_queue (const ACE_Time_ else break; // do while - } + } while (current_status == ACE_Dynamic_Message_Strategy::BEYOND_LATE); if (this->pending_head_) @@ -1442,7 +1446,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_pending_queue (const ACE_Time_ else break; // do while - } + } while (current_status == ACE_Dynamic_Message_Strategy::LATE); if (this->pending_head_) @@ -1512,7 +1516,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_late_queue (const ACE_Time_Val else break; // do while - } + } while (current_status == ACE_Dynamic_Message_Strategy::BEYOND_LATE); if (this->late_head_) diff --git a/ace/Module.cpp b/ace/Module.cpp index 2d5da79d4f7..9562a09a22c 100644 --- a/ace/Module.cpp +++ b/ace/Module.cpp @@ -1,11 +1,16 @@ // Module.cpp // $Id$ -#if !defined (ACE_MODULE_C) +#ifndef ACE_MODULE_C #define ACE_MODULE_C #define ACE_BUILD_DLL #include "ace/Module.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Stream_Modules.h" #if !defined (__ACE_INLINE__) @@ -23,9 +28,9 @@ ACE_Module<ACE_SYNCH_USE>::dump (void) const } template <ACE_SYNCH_DECL> void -ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q, - int flags /* = M_DELETE_WRITER */) -{ +ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q, + int flags /* = M_DELETE_WRITER */) +{ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::writer"); // Close and maybe delete old writer @@ -45,8 +50,8 @@ ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q, } template <ACE_SYNCH_DECL> void -ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q, - int flags /* = M_DELETE_READER */) +ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q, + int flags /* = M_DELETE_READER */) { ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::reader"); @@ -61,7 +66,7 @@ ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q, // Set the q's module pointer to point to us. q->mod_ = this; } - + // don't allow the caller to change the reader status ACE_SET_BITS (flags_, (flags & M_DELETE_READER)); } @@ -78,11 +83,11 @@ ACE_Module<ACE_SYNCH_USE>::link (ACE_Module<ACE_SYNCH_USE> *m) } template <ACE_SYNCH_DECL> int -ACE_Module<ACE_SYNCH_USE>::open (const ASYS_TCHAR *mod_name, - ACE_Task<ACE_SYNCH_USE> *writer_q, - ACE_Task<ACE_SYNCH_USE> *reader_q, - void *arg, - int flags /* = M_DELETE */) +ACE_Module<ACE_SYNCH_USE>::open (const ASYS_TCHAR *mod_name, + ACE_Task<ACE_SYNCH_USE> *writer_q, + ACE_Task<ACE_SYNCH_USE> *reader_q, + void *arg, + int flags /* = M_DELETE */) { ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::open"); this->name (mod_name); @@ -95,13 +100,13 @@ ACE_Module<ACE_SYNCH_USE>::open (const ASYS_TCHAR *mod_name, if (this->writer ()) this->close_i (1, M_DELETE_WRITER); - if (writer_q == 0) + if (writer_q == 0) { writer_q = new ACE_Thru_Task<ACE_SYNCH_USE>; ACE_SET_BITS (flags, M_DELETE_WRITER); } - if (reader_q == 0) + if (reader_q == 0) { reader_q = new ACE_Thru_Task<ACE_SYNCH_USE>; ACE_SET_BITS (flags, M_DELETE_READER); @@ -170,10 +175,10 @@ ACE_Module<ACE_SYNCH_USE>::~ACE_Module (void) template <ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE>::ACE_Module (const ASYS_TCHAR *mod_name, - ACE_Task<ACE_SYNCH_USE> *writer_q, - ACE_Task<ACE_SYNCH_USE> *reader_q, - void *args, - int flags /* = M_DELETE */) + ACE_Task<ACE_SYNCH_USE> *writer_q, + ACE_Task<ACE_SYNCH_USE> *reader_q, + void *args, + int flags /* = M_DELETE */) : flags_ (0) { ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::ACE_Module"); @@ -184,7 +189,7 @@ ACE_Module<ACE_SYNCH_USE>::ACE_Module (const ASYS_TCHAR *mod_name, if (this->open (mod_name, writer_q, reader_q, args, flags) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Module"))); } - + template <ACE_SYNCH_DECL> int ACE_Module<ACE_SYNCH_USE>::close (int flags /* = M_DELETE_NONE */) { @@ -205,7 +210,7 @@ ACE_Module<ACE_SYNCH_USE>::close (int flags /* = M_DELETE_NONE */) template <ACE_SYNCH_DECL> int ACE_Module<ACE_SYNCH_USE>::close_i (int which, - int flags) + int flags) { ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::close_i"); @@ -228,7 +233,7 @@ ACE_Module<ACE_SYNCH_USE>::close_i (int which, task->next (0); // Should we also delete it ? - if (flags != M_DELETE_NONE + if (flags != M_DELETE_NONE && ACE_BIT_ENABLED (flags_, which + 1)) { // Only delete the Tasks if there aren't any more threads diff --git a/ace/RB_Tree.cpp b/ace/RB_Tree.cpp index 642638e33b4..dd36270cb7f 100644 --- a/ace/RB_Tree.cpp +++ b/ace/RB_Tree.cpp @@ -2,11 +2,15 @@ // RB_Tree.cpp -#if !defined (ACE_RB_TREE_C) +#ifndef ACE_RB_TREE_C #define ACE_RB_TREE_C #include "ace/RB_Tree.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/RB_Tree.i" #endif /* __ACE_INLINE__ */ @@ -60,7 +64,7 @@ ACE_RB_Tree<KEY, T>::ACE_RB_Tree ( less_than_functor_ (less_than_functor), free_functor_ (free_functor) { - if (less_than_functor_ == 0) + if (less_than_functor_ == 0) { less_than_functor_ = new ACE_Less_Than_Functor<KEY, KEY>; free_functor_ = 1; @@ -140,7 +144,7 @@ ACE_RB_Tree<KEY, T>::lessthan (const KEY &k1, const KEY &k2) if (less_than_functor_ == 0) { ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nNull comparison functor pointer.\n")), + ASYS_TEXT ("\nNull comparison functor pointer.\n")), 0); } else @@ -215,8 +219,8 @@ ACE_RB_Tree<KEY, T>::insert (const KEY &k, const T &t) current->right (new ACE_RB_Tree_Node<KEY, T> (k, t)); if (current->right ()) { - // If the node was successfully inserted, set its parent, rebalance - // the tree, color the root black, and return a pointer to the + // If the node was successfully inserted, set its parent, rebalance + // the tree, color the root black, and return a pointer to the // inserted item. T *item = &(current->right ()->item ()); current->right ()->parent (current); @@ -250,7 +254,7 @@ ACE_RB_Tree<KEY, T>::insert (const KEY &k, const T &t) if (current->left ()) { // If the node was successfully inserted, set its parent, rebalance - // the tree, color the root black, and return a pointer to the + // the tree, color the root black, and return a pointer to the // inserted item. T *item = &(current->left ()->item ()); current->left ()->parent (current); @@ -302,7 +306,7 @@ ACE_RB_Tree<KEY, T>::remove (const KEY &k) { // Find a matching node, if there is one. ACE_RB_Tree_Node<KEY, T> *x, *z; - + z = find_node (k); if ((z) && (! this->lessthan (z->key (), k)) @@ -327,9 +331,9 @@ ACE_RB_Tree<KEY, T>::remove (const KEY &k) x = y->right (); } if (x) - { - x->parent (y->parent ()); - } + { + x->parent (y->parent ()); + } if (y->parent ()) { if (y == y->parent ()->left ()) @@ -693,7 +697,7 @@ ACE_RB_Tree<KEY, T>::RB_tree_successor (ACE_RB_Tree_Node<KEY, T> *x) const return y; } - + // Method to find the predecessor node of the given node in the tree. template <class KEY, class T> ACE_RB_Tree_Node<KEY, T> * diff --git a/ace/Select_Reactor_T.cpp b/ace/Select_Reactor_T.cpp index 8f3b9c1618b..37411698260 100644 --- a/ace/Select_Reactor_T.cpp +++ b/ace/Select_Reactor_T.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_SELECT_REACTOR_T_C) +#ifndef ACE_SELECT_REACTOR_T_C #define ACE_SELECT_REACTOR_T_C #define ACE_BUILD_DLL #include "ace/Select_Reactor_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Thread.h" #include "ace/Timer_Heap.h" @@ -28,7 +33,7 @@ ACE_RCSID(ace, Select_Reactor_T, "$Id$") #endif /* ACE_WIN32 */ template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::any_ready +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::any_ready (ACE_Select_Reactor_Handle_Set &wait_set) { ACE_TRACE ("ACE_Select_Reactor_T::fill_in_ready"); @@ -163,7 +168,7 @@ ACE_Select_Reactor_Token_T<ACE_SELECT_REACTOR_MUTEX>::dump (void) const } template <class ACE_SELECT_REACTOR_MUTEX> -ACE_Select_Reactor_Token_T<ACE_SELECT_REACTOR_MUTEX>::ACE_Select_Reactor_Token_T +ACE_Select_Reactor_Token_T<ACE_SELECT_REACTOR_MUTEX>::ACE_Select_Reactor_Token_T (ACE_Select_Reactor_Impl &r) : select_reactor_ (&r) { @@ -190,7 +195,7 @@ ACE_Select_Reactor_Token_T<ACE_SELECT_REACTOR_MUTEX>::select_reactor (void) } template <class ACE_SELECT_REACTOR_MUTEX> void -ACE_Select_Reactor_Token_T<ACE_SELECT_REACTOR_MUTEX>::select_reactor +ACE_Select_Reactor_Token_T<ACE_SELECT_REACTOR_MUTEX>::select_reactor (ACE_Select_Reactor_Impl &select_reactor) { this->select_reactor_ = &select_reactor; @@ -274,7 +279,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::resume_handlers (void) } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler (ACE_Event_Handler *handler, ACE_Reactor_Mask mask) { @@ -284,7 +289,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler (ACE_HANDLE handle, ACE_Event_Handler *handler, ACE_Reactor_Mask mask) @@ -295,7 +300,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *handler, ACE_Reactor_Mask mask) @@ -306,7 +311,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handler (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Event_Handler **handler) @@ -317,7 +322,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler (const ACE_Handle_Set &handles, ACE_Reactor_Mask mask) { @@ -327,7 +332,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler (ACE_Event_Handler *handler, ACE_Reactor_Mask mask) { @@ -337,7 +342,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler (ACE_HANDLE handle, ACE_Reactor_Mask mask) { @@ -349,7 +354,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler // Performs operations on the "ready" bits. template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ready_ops +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ready_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, int ops) @@ -363,7 +368,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ready_ops } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::open +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::open (size_t size, int restart, ACE_Sig_Handler *sh, @@ -443,7 +448,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::open } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::set_sig_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::set_sig_handler (ACE_Sig_Handler *signal_handler) { if (this->signal_handler_ != 0 && this->delete_signal_handler_ != 0) @@ -454,7 +459,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::set_sig_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::set_timer_queue +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::set_timer_queue (ACE_Timer_Queue *timer_queue) { if (this->timer_queue_ != 0 && this->delete_timer_queue_ != 0) @@ -465,7 +470,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::set_timer_queue } template <class ACE_SELECT_REACTOR_TOKEN> -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T (ACE_Sig_Handler *sh, ACE_Timer_Queue *tq, int disable_notify_pipe, @@ -490,7 +495,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T // Initialize ACE_Select_Reactor_T. template <class ACE_SELECT_REACTOR_TOKEN> -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T (size_t size, int rs, ACE_Sig_Handler *sh, @@ -555,7 +560,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::close (void) } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::current_info +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::current_info (ACE_HANDLE, size_t &) { return -1; @@ -569,7 +574,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::~ACE_Select_Reactor_T (void) } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler_i +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler_i (const ACE_Handle_Set &handles, ACE_Reactor_Mask mask) { @@ -586,7 +591,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler_i } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler_i +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler_i (const ACE_Handle_Set &handles, ACE_Event_Handler *handler, ACE_Reactor_Mask mask) @@ -603,7 +608,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler_i } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler (const ACE_Sig_Set &sigset, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp) @@ -627,7 +632,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler (const ACE_Sig_Set &sigset) { ACE_TRACE ("ACE_Select_Reactor_T::remove_handler"); @@ -648,7 +653,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler // Note the queue handles its own locking. template <class ACE_SELECT_REACTOR_TOKEN> long -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::schedule_timer +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::schedule_timer (ACE_Event_Handler *handler, const void *arg, const ACE_Time_Value &delta_time, @@ -665,7 +670,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::schedule_timer // returning (will return earlier if I/O or signal events occur). template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events (ACE_Time_Value &max_wait_time) { ACE_TRACE ("ACE_Select_Reactor_T::handle_events"); @@ -694,7 +699,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_error (void) } template <class ACE_SELECT_REACTOR_TOKEN> void -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::notify_handle +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::notify_handle (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Handle_Set &ready_mask, @@ -727,7 +732,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::notify_handle // Returns the original mask. template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::mask_ops +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::mask_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, int ops) @@ -742,7 +747,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::mask_ops // Must be called with locks held. template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handler_i +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Event_Handler **handler) @@ -828,7 +833,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::suspend_i (ACE_HANDLE handle) // Must be called with locks held template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler_i +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler_i (ACE_HANDLE handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) @@ -841,7 +846,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::register_handler_i } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler_i +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask) { @@ -854,7 +859,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::remove_handler_i // Must be called with lock held. template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::wait_for_multiple_events +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &dispatch_set, ACE_Time_Value *max_wait_time) { @@ -906,7 +911,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::wait_for_multiple_events } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_timer_handlers +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_timer_handlers (int &number_of_handlers_dispatched) { number_of_handlers_dispatched += this->timer_queue_->expire (); @@ -917,7 +922,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_timer_handlers } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_notification_handlers +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_notification_handlers (ACE_Select_Reactor_Handle_Set &dispatch_set, int &number_of_active_handles, int &number_of_handlers_dispatched) @@ -941,7 +946,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_notification_handlers } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_set +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_set (int number_of_active_handles, int &number_of_handlers_dispatched, int mask, @@ -973,7 +978,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_set } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_handlers +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_handlers (ACE_Select_Reactor_Handle_Set &dispatch_set, int &number_of_active_handles, int &number_of_handlers_dispatched) @@ -1023,7 +1028,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_handlers } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch (int active_handle_count, ACE_Select_Reactor_Handle_Set &dispatch_set) { @@ -1087,22 +1092,22 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch // Check to see if there are no more I/O handles left to // dispatch AFTER we've handled the timers... else if (active_handle_count == 0) - return io_handlers_dispatched - + other_handlers_dispatched + return io_handlers_dispatched + + other_handlers_dispatched + signal_occurred; // Next dispatch the notification handlers (if there are any to // dispatch). These are required to handle multi-threads that // are trying to update the <Reactor>. - else if (this->dispatch_notification_handlers + else if (this->dispatch_notification_handlers (dispatch_set, active_handle_count, other_handlers_dispatched) == -1) break; // State has changed, exit loop. // Finally, dispatch the I/O handlers. - else if (this->dispatch_io_handlers + else if (this->dispatch_io_handlers (dispatch_set, active_handle_count, io_handlers_dispatched) == -1) @@ -1126,7 +1131,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::release_token (void) } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events (ACE_Time_Value *max_wait_time) { ACE_TRACE ("ACE_Select_Reactor_T::handle_events"); @@ -1150,12 +1155,12 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events } template <class ACE_SELECT_REACTOR_TOKEN> int -ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events_i +ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events_i (ACE_Time_Value *max_wait_time) { int result = -1; - ACE_SEH_TRY + ACE_SEH_TRY { ACE_Select_Reactor_Handle_Set dispatch_set; @@ -1166,7 +1171,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events_i result = this->dispatch (number_of_active_handles, dispatch_set); } - ACE_SEH_EXCEPT (this->release_token ()) + ACE_SEH_EXCEPT (this->release_token ()) { // As it stands now, we catch and then rethrow all Win32 // structured exceptions so that we can make sure to release the diff --git a/ace/Singleton.cpp b/ace/Singleton.cpp index 5adc920bb44..da3a7ff6f18 100644 --- a/ace/Singleton.cpp +++ b/ace/Singleton.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_SINGLETON_C) +#ifndef ACE_SINGLETON_C #define ACE_SINGLETON_C #define ACE_BUILD_DLL #include "ace/Singleton.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Synch_T.h" #include "ace/Object_Manager.h" diff --git a/ace/Strategies_T.cpp b/ace/Strategies_T.cpp index 79035f88359..5337a47e56c 100644 --- a/ace/Strategies_T.cpp +++ b/ace/Strategies_T.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_STRATEGIES_T_C) +#ifndef ACE_STRATEGIES_T_C #define ACE_STRATEGIES_T_C #define ACE_BUILD_DLL #include "ace/Strategies_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Service_Repository.h" #include "ace/Synch.h" #include "ace/Service_Types.h" diff --git a/ace/Stream.cpp b/ace/Stream.cpp index 99066da2f6c..f8af657ff6d 100644 --- a/ace/Stream.cpp +++ b/ace/Stream.cpp @@ -1,12 +1,17 @@ // Stream.cpp // $Id$ -#if !defined (ACE_STREAM_C) +#ifndef ACE_STREAM_C #define ACE_STREAM_C #define ACE_BUILD_DLL //#include "ace/Module.h" #include "ace/Stream.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Stream_Modules.h" #if !defined (__ACE_INLINE__) @@ -25,30 +30,30 @@ ACE_Stream<ACE_SYNCH_USE>::dump (void) const ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::dump"); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("-------- module links --------\n"))); - for (ACE_Module<ACE_SYNCH_USE> *mp = this->stream_head_; - ; + for (ACE_Module<ACE_SYNCH_USE> *mp = this->stream_head_; + ; mp = mp->next ()) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("module name = %s\n"), mp->name ())); if (mp == this->stream_tail_) - break; + break; } ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("-------- writer links --------\n"))); ACE_Task<ACE_SYNCH_USE> *tp; - for (tp = this->stream_head_->writer (); - ; + for (tp = this->stream_head_->writer (); + ; tp = tp->next ()) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("writer queue name = %s\n"), tp->name ())); tp->dump (); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("-------\n"))); if (tp == this->stream_tail_->writer () - || (this->linked_us_ - && tp == this->linked_us_->stream_head_->reader ())) - break; + || (this->linked_us_ + && tp == this->linked_us_->stream_head_->reader ())) + break; } ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("-------- reader links --------\n"))); @@ -58,9 +63,9 @@ ACE_Stream<ACE_SYNCH_USE>::dump (void) const tp->dump (); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("-------\n"))); if (tp == this->stream_head_->reader () - || (this->linked_us_ - && tp == this->linked_us_->stream_head_->writer ())) - break; + || (this->linked_us_ + && tp == this->linked_us_->stream_head_->writer ())) + break; } } @@ -68,9 +73,9 @@ template <ACE_SYNCH_DECL> int ACE_Stream<ACE_SYNCH_USE>::push (ACE_Module<ACE_SYNCH_USE> *new_top) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::push"); - if (this->push_module (new_top, - this->stream_head_->next (), - this->stream_head_) == -1) + if (this->push_module (new_top, + this->stream_head_->next (), + this->stream_head_) == -1) return -1; else return 0; @@ -83,7 +88,7 @@ ACE_Stream<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, ACE_Time_Value *tv) return this->stream_head_->writer ()->put (mb, tv); } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream<ACE_SYNCH_USE>::get (ACE_Message_Block *&mb, ACE_Time_Value *tv) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::get"); @@ -93,7 +98,7 @@ ACE_Stream<ACE_SYNCH_USE>::get (ACE_Message_Block *&mb, ACE_Time_Value *tv) // Return the "top" ACE_Module in a ACE_Stream, skipping over the // stream_head. -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream<ACE_SYNCH_USE>::top (ACE_Module<ACE_SYNCH_USE> *&m) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::top"); @@ -129,7 +134,7 @@ ACE_Stream<ACE_SYNCH_USE>::pop (int flags) // Don't delete the Module unless the flags request this. if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE) - delete top_mod; + delete top_mod; this->stream_head_->writer ()->next (new_top->writer ()); new_top->reader ()->next (this->stream_head_->reader ()); @@ -141,31 +146,31 @@ ACE_Stream<ACE_SYNCH_USE>::pop (int flags) // ACE_Stream. template <ACE_SYNCH_DECL> int -ACE_Stream<ACE_SYNCH_USE>::remove (const ASYS_TCHAR *name, - int flags) +ACE_Stream<ACE_SYNCH_USE>::remove (const ASYS_TCHAR *name, + int flags) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::remove"); ACE_Module<ACE_SYNCH_USE> *prev = 0; - for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_; - mod != 0; + for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_; + mod != 0; mod = mod->next ()) if (ACE_OS::strcmp (mod->name (), name) == 0) { - if (prev == 0) // Deleting ACE_Stream Head - this->stream_head_->link (mod->next ()); - else - prev->link (mod->next ()); - - // Don't delete the Module unless the flags request this. - if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE) - { - // Close down the module and release the memory. - mod->close (flags); - delete mod; - } - - return 0; + if (prev == 0) // Deleting ACE_Stream Head + this->stream_head_->link (mod->next ()); + else + prev->link (mod->next ()); + + // Don't delete the Module unless the flags request this. + if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE) + { + // Close down the module and release the memory. + mod->close (flags); + delete mod; + } + + return 0; } else prev = mod; @@ -177,11 +182,11 @@ template <ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE> * ACE_Stream<ACE_SYNCH_USE>::find (const ASYS_TCHAR *name) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::find"); - for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_; - mod != 0; + for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_; + mod != 0; mod = mod->next ()) if (ACE_OS::strcmp (mod->name (), name) == 0) - return mod; + return mod; return 0; } @@ -189,9 +194,9 @@ ACE_Stream<ACE_SYNCH_USE>::find (const ASYS_TCHAR *name) // Actually push a module onto the stack... template <ACE_SYNCH_DECL> int -ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top, - ACE_Module<ACE_SYNCH_USE> *current_top, - ACE_Module<ACE_SYNCH_USE> *head) +ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top, + ACE_Module<ACE_SYNCH_USE> *current_top, + ACE_Module<ACE_SYNCH_USE> *head) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::push_module"); ACE_Task<ACE_SYNCH_USE> *nt_reader = new_top->reader (); @@ -211,7 +216,7 @@ ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top, if (head) { if (head != new_top) - head->link (new_top); + head->link (new_top); } else nt_reader->next (0); @@ -228,24 +233,24 @@ ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top, #if 0 template <ACE_SYNCH_DECL> int -ACE_Stream<ACE_SYNCH_USE>::open (void *a, - ACE_Multiplexor &muxer, - ACE_Module<ACE_SYNCH_USE> *head) +ACE_Stream<ACE_SYNCH_USE>::open (void *a, + ACE_Multiplexor &muxer, + ACE_Module<ACE_SYNCH_USE> *head) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::open"); this->stream_head_ = head == 0 - ? new ACE_Module<ACE_SYNCH_USE> ("ACE_Stream_Head", - new ACE_Stream_Head<ACE_SYNCH_USE>, - new ACE_Stream_Head<ACE_SYNCH_USE>, a) : head; + ? new ACE_Module<ACE_SYNCH_USE> ("ACE_Stream_Head", + new ACE_Stream_Head<ACE_SYNCH_USE>, + new ACE_Stream_Head<ACE_SYNCH_USE>, a) : head; this->stream_tail_ = 0; return muxer.link_from_below (this->stream_head_); } -#endif +#endif template <ACE_SYNCH_DECL> int -ACE_Stream<ACE_SYNCH_USE>::open (void *a, - ACE_Module<ACE_SYNCH_USE> *head, - ACE_Module<ACE_SYNCH_USE> *tail) +ACE_Stream<ACE_SYNCH_USE>::open (void *a, + ACE_Module<ACE_SYNCH_USE> *head, + ACE_Module<ACE_SYNCH_USE> *tail) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::open"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); @@ -257,8 +262,8 @@ ACE_Stream<ACE_SYNCH_USE>::open (void *a, { h1 = new ACE_Stream_Head<ACE_SYNCH_USE>; h2 = new ACE_Stream_Head<ACE_SYNCH_USE>; - head = new ACE_Module<ACE_SYNCH_USE> (ASYS_TEXT ("ACE_Stream_Head"), - h1, h2, + head = new ACE_Module<ACE_SYNCH_USE> (ASYS_TEXT ("ACE_Stream_Head"), + h1, h2, a, M_DELETE); } @@ -267,14 +272,14 @@ ACE_Stream<ACE_SYNCH_USE>::open (void *a, { t1 = new ACE_Stream_Tail<ACE_SYNCH_USE>; t2 = new ACE_Stream_Tail<ACE_SYNCH_USE>; - tail = new ACE_Module<ACE_SYNCH_USE> (ASYS_TEXT ("ACE_Stream_Tail"), - t1, t2, + tail = new ACE_Module<ACE_SYNCH_USE> (ASYS_TEXT ("ACE_Stream_Tail"), + t1, t2, a, M_DELETE); } // Make sure *all* the allocation succeeded! - if (head == 0 && (h1 == 0 || h2 == 0) + if (head == 0 && (h1 == 0 || h2 == 0) || tail == 0 && (t1 == 0 || t2 == 0)) { delete h1; @@ -292,9 +297,9 @@ ACE_Stream<ACE_SYNCH_USE>::open (void *a, if (this->push_module (this->stream_tail_) == -1) return -1; - else if (this->push_module (this->stream_head_, - this->stream_tail_, - this->stream_head_) == -1) + else if (this->push_module (this->stream_head_, + this->stream_tail_, + this->stream_head_) == -1) return -1; else return 0; @@ -306,7 +311,7 @@ ACE_Stream<ACE_SYNCH_USE>::close (int flags) ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::close"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); - if (this->stream_head_ != 0 + if (this->stream_head_ != 0 && this->stream_tail_ != 0) { // Don't bother checking return value here. @@ -317,14 +322,14 @@ ACE_Stream<ACE_SYNCH_USE>::close (int flags) // Remove and cleanup all the intermediate modules. while (this->stream_head_->next () != this->stream_tail_) - if (this->pop (flags) == -1) - result = -1; - + if (this->pop (flags) == -1) + result = -1; + // Clean up the head and tail of the stream. if (this->stream_head_->close (flags) == -1) - result = -1; + result = -1; if (this->stream_tail_->close (flags) == -1) - result = -1; + result = -1; // Cleanup the memory. delete this->stream_head_; @@ -340,9 +345,9 @@ ACE_Stream<ACE_SYNCH_USE>::close (int flags) return 0; } -template <ACE_SYNCH_DECL> int -ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, - void *a) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, + void *a) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::control"); ACE_IO_Cntl_Msg ioc (cmd); @@ -350,25 +355,25 @@ ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, ACE_Message_Block *db; // Try to create a data block that contains the user-supplied data. - ACE_NEW_RETURN (db, ACE_Message_Block (sizeof (int), - ACE_Message_Block::MB_IOCTL, - 0, - (char *) a), -1); + ACE_NEW_RETURN (db, ACE_Message_Block (sizeof (int), + ACE_Message_Block::MB_IOCTL, + 0, + (char *) a), -1); // Try to create a control block <cb> that contains the control // field and a pointer to the data block <db> in <cb>'s continuation // field. - ACE_Message_Block *cb = - new ACE_Message_Block (sizeof ioc, - ACE_Message_Block::MB_IOCTL, - db, - (char *) &ioc); + ACE_Message_Block *cb = + new ACE_Message_Block (sizeof ioc, + ACE_Message_Block::MB_IOCTL, + db, + (char *) &ioc); // If we can't allocate <cb> then we need to delete db and return // -1. if (cb == 0) { - db->release (); + db->release (); errno = ENOMEM; return -1; } @@ -406,7 +411,7 @@ ACE_Stream<ACE_SYNCH_USE>::link_i (ACE_Stream<ACE_SYNCH_USE> &us) if (my_tail == 0) return -1; - // Locate the module just above our Stream tail. + // Locate the module just above our Stream tail. while (my_tail->next () != this->stream_tail_) my_tail = my_tail->next (); @@ -429,11 +434,11 @@ template <ACE_SYNCH_DECL> int ACE_Stream<ACE_SYNCH_USE>::link (ACE_Stream<ACE_SYNCH_USE> &us) { ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::link"); - + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->link_i (us); -} +} // Must be called with locks held... @@ -450,27 +455,27 @@ ACE_Stream<ACE_SYNCH_USE>::unlink_i (void) // Only relink if we still exist! if (my_tail) - { - // Find the module that's just before our stream tail. - while (my_tail->next () != this->stream_tail_) - my_tail = my_tail->next (); + { + // Find the module that's just before our stream tail. + while (my_tail->next () != this->stream_tail_) + my_tail = my_tail->next (); - // Restore the writer's next() link to our tail. - my_tail->writer ()->next (this->stream_tail_->writer ()); - } + // Restore the writer's next() link to our tail. + my_tail->writer ()->next (this->stream_tail_->writer ()); + } - ACE_Module<ACE_SYNCH_USE> *other_tail = - this->linked_us_->stream_head_; + ACE_Module<ACE_SYNCH_USE> *other_tail = + this->linked_us_->stream_head_; // Only fiddle with the other side if it in fact still remains. if (other_tail != 0) - { - while (other_tail->next () != this->linked_us_->stream_tail_) - other_tail = other_tail->next (); + { + while (other_tail->next () != this->linked_us_->stream_tail_) + other_tail = other_tail->next (); - other_tail->writer ()->next (this->linked_us_->stream_tail_->writer ()); + other_tail->writer ()->next (this->linked_us_->stream_tail_->writer ()); - } + } // Make sure the other side is also aware that it's been unlinked! this->linked_us_->linked_us_ = 0; @@ -491,8 +496,8 @@ ACE_Stream<ACE_SYNCH_USE>::unlink (void) } template <ACE_SYNCH_DECL> -ACE_Stream<ACE_SYNCH_USE>::ACE_Stream (void * a, - ACE_Module<ACE_SYNCH_USE> *head, +ACE_Stream<ACE_SYNCH_USE>::ACE_Stream (void * a, + ACE_Module<ACE_SYNCH_USE> *head, ACE_Module<ACE_SYNCH_USE> *tail) : linked_us_ (0), final_close_ (this->lock_) @@ -500,8 +505,8 @@ ACE_Stream<ACE_SYNCH_USE>::ACE_Stream (void * a, ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::ACE_Stream"); if (this->open (a, head, tail) == -1) ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("ACE_Stream<ACE_SYNCH_USE>::open (%s, %s)\n"), - head->name (), tail->name ())); + ASYS_TEXT ("ACE_Stream<ACE_SYNCH_USE>::open (%s, %s)\n"), + head->name (), tail->name ())); } template <ACE_SYNCH_DECL> diff --git a/ace/Stream_Modules.cpp b/ace/Stream_Modules.cpp index e7f2ca9b948..e5ae4f3243d 100644 --- a/ace/Stream_Modules.cpp +++ b/ace/Stream_Modules.cpp @@ -1,12 +1,16 @@ // Stream_Modules.cpp // $Id$ -#if !defined (ACE_STREAM_MODULES_C) +#ifndef ACE_STREAM_MODULES_C #define ACE_STREAM_MODULES_C #define ACE_BUILD_DLL #include "ace/Stream_Modules.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Stream_Modules.i" #endif /* __ACE_INLINE__ */ @@ -15,14 +19,14 @@ ACE_RCSID(ace, Stream_Modules, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Head) -template <ACE_SYNCH_DECL> -ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head (void) { ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head"); } -template <ACE_SYNCH_DECL> -ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head (void) { ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head"); } @@ -97,9 +101,9 @@ ACE_Stream_Head<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb) return 0; } -template <ACE_SYNCH_DECL> int -ACE_Stream_Head<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, - ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, + ACE_Time_Value *tv) { ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::put"); int res = 0; @@ -110,33 +114,33 @@ ACE_Stream_Head<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, if (this->is_writer ()) return this->put_next (mb, tv); - else // this->is_reader () - { + else // this->is_reader () + { switch (mb->msg_type ()) - { - case ACE_Message_Block::MB_FLUSH: - return this->canonical_flush (mb); - default: - break; - } - + { + case ACE_Message_Block::MB_FLUSH: + return this->canonical_flush (mb); + default: + break; + } + return this->putq (mb, tv); } } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream_Head<ACE_SYNCH_USE>::init (int, ASYS_TCHAR *[]) { ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::init"); return 0; } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream_Head<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, size_t length) const { ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::info"); const ASYS_TCHAR *name = this->name (); - + if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0) return -1; else @@ -144,7 +148,7 @@ ACE_Stream_Head<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, size_t length) const return ACE_OS::strlen (name); } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream_Head<ACE_SYNCH_USE>::fini (void) { ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::fini"); @@ -153,14 +157,14 @@ ACE_Stream_Head<ACE_SYNCH_USE>::fini (void) ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Tail) -template <ACE_SYNCH_DECL> -ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail (void) { ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail"); } -template <ACE_SYNCH_DECL> -ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail (void) { ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail"); } @@ -198,18 +202,18 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::control (ACE_Message_Block *mb) ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::control"); ACE_IO_Cntl_Msg *ioc = (ACE_IO_Cntl_Msg *) mb->rd_ptr (); ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd; - + switch (cmd = ioc->cmd ()) { case ACE_IO_Cntl_Msg::SET_LWM: case ACE_IO_Cntl_Msg::SET_HWM: { - size_t wm_size = *(size_t *) mb->cont ()->rd_ptr (); + size_t wm_size = *(size_t *) mb->cont ()->rd_ptr (); - this->water_marks (cmd, wm_size); - this->sibling ()->water_marks (cmd, wm_size); - ioc->rval (0); - break; + this->water_marks (cmd, wm_size); + this->sibling ()->water_marks (cmd, wm_size); + ioc->rval (0); + break; } default: mb->msg_type (ACE_Message_Block::MB_IOCNAK); @@ -242,40 +246,40 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb) return 0; } -template <ACE_SYNCH_DECL> int -ACE_Stream_Tail<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, - ACE_Time_Value *) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, + ACE_Time_Value *) { ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::put"); if (this->is_writer ()) { switch (mb->msg_type ()) - { - case ACE_Message_Block::MB_IOCTL: - return this->control (mb); - /* NOTREACHED */ - default: - mb->release (); - } + { + case ACE_Message_Block::MB_IOCTL: + return this->control (mb); + /* NOTREACHED */ + default: + mb->release (); + } } return -1; } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream_Tail<ACE_SYNCH_USE>::init (int, ASYS_TCHAR *[]) { ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::init"); return 0; } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream_Tail<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, size_t length) const { ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::info"); const ASYS_TCHAR *name = this->name (); - + if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0) return -1; else @@ -283,7 +287,7 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, size_t length) const return ACE_OS::strlen (name); } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Stream_Tail<ACE_SYNCH_USE>::fini (void) { ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::fini"); @@ -292,14 +296,14 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::fini (void) ACE_ALLOC_HOOK_DEFINE(ACE_Thru_Task) -template <ACE_SYNCH_DECL> -ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task (void) +template <ACE_SYNCH_DECL> +ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task (void) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task"); } -template <ACE_SYNCH_DECL> -ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task (void) +template <ACE_SYNCH_DECL> +ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task (void) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task"); } @@ -310,18 +314,18 @@ ACE_Thru_Task<ACE_SYNCH_USE>::dump (void) const ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::dump"); } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Thru_Task<ACE_SYNCH_USE>::open (void *) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::open"); - return 0; + return 0; } template <ACE_SYNCH_DECL> int ACE_Thru_Task<ACE_SYNCH_USE>::close (u_long) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::close"); - return 0; + return 0; } template <ACE_SYNCH_DECL> int @@ -331,28 +335,28 @@ ACE_Thru_Task<ACE_SYNCH_USE>::svc (void) return -1; } -template <ACE_SYNCH_DECL> int -ACE_Thru_Task<ACE_SYNCH_USE>::put (ACE_Message_Block *msg, - ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::put (ACE_Message_Block *msg, + ACE_Time_Value *tv) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::put"); return this->put_next (msg, tv); } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Thru_Task<ACE_SYNCH_USE>::init (int, ASYS_TCHAR *[]) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::init"); return 0; } -template <ACE_SYNCH_DECL> int -ACE_Thru_Task<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, size_t length) const { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::info"); const ASYS_TCHAR *name = this->name (); - + if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0) return -1; else @@ -360,7 +364,7 @@ ACE_Thru_Task<ACE_SYNCH_USE>::info (ASYS_TCHAR **strp, return ACE_OS::strlen (name); } -template <ACE_SYNCH_DECL> int +template <ACE_SYNCH_DECL> int ACE_Thru_Task<ACE_SYNCH_USE>::fini (void) { ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::fini"); diff --git a/ace/Svc_Handler.cpp b/ace/Svc_Handler.cpp index 04bd000d9c3..043eda0f9bb 100644 --- a/ace/Svc_Handler.cpp +++ b/ace/Svc_Handler.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_SVC_HANDLER_C) +#ifndef ACE_SVC_HANDLER_C #define ACE_SVC_HANDLER_C #define ACE_BUILD_DLL #include "ace/Svc_Handler.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Object_Manager.h" #include "ace/Strategies.h" @@ -167,7 +172,7 @@ template <PR_ST_1, ACE_SYNCH_DECL> void ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::cleanup_hint (void) { ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::shutdown"); - + // Remove as hint. if (this->recycler ()) this->recycler ()->cleanup_hint (this->recycling_act_); diff --git a/ace/Synch.cpp b/ace/Synch.cpp index 971418ab12e..dec617eae8b 100644 --- a/ace/Synch.cpp +++ b/ace/Synch.cpp @@ -1,11 +1,16 @@ // Synch.cpp // $Id$ -#if !defined (ACE_SYNCH_C) +#ifndef ACE_SYNCH_C #define ACE_SYNCH_C #define ACE_BUILD_DLL #include "ace/Thread.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Synch_T.h" #include "ace/Synch.h" #include "ace/Object_Manager.h" diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp index 3f45e220759..d72e8b2452c 100644 --- a/ace/Synch_T.cpp +++ b/ace/Synch_T.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_SYNCH_T_C) +#ifndef ACE_SYNCH_T_C #define ACE_SYNCH_T_C #define ACE_BUILD_DLL #include "ace/Thread.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Synch_T.h" #include "ace/Log_Msg.h" diff --git a/ace/Task_T.cpp b/ace/Task_T.cpp index 1dbd5c24c42..b6425369a05 100644 --- a/ace/Task_T.cpp +++ b/ace/Task_T.cpp @@ -1,11 +1,16 @@ // Task.cpp // $Id$ -#if !defined (ACE_TASK_T_C) +#ifndef ACE_TASK_T_C #define ACE_TASK_T_C #define ACE_BUILD_DLL #include "ace/Task_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Module.h" #include "ace/Service_Config.h" @@ -39,9 +44,9 @@ ACE_Task<ACE_SYNCH_USE>::dump (void) const // allocate one dynamically. Otherwise, we'll use the one they give. template<ACE_SYNCH_DECL> -ACE_Task<ACE_SYNCH_USE>::ACE_Task (ACE_Thread_Manager *thr_man, +ACE_Task<ACE_SYNCH_USE>::ACE_Task (ACE_Thread_Manager *thr_man, ACE_Message_Queue<ACE_SYNCH_USE> *mq) - : ACE_Task_Base (thr_man), + : ACE_Task_Base (thr_man), msg_queue_ (0), delete_msg_queue_ (0), mod_ (0), diff --git a/ace/Timeprobe_T.cpp b/ace/Timeprobe_T.cpp index 31c70148d17..c74c2463860 100644 --- a/ace/Timeprobe_T.cpp +++ b/ace/Timeprobe_T.cpp @@ -1,10 +1,14 @@ // $Id$ -#if !defined (ACE_TIMEPROBE_T_C) +#ifndef ACE_TIMEPROBE_T_C #define ACE_TIMEPROBE_T_C #include "ace/OS.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Timeprobe_T, "$Id$") #if defined (ACE_COMPILE_TIMEPROBES) @@ -37,9 +41,9 @@ ACE_Timeprobe<ACE_LOCK>::ACE_Timeprobe (const ACE_Timeprobe<ACE_LOCK> &) // Stupid MSVC is forcing me to define this; please don't use it. // - ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("ACE_NOTSUP: %s, line %d\n"), __FILE__, __LINE__)); - errno = ENOTSUP; + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("ACE_NOTSUP: %s, line %d\n"), __FILE__, __LINE__)); + errno = ENOTSUP; } template <class ACE_LOCK> diff --git a/ace/Timer_Hash_T.cpp b/ace/Timer_Hash_T.cpp index 185bb48796b..d6d8e2b3921 100644 --- a/ace/Timer_Hash_T.cpp +++ b/ace/Timer_Hash_T.cpp @@ -1,11 +1,16 @@ // $Id$ -#if !defined (ACE_TIMER_HASH_T_C) +#ifndef ACE_TIMER_HASH_T_C #define ACE_TIMER_HASH_T_C #define ACE_BUILD_DLL #include "ace/Timer_Hash_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/High_Res_Timer.h" ACE_RCSID(ace, Timer_Hash_T, "$Id$") @@ -43,8 +48,8 @@ ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Hash_Upcall (ACE_Timer template <class TYPE, class FUNCTOR, class ACE_LOCK> int ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::timeout (ACE_Timer_Queue_T<ACE_Event_Handler *, - ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, - ACE_Null_Mutex> &timer_queue, + ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, + ACE_Null_Mutex> &timer_queue, ACE_Event_Handler *handler, const void *arg, const ACE_Time_Value &cur_time) @@ -66,8 +71,8 @@ ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::timeout (ACE_Timer_Queue_T<ACE_E template <class TYPE, class FUNCTOR, class ACE_LOCK> int ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::cancellation (ACE_Timer_Queue_T<ACE_Event_Handler *, - ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, - ACE_Null_Mutex> &timer_queue, + ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, + ACE_Null_Mutex> &timer_queue, ACE_Event_Handler *handler) { ACE_UNUSED_ARG (timer_queue); @@ -80,8 +85,8 @@ ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::cancellation (ACE_Timer_Queue_T< template <class TYPE, class FUNCTOR, class ACE_LOCK> int ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::deletion (ACE_Timer_Queue_T<ACE_Event_Handler *, - ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, - ACE_Null_Mutex> &timer_queue, + ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, + ACE_Null_Mutex> &timer_queue, ACE_Event_Handler *handler, const void *arg) { @@ -316,9 +321,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::reschedule (ACE_Timer_Node_T< template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> long ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval) + const void *act, + const ACE_Time_Value &future_time, + const ACE_Time_Value &interval) { ACE_TRACE ("ACE_Timer_Hash_T::schedule"); ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); @@ -346,8 +351,8 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::schedule (const TYPE &type, template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> int ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (long timer_id, - const void **act, - int dont_call) + const void **act, + int dont_call) { ACE_TRACE ("ACE_Timer_Hash_T::cancel"); ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); @@ -363,7 +368,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (long timer_id, if (h->pos_ == this->earliest_position_) this->find_new_earliest (); - + if (act != 0) *act = h->act_; @@ -379,7 +384,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (long timer_id, template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> int ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (const TYPE &type, - int dont_call) + int dont_call) { ACE_TRACE ("ACE_Timer_Hash_T::cancel"); @@ -445,9 +450,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::find_new_earliest (void) for (size_t i = 0; i < this->table_size_; i++) if (!this->table_[i]->is_empty ()) if (this->table_[this->earliest_position_]->is_empty() - || this->earliest_time () == ACE_Time_Value::zero - || this->table_[i]->earliest_time () <= this->earliest_time ()) - this->earliest_position_ = i; + || this->earliest_time () == ACE_Time_Value::zero + || this->table_[i]->earliest_time () <= this->earliest_time ()) + this->earliest_position_ = i; } @@ -501,18 +506,18 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::expire (const ACE_Time_Value // Check if this is an interval timer. if (expired->get_interval () > ACE_Time_Value::zero) - { - // Make sure that we skip past values that have already - // "expired". - do - expired->set_timer_value (expired->get_timer_value () + expired->get_interval ()); - while (expired->get_timer_value () <= cur_time); - - // Since this is an interval timer, we need to reschedule - // it. - this->reschedule (expired); - reclaim = 0; - } + { + // Make sure that we skip past values that have already + // "expired". + do + expired->set_timer_value (expired->get_timer_value () + expired->get_interval ()); + while (expired->get_timer_value () <= cur_time); + + // Since this is an interval timer, we need to reschedule + // it. + this->reschedule (expired); + reclaim = 0; + } // call the functor Hash_Token *h = (Hash_Token *)act; @@ -521,7 +526,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::expire (const ACE_Time_Value if (reclaim) { // Free up the node and the token - this->free_node (expired); + this->free_node (expired); delete h; } diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index 21c82bbe99d..7ab0fa8e030 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -1,12 +1,16 @@ // $Id$ -#if !defined (ACE_TIMER_HEAP_T_C) +#ifndef ACE_TIMER_HEAP_T_C #define ACE_TIMER_HEAP_T_C #define ACE_BUILD_DLL #include "ace/Timer_Heap_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Timer_Heap_T, "$Id$") // Define some simple macros to clarify the code. diff --git a/ace/Timer_List_T.cpp b/ace/Timer_List_T.cpp index 14160bc5e14..73aba79ea01 100644 --- a/ace/Timer_List_T.cpp +++ b/ace/Timer_List_T.cpp @@ -1,12 +1,16 @@ // $Id$ -#if !defined (ACE_TIMER_LIST_T_C) +#ifndef ACE_TIMER_LIST_T_C #define ACE_TIMER_LIST_T_C #define ACE_BUILD_DLL #include "ace/Timer_List_T.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_RCSID(ace, Timer_List_T, "$Id$") // Default Constructor diff --git a/ace/Timer_Queue_Adapters.cpp b/ace/Timer_Queue_Adapters.cpp index 01f7de4dcb8..1a91e1cf1bd 100644 --- a/ace/Timer_Queue_Adapters.cpp +++ b/ace/Timer_Queue_Adapters.cpp @@ -3,7 +3,11 @@ #define ACE_BUILD_DLL #include "ace/Timer_Queue_Adapters.h" -#if !defined (ACE_TIMER_QUEUE_ADAPTERS_C) +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#ifndef ACE_TIMER_QUEUE_ADAPTERS_C # define ACE_TIMER_QUEUE_ADAPTERS_C ACE_RCSID(ace, Timer_Queue_Adapters, "$Id$") @@ -261,16 +265,16 @@ ACE_Thread_Timer_Queue_Adapter<TQ>::svc (void) // Enqueues a command object for execution just before waiting on the next // timer event. This allows deferred execution of commands that cannot -// be performed in the timer event handler context, such as registering +// be performed in the timer event handler context, such as registering // or cancelling timers on platforms where the timer queue mutex is not // recursive. template<class TQ> int -ACE_Thread_Timer_Queue_Adapter<TQ>::enqueue_command (ACE_Command_Base *cmd, +ACE_Thread_Timer_Queue_Adapter<TQ>::enqueue_command (ACE_Command_Base *cmd, COMMAND_ENQUEUE_POSITION pos) -{ +{ // Serialize access to the command queue. - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->command_mutex_, -1); if (pos == ACE_Thread_Timer_Queue_Adapter<TQ>::TAIL) @@ -284,14 +288,14 @@ ACE_Thread_Timer_Queue_Adapter<TQ>::enqueue_command (ACE_Command_Base *cmd, } -// Dispatches all command objects enqueued in the most +// Dispatches all command objects enqueued in the most // recent event handler context. template<class TQ> int ACE_Thread_Timer_Queue_Adapter<TQ>::dispatch_commands (void) { // Serialize access to the command queue. - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->command_mutex_, -1); // loop through the enqueued commands diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp index 2296d251d64..86ec13c0a3c 100644 --- a/ace/Timer_Queue_T.cpp +++ b/ace/Timer_Queue_T.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (ACE_TIMER_QUEUE_T_C) +#ifndef ACE_TIMER_QUEUE_T_C #define ACE_TIMER_QUEUE_T_C #define ACE_BUILD_DLL #include "ace/Synch.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Signal.h" #include "ace/Timer_Queue_T.h" @@ -28,24 +33,24 @@ ACE_Timer_Node_T<TYPE>::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } -template <class TYPE> +template <class TYPE> ACE_Timer_Node_T<TYPE>::ACE_Timer_Node_T (void) { ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T"); } -template <class TYPE> +template <class TYPE> ACE_Timer_Node_T<TYPE>::~ACE_Timer_Node_T (void) { ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T"); } -template <class TYPE, class FUNCTOR, class ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_Iterator_T (void) { } -template <class TYPE, class FUNCTOR, class ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Queue_Iterator_T (void) { } @@ -63,10 +68,10 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m { ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, max_wait_time)); - + if (this->is_empty ()) // Nothing on the Timer_Queue, so use whatever the caller gave us. - return max_wait_time; + return max_wait_time; else { ACE_Time_Value cur_time = this->gettimeofday (); @@ -84,7 +89,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m else return max_wait_time; } - else + else { // The earliest item on the Timer_Queue is now in the past. // Therefore, we've got to "poll" the Reactor, i.e., it must @@ -100,7 +105,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m ACE_Time_Value *the_timeout) { ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); - + if (the_timeout == 0) return 0; @@ -127,7 +132,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m if (!(max_wait_time == 0 || *max_wait_time > *the_timeout)) *the_timeout = *max_wait_time; } - else + else { // The earliest item on the Timer_Queue is now in the past. // Therefore, we've got to "poll" the Reactor, i.e., it must @@ -145,11 +150,11 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->timeout_.dump (); this->timer_skew_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } -template <class TYPE, class FUNCTOR, class ACE_LOCK> -ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_T (FUNCTOR *upcall_functor, +template <class TYPE, class FUNCTOR, class ACE_LOCK> +ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_T (FUNCTOR *upcall_functor, ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist) : free_list_ (freelist == 0 ? new ACE_Locked_Free_List<ACE_Timer_Node_T <TYPE>, ACE_Null_Mutex> : freelist), gettimeofday_ (ACE_OS::gettimeofday), @@ -161,7 +166,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_T (FUNCTOR *upcall_f ACE_TRACE ("ACE_Timer_Queue_T::ACE_Timer_Queue_T"); } -template <class TYPE, class FUNCTOR, class ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Queue_T (void) { ACE_TRACE ("ACE_Timer_Queue_T::~ACE_Timer_Queue_T"); @@ -180,7 +185,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::alloc_node (void) return this->free_list_->remove (); } -template <class TYPE, class FUNCTOR, class ACE_LOCK> void +template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::free_node (ACE_Timer_Node_T<TYPE> *node) { this->free_list_->add (node); @@ -217,7 +222,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value &cur_ti TYPE &type = expired->get_type (); const void *act = expired->get_act (); int reclaim = 1; - + // Check if this is an interval timer. if (expired->get_interval () > ACE_Time_Value::zero) { @@ -232,14 +237,14 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value &cur_ti this->reschedule (expired); reclaim = 0; } - + // call the functor this->upcall (type, act, cur_time); - + if (reclaim) // Call the factory method to free up the node. this->free_node (expired); - + number_of_timers_expired++; if (this->is_empty ()) @@ -250,7 +255,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value &cur_ti } -template <class TYPE, class FUNCTOR, class ACE_LOCK> void +template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::return_node (ACE_Timer_Node_T<TYPE> *node) { ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); @@ -269,8 +274,8 @@ ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::~ACE_Event_Handler_Handle_Tim } template <class ACE_LOCK> int -ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::timeout (ACE_Timer_Queue_T<ACE_Event_Handler *, - ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>, +ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::timeout (ACE_Timer_Queue_T<ACE_Event_Handler *, + ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>, ACE_LOCK> &timer_queue, ACE_Event_Handler *handler, const void *act, @@ -278,28 +283,28 @@ ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::timeout (ACE_Timer_Queue_T<AC { // Upcall to the <handler>s handle_timeout method if (handler->handle_timeout (cur_time, act) == -1) - timer_queue.cancel (handler, 0); // 0 means "call handle_close()". - + timer_queue.cancel (handler, 0); // 0 means "call handle_close()". + return 0; } template <class ACE_LOCK> int -ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::cancellation (ACE_Timer_Queue_T<ACE_Event_Handler *, - ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>, +ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::cancellation (ACE_Timer_Queue_T<ACE_Event_Handler *, + ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>, ACE_LOCK> &timer_queue, ACE_Event_Handler *handler) { ACE_UNUSED_ARG (timer_queue); // Upcall to the <handler>s handle_close method - handler->handle_close (ACE_INVALID_HANDLE, + handler->handle_close (ACE_INVALID_HANDLE, ACE_Event_Handler::TIMER_MASK); return 0; } template <class ACE_LOCK> int -ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::deletion (ACE_Timer_Queue_T<ACE_Event_Handler *, - ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>, +ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::deletion (ACE_Timer_Queue_T<ACE_Event_Handler *, + ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>, ACE_LOCK> &timer_queue, ACE_Event_Handler *handler, const void *arg) @@ -309,7 +314,7 @@ ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::deletion (ACE_Timer_Queue_T<A ACE_UNUSED_ARG (arg); // Does nothing - + return 0; } diff --git a/ace/Timer_Wheel_T.cpp b/ace/Timer_Wheel_T.cpp index 53e1fac34e2..c654cd7d616 100644 --- a/ace/Timer_Wheel_T.cpp +++ b/ace/Timer_Wheel_T.cpp @@ -1,11 +1,16 @@ // $Id$ -#if !defined (ACE_TIMER_WHEEL_T_C) +#ifndef ACE_TIMER_WHEEL_T_C #define ACE_TIMER_WHEEL_T_C #define ACE_BUILD_DLL #include "ace/Timer_Wheel_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/High_Res_Timer.h" ACE_RCSID(ace, Timer_Wheel_T, "$Id$") @@ -566,7 +571,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value &cur_ti } while (this->wheel_[earliest]->get_next () != this->wheel_[earliest] - && this->wheel_[earliest]->get_next ()->get_timer_value () <= next_earliest_time) + && this->wheel_[earliest]->get_next ()->get_timer_value () <= next_earliest_time) { // Remove the first node in the earliest position ACE_Timer_Node_T<TYPE> *expired = this->wheel_[earliest]->get_next (); diff --git a/ace/Typed_SV_Message.cpp b/ace/Typed_SV_Message.cpp index 15eefb8dc8b..25296332120 100644 --- a/ace/Typed_SV_Message.cpp +++ b/ace/Typed_SV_Message.cpp @@ -1,11 +1,15 @@ // Typed_SV_Message.cpp // $Id$ -#if !defined (ACE_TYPED_SV_MESSAGE_C) +#ifndef ACE_TYPED_SV_MESSAGE_C #define ACE_TYPED_SV_MESSAGE_C #define ACE_BUILD_DLL #include "ace/Typed_SV_Message.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #if !defined (__ACE_INLINE__) #include "ace/Typed_SV_Message.i" #endif /* __ACE_INLINE__ */ diff --git a/ace/Typed_SV_Message_Queue.cpp b/ace/Typed_SV_Message_Queue.cpp index d9c831e6257..927f2d15807 100644 --- a/ace/Typed_SV_Message_Queue.cpp +++ b/ace/Typed_SV_Message_Queue.cpp @@ -1,11 +1,16 @@ // Typed_SV_Message_Queue.cpp // $Id$ -#if !defined (ACE_TYPED_SV_MESSAGE_QUEUE_C) +#ifndef ACE_TYPED_SV_MESSAGE_QUEUE_C #define ACE_TYPED_SV_MESSAGE_QUEUE_C #define ACE_BUILD_DLL #include "ace/Typed_SV_Message.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Typed_SV_Message_Queue.h" #if !defined (__ACE_INLINE__) @@ -29,14 +34,14 @@ ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void) } template <class T> -ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id, - int create, - int perms) +ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id, + int create, + int perms) { ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue"); if (this->open (external_id, create, perms) == -1) - ACE_ERROR ((LM_ERROR, - "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue")); + ACE_ERROR ((LM_ERROR, + "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue")); } template <class T> diff --git a/apps/Gateway/Gateway/File_Parser.cpp b/apps/Gateway/Gateway/File_Parser.cpp index be15adfd2f1..6f248e6762d 100644 --- a/apps/Gateway/Gateway/File_Parser.cpp +++ b/apps/Gateway/Gateway/File_Parser.cpp @@ -1,10 +1,15 @@ // $Id$ -#if !defined (FILE_PARSER_C) +#ifndef FILE_PARSER_C #define FILE_PARSER_C #include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "File_Parser.h" ACE_RCSID(Gateway, File_Parser, "$Id$") @@ -16,7 +21,7 @@ typedef FP::Return_Type FP_RETURN_TYPE; // File_Parser stuff. template <class ENTRY> int -File_Parser<ENTRY>::open (const char filename[]) +File_Parser<ENTRY>::open (const char filename[]) { this->infile_ = ACE_OS::fopen (filename, "r"); if (this->infile_ == 0) @@ -27,8 +32,8 @@ File_Parser<ENTRY>::open (const char filename[]) template <class ENTRY> int File_Parser<ENTRY>::close (void) -{ - return ACE_OS::fclose (this->infile_); +{ + return ACE_OS::fclose (this->infile_); } template <class ENTRY> FP_RETURN_TYPE @@ -75,7 +80,7 @@ File_Parser<ENTRY>::getint (ACE_INT32 &value) else return read_result; } - + template <class ENTRY> FP_RETURN_TYPE File_Parser<ENTRY>::readword (char buf[]) @@ -88,9 +93,9 @@ File_Parser<ENTRY>::readword (char buf[]) while ((c = getc (this->infile_)) != EOF && c != '\n') if (this->delimiter (c)) { - // We've reached the end of a "word". - if (wordlength > 0) - break; + // We've reached the end of a "word". + if (wordlength > 0) + break; } else buf[wordlength++] = c; @@ -100,10 +105,10 @@ File_Parser<ENTRY>::readword (char buf[]) if (c == EOF) { // If EOF is just a delimiter, don't return EOF so that the word // gets processed. - if (wordlength > 0) + if (wordlength > 0) { - ungetc (c, this->infile_); - return FP::SUCCESS; + ungetc (c, this->infile_); + return FP::SUCCESS; } else // else return EOF so that read loops stop @@ -114,18 +119,18 @@ File_Parser<ENTRY>::readword (char buf[]) // if the EOLINE is just a delimiter, don't return EOLINE // so that the word gets processed if (wordlength > 0) - ungetc (c, this->infile_); + ungetc (c, this->infile_); else - return FP::EOLINE; + return FP::EOLINE; } // Skip comments. - if (this->comments (buf[0])) + if (this->comments (buf[0])) { if (this->skipline () == EOF) - return FP::EOFILE; + return FP::EOFILE; else - return FP::COMMENT; + return FP::COMMENT; } else return FP::SUCCESS; @@ -148,7 +153,7 @@ File_Parser<ENTRY>::skipline (void) { // Skip the remainder of the line. - int c; + int c; while ((c = getc (this->infile_)) != '\n' && c != EOF) continue; diff --git a/apps/JAWS/PROTOTYPE/JAWS/Assoc_Array.cpp b/apps/JAWS/PROTOTYPE/JAWS/Assoc_Array.cpp index a92ec225e6a..0360fad6beb 100644 --- a/apps/JAWS/PROTOTYPE/JAWS/Assoc_Array.cpp +++ b/apps/JAWS/PROTOTYPE/JAWS/Assoc_Array.cpp @@ -1,9 +1,14 @@ // $Id$ -#if !defined (JAWS_ASSOC_ARRAY_CPP) +#ifndef JAWS_ASSOC_ARRAY_CPP #define JAWS_ASSOC_ARRAY_CPP #include "ace/inc_user_config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "JAWS/Assoc_Array.h" ACE_RCSID(JAWS, Assoc_Array, "$Id$") diff --git a/apps/JAWS/PROTOTYPE/JAWS/Pipeline_Handler.cpp b/apps/JAWS/PROTOTYPE/JAWS/Pipeline_Handler.cpp index f2a65bc8344..9d640c287b6 100644 --- a/apps/JAWS/PROTOTYPE/JAWS/Pipeline_Handler.cpp +++ b/apps/JAWS/PROTOTYPE/JAWS/Pipeline_Handler.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (JAWS_PIPELINE_HANDLER_CPP) +#ifndef JAWS_PIPELINE_HANDLER_CPP #define JAWS_PIPELINE_HANDLER_CPP #include "JAWS/Pipeline_Handler.h" diff --git a/apps/JAWS/clients/Caching/URL_Array_Helper.cpp b/apps/JAWS/clients/Caching/URL_Array_Helper.cpp index c4e832a42a0..c8dbb55e197 100644 --- a/apps/JAWS/clients/Caching/URL_Array_Helper.cpp +++ b/apps/JAWS/clients/Caching/URL_Array_Helper.cpp @@ -2,7 +2,7 @@ // URL_Array_Helper.cpp -#if !defined (ACE_URL_ARRAY_HELPER_C) +#ifndef ACE_URL_ARRAY_HELPER_C #define ACE_URL_ARRAY_HELPER_C #include "URL_Array_Helper.h" diff --git a/apps/JAWS/server/JAWS_Pipeline_Handler.cpp b/apps/JAWS/server/JAWS_Pipeline_Handler.cpp index a60591bd071..da5605558a2 100644 --- a/apps/JAWS/server/JAWS_Pipeline_Handler.cpp +++ b/apps/JAWS/server/JAWS_Pipeline_Handler.cpp @@ -1,6 +1,6 @@ // $Id$ -#if !defined (JAWS_PIPELINE_HANDLER_CPP) +#ifndef JAWS_PIPELINE_HANDLER_CPP #define JAWS_PIPELINE_HANDLER_CPP #include "JAWS_Pipeline_Handler.h" @@ -15,7 +15,7 @@ JAWS_Pipeline_Handler<TYPE>::JAWS_Pipeline_Handler (void) template <class TYPE> int JAWS_Pipeline_Handler<TYPE>::put (ACE_Message_Block *mb, ACE_Time_Value *tv) { - TYPE *data = ACE_dynamic_cast (TYPE *, + TYPE *data = ACE_dynamic_cast (TYPE *, mb->data_block ()); int status = this->handle_input (data, tv); diff --git a/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp b/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp index 31390085b2f..b71bf41a8c6 100644 --- a/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp +++ b/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp @@ -23,7 +23,7 @@ // // ============================================================================ -#if !defined (_BPR_DRIVER_T_CPP_) +#ifndef _BPR_DRIVER_T_CPP_ #define _BPR_DRIVER_T_CPP_ // #include BPR_Drivers.h instead of BPR_Drivers_T.h diff --git a/netsvcs/lib/Server_Logging_Handler_T.cpp b/netsvcs/lib/Server_Logging_Handler_T.cpp index 1be3eee1d9b..1c8f6fb9648 100644 --- a/netsvcs/lib/Server_Logging_Handler_T.cpp +++ b/netsvcs/lib/Server_Logging_Handler_T.cpp @@ -1,11 +1,16 @@ // $Id$ -#if !defined (ACE_SERVER_LOGGING_HANDLERT_C) +#ifndef ACE_SERVER_LOGGING_HANDLERT_C #define ACE_SERVER_LOGGING_HANDLERT_C #define ACE_BUILD_SVC_DLL #include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Get_Opt.h" #include "Server_Logging_Handler_T.h" |