diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2021-02-25 11:14:12 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2021-02-25 11:14:12 +0100 |
commit | 23b2fc3441d82e141e33428fafe094269eb1d392 (patch) | |
tree | bbd21e56e9432b1639508d72e496c40d7514f938 | |
parent | 3ee40a3fef0cdd8a2ce86531a2e78cb218608023 (diff) | |
download | ATCD-23b2fc3441d82e141e33428fafe094269eb1d392.tar.gz |
Use nullptr and cleanup
* TAO/tao/AnyTypeCode/NVList.inl:
* TAO/tao/AnyTypeCode/TypeCode.inl:
* TAO/tao/CORBA_methods.h:
* TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp:
* TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h:
* TAO/tao/DynamicInterface/Context.cpp:
* TAO/tao/DynamicInterface/Context.h:
* TAO/tao/DynamicInterface/Context.inl:
* TAO/tao/DynamicInterface/DII_Reply_Handler.cpp:
* TAO/tao/DynamicInterface/DII_Reply_Handler.h:
* TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp:
* TAO/tao/DynamicInterface/ExceptionList.cpp:
* TAO/tao/DynamicInterface/ExceptionList.h:
* TAO/tao/DynamicInterface/ExceptionList.inl:
* TAO/tao/DynamicInterface/Request.cpp:
* TAO/tao/DynamicInterface/Request.h:
* TAO/tao/DynamicInterface/Request.inl:
* TAO/tao/DynamicInterface/Server_Request.cpp:
* TAO/tao/DynamicInterface/Server_Request.h:
* TAO/tao/DynamicInterface/Server_Request.inl:
* TAO/tao/Environment.inl:
* TAO/tao/IORTable/IOR_Table_Impl.h:
* TAO/tao/IORTable/Locate_ResponseHandler.cpp:
* TAO/tao/IORTable/Locate_ResponseHandler.h:
* TAO/tao/LocalObject.inl:
* TAO/tao/ORB.inl:
* TAO/tao/Object.inl:
* TAO/tao/PI/ORBInitInfo.h:
* TAO/tao/Principal.h:
* TAO/tao/Principal.inl:
* TAO/tao/RTCORBA/Priority_Mapping_Manager.h:
* TAO/tao/RTCORBA/RT_ProtocolPropertiesC.h:
* TAO/tao/RTScheduling/RTScheduler_Manager.h:
* TAO/tao/Valuetype/AbstractBase.inl:
34 files changed, 130 insertions, 136 deletions
diff --git a/TAO/tao/AnyTypeCode/NVList.inl b/TAO/tao/AnyTypeCode/NVList.inl index 1cbfdfb7241..a00da5e1a22 100644 --- a/TAO/tao/AnyTypeCode/NVList.inl +++ b/TAO/tao/AnyTypeCode/NVList.inl @@ -34,7 +34,7 @@ ACE_INLINE CORBA::NamedValue * CORBA::NamedValue::_duplicate (CORBA::NamedValue * x) { - if (x != 0) + if (x) { x->_incr_refcount (); } @@ -73,7 +73,7 @@ ACE_INLINE CORBA::NVList * CORBA::NVList::_duplicate (CORBA::NVList * x) { - if (x != 0) + if (x) { x->_incr_refcount (); } @@ -83,9 +83,9 @@ CORBA::NVList::_duplicate (CORBA::NVList * x) ACE_INLINE CORBA::NVList * -CORBA::NVList::_nil (void) +CORBA::NVList::_nil () { - return 0; + return nullptr; } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/AnyTypeCode/TypeCode.inl b/TAO/tao/AnyTypeCode/TypeCode.inl index a9317676261..cc0d60185b7 100644 --- a/TAO/tao/AnyTypeCode/TypeCode.inl +++ b/TAO/tao/AnyTypeCode/TypeCode.inl @@ -29,9 +29,9 @@ CORBA::TypeCode::_duplicate (CORBA::TypeCode_ptr tc) } ACE_INLINE CORBA::TypeCode_ptr -CORBA::TypeCode::_nil (void) +CORBA::TypeCode::_nil (nullptr) { - return static_cast<CORBA::TypeCode_ptr> (0); + return nullptr; } ACE_INLINE CORBA::TCKind diff --git a/TAO/tao/CORBA_methods.h b/TAO/tao/CORBA_methods.h index 82fc51f94e2..c7030701405 100644 --- a/TAO/tao/CORBA_methods.h +++ b/TAO/tao/CORBA_methods.h @@ -53,7 +53,7 @@ namespace CORBA template<typename T> inline void release (T x) { - if (x != 0) + if (x) { x->_decr_refcount (); } diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp index 19eae83c9dc..04e5211f63f 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp @@ -306,9 +306,9 @@ TAO_AMH_DSI_Exception_Holder::raise_invoke () // The pseudo-object _nil method. TAO_AMH_DSI_Response_Handler_ptr -TAO_AMH_DSI_Response_Handler::_nil (void) +TAO_AMH_DSI_Response_Handler::_nil () { - return (TAO_AMH_DSI_Response_Handler_ptr) 0; + return nullptr; } diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h index e5960f6dbcb..70abfe5ad7c 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h @@ -244,13 +244,13 @@ public: /// CORBA Object related methods static TAO_AMH_DSI_Response_Handler* _duplicate ( TAO_AMH_DSI_Response_Handler_ptr); - static TAO_AMH_DSI_Response_Handler* _nil (void); + static TAO_AMH_DSI_Response_Handler* _nil (); static TAO_AMH_DSI_Response_Handler* _narrow (CORBA::Object_ptr); static TAO_AMH_DSI_Response_Handler* _unchecked_narrow (CORBA::Object_ptr); protected: /// Return 0. Should never be used. - virtual const char *_interface_repository_id (void) const; + virtual const char *_interface_repository_id () const; /// Simply returns "this" virtual void *_downcast (const char *repository_id); diff --git a/TAO/tao/DynamicInterface/Context.cpp b/TAO/tao/DynamicInterface/Context.cpp index 92f4a4a6161..1ecc267b2de 100644 --- a/TAO/tao/DynamicInterface/Context.cpp +++ b/TAO/tao/DynamicInterface/Context.cpp @@ -10,23 +10,23 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -CORBA::Context::Context (void) +CORBA::Context::Context () : refcount_ (1) { } -CORBA::Context::~Context (void) +CORBA::Context::~Context () { } CORBA::ULong -CORBA::Context::_incr_refcount (void) +CORBA::Context::_incr_refcount () { return ++refcount_; } CORBA::ULong -CORBA::Context::_decr_refcount (void) +CORBA::Context::_decr_refcount () { CORBA::ULong const new_count = --this->refcount_; @@ -141,14 +141,14 @@ CORBA::ContextList::remove (CORBA::ULong) } CORBA::ContextList_ptr -CORBA::ContextList::_duplicate (void) +CORBA::ContextList::_duplicate () { ++this->refcount_; return this; } void -CORBA::ContextList::_destroy (void) +CORBA::ContextList::_destroy () { CORBA::ULong const current = --this->refcount_; @@ -159,13 +159,13 @@ CORBA::ContextList::_destroy (void) } void -CORBA::ContextList::_incr_refcount (void) +CORBA::ContextList::_incr_refcount () { ++this->refcount_; } void -CORBA::ContextList::_decr_refcount (void) +CORBA::ContextList::_decr_refcount () { --this->refcount_; diff --git a/TAO/tao/DynamicInterface/Context.h b/TAO/tao/DynamicInterface/Context.h index dd9eb9cfc5a..39230031607 100644 --- a/TAO/tao/DynamicInterface/Context.h +++ b/TAO/tao/DynamicInterface/Context.h @@ -75,18 +75,18 @@ namespace CORBA // = Pseudo-object methods static Context *_duplicate (Context*); - static Context *_nil (void); + static Context *_nil (); // = Reference counting. - CORBA::ULong _incr_refcount (void); - CORBA::ULong _decr_refcount (void); + CORBA::ULong _incr_refcount (); + CORBA::ULong _decr_refcount (); // = All the spec-required functions below will just throw a // CORBA::NO_IMPLEMENT exception and do nothing else. - const char *context_name (void) const; + const char *context_name () const; - CORBA::Context_ptr parent (void) const; + CORBA::Context_ptr parent () const; void create_child (const char *child_ctx_name, CORBA::Context_out child_ctx); @@ -160,8 +160,8 @@ namespace CORBA void remove (CORBA::ULong slot); /// Increment and decrement ref counts. - void _incr_refcount (void); - void _decr_refcount (void); + void _incr_refcount (); + void _decr_refcount (); // Useful for template programming. typedef CORBA::ContextList_ptr _ptr_type; diff --git a/TAO/tao/DynamicInterface/Context.inl b/TAO/tao/DynamicInterface/Context.inl index d7e2b0a99a3..adc82cb7a4f 100644 --- a/TAO/tao/DynamicInterface/Context.inl +++ b/TAO/tao/DynamicInterface/Context.inl @@ -5,7 +5,7 @@ ACE_INLINE CORBA::Context_ptr CORBA::Context::_duplicate (CORBA::Context_ptr x) { - if (x != 0) + if (x) { x->_incr_refcount (); } @@ -15,9 +15,9 @@ CORBA::Context::_duplicate (CORBA::Context_ptr x) ACE_INLINE CORBA::Context_ptr -CORBA::Context::_nil (void) +CORBA::Context::_nil () { - return (CORBA::Context_ptr)0; + return nullptr; } // ************************************************************* @@ -25,29 +25,29 @@ CORBA::Context::_nil (void) // ************************************************************* ACE_INLINE -CORBA::ContextList::ContextList (void) +CORBA::ContextList::ContextList () { } ACE_INLINE CORBA::ULong -CORBA::ContextList::count (void) +CORBA::ContextList::count () { return (CORBA::ULong) this->ctx_list_.size (); } ACE_INLINE CORBA::ContextList_ptr -CORBA::ContextList::_nil (void) +CORBA::ContextList::_nil () { - return (CORBA::ContextList_ptr)0; + return nullptr; } ACE_INLINE CORBA::ContextList_ptr CORBA::ContextList::_duplicate (CORBA::ContextList_ptr x) { - if (x != 0) + if (x) { x->_incr_refcount (); } diff --git a/TAO/tao/DynamicInterface/DII_Reply_Handler.cpp b/TAO/tao/DynamicInterface/DII_Reply_Handler.cpp index 364dbad4979..1bfa74fede8 100644 --- a/TAO/tao/DynamicInterface/DII_Reply_Handler.cpp +++ b/TAO/tao/DynamicInterface/DII_Reply_Handler.cpp @@ -16,9 +16,9 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL // The pseudo-object _nil method. TAO_DII_Reply_Handler_ptr -TAO_DII_Reply_Handler::_nil (void) +TAO_DII_Reply_Handler::_nil () { - return static_cast<TAO_DII_Reply_Handler_ptr> (0); + return nullptr; } // DII Request class implementation @@ -27,7 +27,7 @@ TAO_DII_Reply_Handler::TAO_DII_Reply_Handler () { } -TAO_DII_Reply_Handler::~TAO_DII_Reply_Handler (void) +TAO_DII_Reply_Handler::~TAO_DII_Reply_Handler () { } diff --git a/TAO/tao/DynamicInterface/DII_Reply_Handler.h b/TAO/tao/DynamicInterface/DII_Reply_Handler.h index eeb88e369dd..fd8b33bf261 100644 --- a/TAO/tao/DynamicInterface/DII_Reply_Handler.h +++ b/TAO/tao/DynamicInterface/DII_Reply_Handler.h @@ -89,7 +89,7 @@ public: /// CORBA Object related methods static TAO_DII_Reply_Handler* _duplicate (TAO_DII_Reply_Handler_ptr); - static TAO_DII_Reply_Handler* _nil (void); + static TAO_DII_Reply_Handler* _nil (); static TAO_DII_Reply_Handler* _narrow (CORBA::Object_ptr); static TAO_DII_Reply_Handler* _unchecked_narrow (CORBA::Object_ptr); diff --git a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp index a63b6f5264e..dace7b4b5f4 100644 --- a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp +++ b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp @@ -89,7 +89,7 @@ TAO_Dynamic_Adapter_Impl::request_is_nil (CORBA::Request_ptr req) void TAO_Dynamic_Adapter_Impl::request_release (CORBA::Request_ptr req) { - if (req != 0) + if (req) { req->_decr_refcount (); } @@ -104,7 +104,7 @@ TAO_Dynamic_Adapter_Impl::server_request_is_nil (CORBA::ServerRequest_ptr req) void TAO_Dynamic_Adapter_Impl::server_request_release (CORBA::ServerRequest_ptr req) { - if (req != 0) + if (req) { req->_decr_refcount (); } diff --git a/TAO/tao/DynamicInterface/ExceptionList.cpp b/TAO/tao/DynamicInterface/ExceptionList.cpp index 40a06e0ded3..82f57f73181 100644 --- a/TAO/tao/DynamicInterface/ExceptionList.cpp +++ b/TAO/tao/DynamicInterface/ExceptionList.cpp @@ -67,26 +67,26 @@ CORBA::ExceptionList::remove (CORBA::ULong) } CORBA::ExceptionList_ptr -CORBA::ExceptionList::_duplicate (void) +CORBA::ExceptionList::_duplicate () { this->_incr_refcount (); return this; } void -CORBA::ExceptionList::_destroy (void) +CORBA::ExceptionList::_destroy () { this->_decr_refcount (); } void -CORBA::ExceptionList::_incr_refcount (void) +CORBA::ExceptionList::_incr_refcount () { ++this->refcount_; } void -CORBA::ExceptionList::_decr_refcount (void) +CORBA::ExceptionList::_decr_refcount () { CORBA::ULong const refcount = --this->refcount_; diff --git a/TAO/tao/DynamicInterface/ExceptionList.h b/TAO/tao/DynamicInterface/ExceptionList.h index a59a7b059eb..8e38a929adf 100644 --- a/TAO/tao/DynamicInterface/ExceptionList.h +++ b/TAO/tao/DynamicInterface/ExceptionList.h @@ -73,7 +73,7 @@ namespace CORBA void _destroy (void); - static ExceptionList_ptr _nil (void); + static ExceptionList_ptr _nil (); /// Add a TypeCode to the list. void add (CORBA::TypeCode_ptr tc); @@ -88,8 +88,8 @@ namespace CORBA void remove (CORBA::ULong slot); /// Increment and decrement ref counts. - void _incr_refcount (void); - void _decr_refcount (void); + void _incr_refcount (); + void _decr_refcount (); /// Useful for template programming. typedef CORBA::ExceptionList_ptr _ptr_type; diff --git a/TAO/tao/DynamicInterface/ExceptionList.inl b/TAO/tao/DynamicInterface/ExceptionList.inl index 4178f77d903..d175462de12 100644 --- a/TAO/tao/DynamicInterface/ExceptionList.inl +++ b/TAO/tao/DynamicInterface/ExceptionList.inl @@ -2,30 +2,30 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE -CORBA::ExceptionList::ExceptionList (void) +CORBA::ExceptionList::ExceptionList () : refcount_ (1) { } ACE_INLINE CORBA::ULong -CORBA::ExceptionList::count (void) +CORBA::ExceptionList::count () { return (CORBA::ULong) this->tc_list_.size (); } ACE_INLINE CORBA::ExceptionList_ptr -CORBA::ExceptionList::_nil (void) +CORBA::ExceptionList::_nil () { - return static_cast<CORBA::ExceptionList_ptr>(0); + return nullptr; } ACE_INLINE CORBA::ExceptionList_ptr CORBA::ExceptionList::_duplicate (CORBA::ExceptionList_ptr x) { - if (x != 0) + if (x) { x->_incr_refcount (); } diff --git a/TAO/tao/DynamicInterface/Request.cpp b/TAO/tao/DynamicInterface/Request.cpp index b2fc6791b79..1dcca1819aa 100644 --- a/TAO/tao/DynamicInterface/Request.cpp +++ b/TAO/tao/DynamicInterface/Request.cpp @@ -26,13 +26,13 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL // Reference counting for DII Request object. CORBA::ULong -CORBA::Request::_incr_refcount (void) +CORBA::Request::_incr_refcount () { return ++this->refcount_; } CORBA::ULong -CORBA::Request::_decr_refcount (void) +CORBA::Request::_decr_refcount () { CORBA::ULong const new_count = --this->refcount_; diff --git a/TAO/tao/DynamicInterface/Request.h b/TAO/tao/DynamicInterface/Request.h index 19054aa74c2..af1b1f07563 100644 --- a/TAO/tao/DynamicInterface/Request.h +++ b/TAO/tao/DynamicInterface/Request.h @@ -162,17 +162,17 @@ namespace CORBA /// Pseudo object methods. static CORBA::Request* _duplicate (CORBA::Request*); - static CORBA::Request* _nil (void); + static CORBA::Request* _nil (); // = Reference counting. - CORBA::ULong _incr_refcount (void); - CORBA::ULong _decr_refcount (void); + CORBA::ULong _incr_refcount (); + CORBA::ULong _decr_refcount (); /// Set the lazy evaluation flag. void _tao_lazy_evaluation (bool lazy_evaluation); /// Get the byte order member. - int _tao_byte_order (void) const; + int _tao_byte_order () const; /// Set the byte order member. void _tao_byte_order (int byte_order); diff --git a/TAO/tao/DynamicInterface/Request.inl b/TAO/tao/DynamicInterface/Request.inl index 69bf66a866d..ea1b7f79204 100644 --- a/TAO/tao/DynamicInterface/Request.inl +++ b/TAO/tao/DynamicInterface/Request.inl @@ -4,7 +4,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Request_ptr CORBA::Request::_duplicate (CORBA::Request_ptr x) { - if (x != 0) + if (x) { x->_incr_refcount (); } @@ -13,20 +13,20 @@ CORBA::Request::_duplicate (CORBA::Request_ptr x) } ACE_INLINE CORBA::Request_ptr -CORBA::Request::_nil (void) +CORBA::Request::_nil () { - return 0; + return nullptr; } ACE_INLINE CORBA::Object_ptr -CORBA::Request::target (void) const +CORBA::Request::target () const { return this->target_; } // Return the operation name for the request. ACE_INLINE const CORBA::Char * -CORBA::Request::operation (void) const +CORBA::Request::operation () const { return this->opname_; } diff --git a/TAO/tao/DynamicInterface/Server_Request.cpp b/TAO/tao/DynamicInterface/Server_Request.cpp index 6c4fcd680da..c485c43d3a1 100644 --- a/TAO/tao/DynamicInterface/Server_Request.cpp +++ b/TAO/tao/DynamicInterface/Server_Request.cpp @@ -20,13 +20,13 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL // Reference counting for DSI ServerRequest object. CORBA::ULong -CORBA::ServerRequest::_incr_refcount (void) +CORBA::ServerRequest::_incr_refcount () { return ++this->refcount_; } CORBA::ULong -CORBA::ServerRequest::_decr_refcount (void) +CORBA::ServerRequest::_decr_refcount () { CORBA::ULong const new_count = --this->refcount_; diff --git a/TAO/tao/DynamicInterface/Server_Request.h b/TAO/tao/DynamicInterface/Server_Request.h index 8532a92c237..47660cea05f 100644 --- a/TAO/tao/DynamicInterface/Server_Request.h +++ b/TAO/tao/DynamicInterface/Server_Request.h @@ -102,11 +102,11 @@ namespace CORBA // Pseudo object methods. static ServerRequest_ptr _duplicate (ServerRequest_ptr); - static ServerRequest_ptr _nil (void); + static ServerRequest_ptr _nil (); // = Reference counting. - CORBA::ULong _incr_refcount (void); - CORBA::ULong _decr_refcount (void); + CORBA::ULong _incr_refcount (); + CORBA::ULong _decr_refcount (); /// Set the lazy evaluation flag. void _tao_lazy_evaluation (bool lazy_evaluation); diff --git a/TAO/tao/DynamicInterface/Server_Request.inl b/TAO/tao/DynamicInterface/Server_Request.inl index 460d34c9af0..73b9112cd31 100644 --- a/TAO/tao/DynamicInterface/Server_Request.inl +++ b/TAO/tao/DynamicInterface/Server_Request.inl @@ -13,13 +13,13 @@ CORBA::ServerRequest::_duplicate (CORBA::ServerRequest_ptr x) } ACE_INLINE CORBA::ServerRequest_ptr -CORBA::ServerRequest::_nil (void) +CORBA::ServerRequest::_nil () { - return static_cast <CORBA::ServerRequest_ptr>(0); + return nullptr; } ACE_INLINE CORBA::Context_ptr -CORBA::ServerRequest::ctx (void) const +CORBA::ServerRequest::ctx () const { return this->ctx_; } diff --git a/TAO/tao/Environment.inl b/TAO/tao/Environment.inl index 26ef68d5aa7..ceae921a132 100644 --- a/TAO/tao/Environment.inl +++ b/TAO/tao/Environment.inl @@ -5,7 +5,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Exception * -CORBA::Environment::exception (void) const +CORBA::Environment::exception () const { return this->exception_; } @@ -14,23 +14,23 @@ ACE_INLINE CORBA::Environment * CORBA::Environment::_duplicate (CORBA::Environment *x) { - if (x == 0) + if (!x) { - return 0; + return nullptr; } - CORBA::Environment* ptr = 0; + CORBA::Environment* ptr = nullptr; ACE_NEW_RETURN (ptr, CORBA::Environment (*x), - 0); + nullptr); return ptr; } ACE_INLINE CORBA::Environment_ptr -CORBA::Environment::_nil (void) +CORBA::Environment::_nil () { - return static_cast <CORBA::Environment_ptr> (0); + return nullptr; } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/IORTable/IOR_Table_Impl.h b/TAO/tao/IORTable/IOR_Table_Impl.h index 09837c238a2..be602fb44f6 100644 --- a/TAO/tao/IORTable/IOR_Table_Impl.h +++ b/TAO/tao/IORTable/IOR_Table_Impl.h @@ -43,16 +43,15 @@ class TAO_IORTable_Export TAO_IOR_Table_Impl public virtual ::CORBA::LocalObject { public: - static TAO_IOR_Table_Impl_ptr - _nil (void) + static TAO_IOR_Table_Impl_ptr _nil () { - return static_cast<TAO_IOR_Table_Impl_ptr> (0); + return nullptr; } /// Constructor - TAO_IOR_Table_Impl (void); + TAO_IOR_Table_Impl (); - virtual bool async_available (void) { return false; } + virtual bool async_available () { return false; } /// Find the object, using the locator if it is not on the table. char *find (const char *object_key); diff --git a/TAO/tao/IORTable/Locate_ResponseHandler.cpp b/TAO/tao/IORTable/Locate_ResponseHandler.cpp index db75e4ff159..74dc4170f9f 100644 --- a/TAO/tao/IORTable/Locate_ResponseHandler.cpp +++ b/TAO/tao/IORTable/Locate_ResponseHandler.cpp @@ -25,12 +25,11 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL // The pseudo-object _nil method. TAO_AMH_Locate_ResponseHandler_ptr -TAO_AMH_Locate_ResponseHandler::_nil (void) +TAO_AMH_Locate_ResponseHandler::_nil () { - return (TAO_AMH_Locate_ResponseHandler_ptr) 0; + return nullptr; } - TAO_AMH_Locate_ResponseHandler::TAO_AMH_Locate_ResponseHandler ( TAO_ServerRequest & sr) : TAO_AMH_Response_Handler (), diff --git a/TAO/tao/IORTable/Locate_ResponseHandler.h b/TAO/tao/IORTable/Locate_ResponseHandler.h index 81d4ce29cf5..788c66983b0 100644 --- a/TAO/tao/IORTable/Locate_ResponseHandler.h +++ b/TAO/tao/IORTable/Locate_ResponseHandler.h @@ -114,13 +114,13 @@ public: /// CORBA Object related methods static TAO_AMH_Locate_ResponseHandler* _duplicate ( TAO_AMH_Locate_ResponseHandler_ptr); - static TAO_AMH_Locate_ResponseHandler* _nil (void); + static TAO_AMH_Locate_ResponseHandler* _nil (); static TAO_AMH_Locate_ResponseHandler* _narrow (CORBA::Object_ptr); static TAO_AMH_Locate_ResponseHandler* _unchecked_narrow (CORBA::Object_ptr); protected: /// Return 0. Should never be used. - virtual const char *_interface_repository_id (void) const; + virtual const char *_interface_repository_id () const; /// Simply returns "this" virtual void *_downcast (const char *repository_id); diff --git a/TAO/tao/LocalObject.inl b/TAO/tao/LocalObject.inl index 37bfee340de..7d2715b166e 100644 --- a/TAO/tao/LocalObject.inl +++ b/TAO/tao/LocalObject.inl @@ -15,9 +15,9 @@ CORBA::LocalObject::_duplicate (CORBA::LocalObject_ptr obj) ACE_INLINE CORBA::LocalObject_ptr -CORBA::LocalObject::_nil (void) +CORBA::LocalObject::_nil () { - return 0; + return nullptr; } ACE_INLINE diff --git a/TAO/tao/ORB.inl b/TAO/tao/ORB.inl index 1043a54de32..3c1f7d936c7 100644 --- a/TAO/tao/ORB.inl +++ b/TAO/tao/ORB.inl @@ -18,29 +18,28 @@ CORBA::ORB::set_timeout (ACE_Time_Value *timeout) } ACE_INLINE unsigned long -CORBA::ORB::_incr_refcount (void) +CORBA::ORB::_incr_refcount () { return ++this->refcount_; } ACE_INLINE unsigned long -CORBA::ORB::_refcount (void) const +CORBA::ORB::_refcount () const { return this->refcount_; } ACE_INLINE unsigned long -CORBA::ORB::_decr_refcount (void) +CORBA::ORB::_decr_refcount () { unsigned long const count = --this->refcount_; - if (count != 0) + if (count == 0) { - return count; + delete this; } - delete this; - return 0; + return count; } ACE_INLINE CORBA::ORB_ptr @@ -57,9 +56,9 @@ CORBA::ORB::_duplicate (CORBA::ORB_ptr obj) // Null pointers represent nil objects. ACE_INLINE CORBA::ORB_ptr -CORBA::ORB::_nil (void) +CORBA::ORB::_nil () { - return 0; + return nullptr; } ACE_INLINE void diff --git a/TAO/tao/Object.inl b/TAO/tao/Object.inl index d6560cab557..156d2348018 100644 --- a/TAO/tao/Object.inl +++ b/TAO/tao/Object.inl @@ -44,9 +44,9 @@ CORBA::Object::_duplicate (CORBA::Object_ptr obj) ACE_INLINE CORBA::Object_ptr -CORBA::Object::_nil (void) +CORBA::Object::_nil () { - return 0; + return nullptr; } ACE_INLINE @@ -57,31 +57,31 @@ CORBA::Object::_narrow (CORBA::Object_ptr obj) } ACE_INLINE CORBA::Boolean -CORBA::Object::is_evaluated (void) const +CORBA::Object::is_evaluated () const { return this->is_evaluated_; } ACE_INLINE TAO_ORB_Core * -CORBA::Object::orb_core (void) const +CORBA::Object::orb_core () const { return this->orb_core_; } ACE_INLINE IOP::IOR * -CORBA::Object::steal_ior (void) +CORBA::Object::steal_ior () { return this->ior_._retn (); } ACE_INLINE const IOP::IOR & -CORBA::Object::ior (void) const +CORBA::Object::ior () const { return this->ior_.in (); } ACE_INLINE void -CORBA::Object::_decr_refcount (void) +CORBA::Object::_decr_refcount () { this->_remove_ref (); } diff --git a/TAO/tao/PI/ORBInitInfo.h b/TAO/tao/PI/ORBInitInfo.h index a8b960f33d4..9f5f800645f 100644 --- a/TAO/tao/PI/ORBInitInfo.h +++ b/TAO/tao/PI/ORBInitInfo.h @@ -204,7 +204,7 @@ public: static TAO_ORBInitInfo_ptr _nil () { - return (TAO_ORBInitInfo_ptr)0; + return nullptr; } //@} diff --git a/TAO/tao/Principal.h b/TAO/tao/Principal.h index 756aac6a9a6..0b7fe0cc9cc 100644 --- a/TAO/tao/Principal.h +++ b/TAO/tao/Principal.h @@ -61,13 +61,13 @@ namespace CORBA // The pseudo object operations. static Principal * _duplicate (Principal *); - static Principal * _nil (void); + static Principal * _nil (); // = Stuff required for memory management. - unsigned long _incr_refcount (void); - unsigned long _decr_refcount (void); + unsigned long _incr_refcount (); + unsigned long _decr_refcount (); - Principal (void); + Principal (); // Useful for template programming. typedef Principal_ptr _ptr_type; diff --git a/TAO/tao/Principal.inl b/TAO/tao/Principal.inl index 99769b607e9..bf5e3c6993d 100644 --- a/TAO/tao/Principal.inl +++ b/TAO/tao/Principal.inl @@ -3,9 +3,9 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE unsigned long -CORBA::Principal::_decr_refcount (void) +CORBA::Principal::_decr_refcount () { - unsigned long new_count = --this->refcount_; + unsigned long const new_count = --this->refcount_; if (new_count == 0) delete this; @@ -15,7 +15,7 @@ CORBA::Principal::_decr_refcount (void) ACE_INLINE unsigned long -CORBA::Principal::_incr_refcount (void) +CORBA::Principal::_incr_refcount () { return ++this->refcount_; } @@ -25,7 +25,7 @@ ACE_INLINE CORBA::Principal * CORBA::Principal::_duplicate (CORBA::Principal * x) { - if (x != 0) + if (x) { x->_incr_refcount (); } @@ -36,9 +36,9 @@ CORBA::Principal::_duplicate (CORBA::Principal * x) ACE_INLINE CORBA::Principal * -CORBA::Principal::_nil (void) +CORBA::Principal::_nil () { - return 0; + return nullptr; } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/RTCORBA/Priority_Mapping_Manager.h b/TAO/tao/RTCORBA/Priority_Mapping_Manager.h index 62b81e723a0..783e1487f93 100644 --- a/TAO/tao/RTCORBA/Priority_Mapping_Manager.h +++ b/TAO/tao/RTCORBA/Priority_Mapping_Manager.h @@ -61,26 +61,23 @@ public: static TAO_Priority_Mapping_Manager_ptr _duplicate (TAO_Priority_Mapping_Manager_ptr obj); static TAO_Priority_Mapping_Manager_ptr _narrow (CORBA::Object_ptr obj); - static TAO_Priority_Mapping_Manager_ptr _nil (void) + static TAO_Priority_Mapping_Manager_ptr _nil () { - return (TAO_Priority_Mapping_Manager_ptr)0; + return nullptr; } - virtual const char* _interface_repository_id (void) const; + virtual const char* _interface_repository_id () const; protected: - /// Protected destructor to enforce proper memory management of this /// reference counted object. - ~TAO_Priority_Mapping_Manager (void); + ~TAO_Priority_Mapping_Manager (); private: - TAO_Priority_Mapping_Manager (const TAO_Priority_Mapping_Manager &); void operator= (const TAO_Priority_Mapping_Manager &); private: - TAO_Priority_Mapping *mapping_; }; diff --git a/TAO/tao/RTCORBA/RT_ProtocolPropertiesC.h b/TAO/tao/RTCORBA/RT_ProtocolPropertiesC.h index aeea492acd3..d45c28b2535 100644 --- a/TAO/tao/RTCORBA/RT_ProtocolPropertiesC.h +++ b/TAO/tao/RTCORBA/RT_ProtocolPropertiesC.h @@ -98,9 +98,9 @@ namespace RTCORBA static ProtocolProperties_ptr _narrow (::CORBA::Object_ptr obj); static ProtocolProperties_ptr _unchecked_narrow (::CORBA::Object_ptr obj); - static ProtocolProperties_ptr _nil (void) + static ProtocolProperties_ptr _nil () { - return static_cast<ProtocolProperties_ptr> (0); + return nullptr; } static void _tao_any_destructor (void *); diff --git a/TAO/tao/RTScheduling/RTScheduler_Manager.h b/TAO/tao/RTScheduling/RTScheduler_Manager.h index 4e90e0cbf9c..b0d0221e9a7 100644 --- a/TAO/tao/RTScheduling/RTScheduler_Manager.h +++ b/TAO/tao/RTScheduling/RTScheduler_Manager.h @@ -49,9 +49,9 @@ public: // the static operations static TAO_RTScheduler_Manager_ptr _duplicate (TAO_RTScheduler_Manager_ptr obj); static TAO_RTScheduler_Manager_ptr _narrow (CORBA::Object_ptr obj); - static TAO_RTScheduler_Manager_ptr _nil (void) + static TAO_RTScheduler_Manager_ptr _nil () { - return (TAO_RTScheduler_Manager_ptr)0; + return nullptr; } virtual const char* _interface_repository_id (void) const; diff --git a/TAO/tao/Valuetype/AbstractBase.inl b/TAO/tao/Valuetype/AbstractBase.inl index e078a365a89..9e4329c0358 100644 --- a/TAO/tao/Valuetype/AbstractBase.inl +++ b/TAO/tao/Valuetype/AbstractBase.inl @@ -17,9 +17,9 @@ CORBA::AbstractBase::_duplicate (CORBA::AbstractBase_ptr obj) ACE_INLINE CORBA::AbstractBase_ptr -CORBA::AbstractBase::_nil (void) +CORBA::AbstractBase::_nil () { - return static_cast <CORBA::AbstractBase_ptr> (0); + return nullptr; } ACE_INLINE CORBA::AbstractBase_ptr @@ -30,14 +30,14 @@ CORBA::AbstractBase::_narrow (CORBA::AbstractBase_ptr obj) ACE_INLINE CORBA::Boolean -CORBA::AbstractBase::_is_objref (void) const +CORBA::AbstractBase::_is_objref () const { return this->is_objref_; } ACE_INLINE TAO_Stub * -CORBA::AbstractBase::_stubobj (void) const +CORBA::AbstractBase::_stubobj () const { if (this->is_objref_) { @@ -51,27 +51,27 @@ CORBA::AbstractBase::_stubobj (void) const ACE_INLINE CORBA::Boolean -CORBA::AbstractBase::_is_collocated (void) const +CORBA::AbstractBase::_is_collocated () const { return this->is_collocated_; } ACE_INLINE TAO_Abstract_ServantBase * -CORBA::AbstractBase::_servant (void) const +CORBA::AbstractBase::_servant () const { return this->servant_; } ACE_INLINE CORBA::Object_ptr -CORBA::AbstractBase::equivalent_objref (void) +CORBA::AbstractBase::equivalent_objref () { return this->equivalent_obj_.in (); } ACE_INLINE void -CORBA::AbstractBase::_decr_refcount (void) +CORBA::AbstractBase::_decr_refcount () { this->_remove_ref (); } |