diff options
Diffstat (limited to 'TAO/tao/Queued_Data.cpp')
-rw-r--r-- | TAO/tao/Queued_Data.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/TAO/tao/Queued_Data.cpp b/TAO/tao/Queued_Data.cpp index 88806f10973..438f9d8a5c4 100644 --- a/TAO/tao/Queued_Data.cpp +++ b/TAO/tao/Queued_Data.cpp @@ -34,15 +34,15 @@ clone_mb_nocopy_size (ACE_Message_Block *mb, size_t span_size) size_t const aligned_size = ACE_CDR::first_size (span_size + ACE_CDR::MAX_ALIGNMENT); // Get the allocators - ACE_Allocator *data_allocator = 0; - ACE_Allocator *data_block_allocator = 0; - ACE_Allocator *message_block_allocator = 0; + ACE_Allocator *data_allocator = nullptr; + ACE_Allocator *data_block_allocator = nullptr; + ACE_Allocator *message_block_allocator = nullptr; mb->access_allocators (data_allocator, data_block_allocator, message_block_allocator); // Create a new Message Block - ACE_Message_Block *nb = 0; + ACE_Message_Block *nb = nullptr; ACE_NEW_MALLOC_RETURN (nb, static_cast<ACE_Message_Block*> ( message_block_allocator->malloc ( @@ -50,7 +50,7 @@ clone_mb_nocopy_size (ACE_Message_Block *mb, size_t span_size) ACE_Message_Block(aligned_size, mb->msg_type(), mb->cont(), - 0, //we want the data block created + nullptr, //we want the data block created data_allocator, mb->locking_strategy(), mb->msg_priority(), @@ -58,7 +58,7 @@ clone_mb_nocopy_size (ACE_Message_Block *mb, size_t span_size) mb->msg_deadline_time (), data_block_allocator, message_block_allocator), - 0); + nullptr); ACE_CDR::mb_align (nb); @@ -77,7 +77,7 @@ TAO_Queued_Data::make_queued_data (ACE_Allocator *message_buffer_alloc, ACE_Data_Block *db) { // Get a node for the queue.. - TAO_Queued_Data *qd = 0; + TAO_Queued_Data *qd = nullptr; if (message_buffer_alloc) { @@ -85,7 +85,7 @@ TAO_Queued_Data::make_queued_data (ACE_Allocator *message_buffer_alloc, static_cast<TAO_Queued_Data *> ( message_buffer_alloc->malloc (sizeof (TAO_Queued_Data))), TAO_Queued_Data (message_buffer_alloc), - 0); + nullptr); } else @@ -93,20 +93,20 @@ TAO_Queued_Data::make_queued_data (ACE_Allocator *message_buffer_alloc, // No allocator, so use the global pool! ACE_NEW_RETURN (qd, TAO_Queued_Data, - 0); + nullptr); } // Providing an ACE_Data_Block indicates that the caller wants // an aligned ACE_Message_Block added to the TAO_Queued_Data. - if (db != 0) + if (db != nullptr) { // If this allocation fails, the TAO_Queued_Data will be leaked. - if (input_cdr_alloc == 0) + if (input_cdr_alloc == nullptr) ACE_NEW_RETURN (qd->msg_block_, ACE_Message_Block (db, 0, input_cdr_alloc), - 0); + nullptr); else ACE_NEW_MALLOC_RETURN (qd->msg_block_, static_cast<ACE_Message_Block*> ( @@ -114,7 +114,7 @@ TAO_Queued_Data::make_queued_data (ACE_Allocator *message_buffer_alloc, ACE_Message_Block (db, 0, input_cdr_alloc), - 0); + nullptr); ACE_CDR::mb_align (qd->msg_block_); } @@ -168,7 +168,7 @@ TAO_Queued_Data::duplicate (TAO_Queued_Data &sqd) (void) TAO_Queued_Data::replace_data_block (*sqd.msg_block_); - TAO_Queued_Data *qd = 0; + TAO_Queued_Data *qd = nullptr; if (sqd.allocator_) { @@ -176,7 +176,7 @@ TAO_Queued_Data::duplicate (TAO_Queued_Data &sqd) static_cast<TAO_Queued_Data *> ( sqd.allocator_->malloc (sizeof (TAO_Queued_Data))), TAO_Queued_Data (sqd), - 0); + nullptr); return qd; } @@ -193,23 +193,23 @@ TAO_Queued_Data::duplicate (TAO_Queued_Data &sqd) ACE_NEW_RETURN (qd, TAO_Queued_Data (sqd), - 0); + nullptr); return qd; } int -TAO_Queued_Data::consolidate (void) +TAO_Queued_Data::consolidate () { // Is this a chain of fragments? - if (this->state_.more_fragments () && this->msg_block_->cont () != 0) + if (this->state_.more_fragments () && this->msg_block_->cont () != nullptr) { // Create a message block big enough to hold the entire chain ACE_Message_Block *dest = clone_mb_nocopy_size ( this->msg_block_, this->msg_block_->total_length ()); - if (0 == dest) + if (nullptr == dest) { // out of memory return -1; @@ -220,7 +220,7 @@ TAO_Queued_Data::consolidate (void) // Reset the cont() parameter. We have cloned the message // block but not the chain as we will no longer have chain. - dest->cont (0); + dest->cont (nullptr); // Use ACE_CDR to consolidate the chain for us ACE_CDR::consolidate (dest, this->msg_block_); |