diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-03-16 12:28:51 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-03-16 12:28:51 +0000 |
commit | 0cab6a112f5235cc06618940560a8c867035f1d7 (patch) | |
tree | b5b9442567f73fed3d9b0c378755145ca65083c6 /ACE/ace | |
parent | 525593cff4b94bb6d9a65f7e1ba0ea3799c968b7 (diff) | |
download | ATCD-0cab6a112f5235cc06618940560a8c867035f1d7.tar.gz |
Mon Mar 16 12:29:22 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Configuration.cpp:
* ace/System_Time.cpp:
Initialise pointers with 0
* ace/MEM_Acceptor.h:
Doxygen fix
* ace/Monitor_Control_Types.cpp (operator=):
Check for self assignment
* ace/Name_Space.cpp:
* ace/Name_Space.h:
Let operator= return a value
* ace/SOCK.h:
Layout change
* ace/UUID.cpp:
Simplified operator=
Diffstat (limited to 'ACE/ace')
-rw-r--r-- | ACE/ace/Configuration.cpp | 12 | ||||
-rw-r--r-- | ACE/ace/MEM_Acceptor.h | 2 | ||||
-rw-r--r-- | ACE/ace/Monitor_Control_Types.cpp | 23 | ||||
-rw-r--r-- | ACE/ace/Name_Space.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/Name_Space.h | 2 | ||||
-rw-r--r-- | ACE/ace/SOCK.h | 1 | ||||
-rw-r--r-- | ACE/ace/System_Time.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/UUID.cpp | 26 |
8 files changed, 38 insertions, 34 deletions
diff --git a/ACE/ace/Configuration.cpp b/ACE/ace/Configuration.cpp index b54308ade7d..823a2356a8a 100644 --- a/ACE/ace/Configuration.cpp +++ b/ACE/ace/Configuration.cpp @@ -1617,7 +1617,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key section += sub_section; ACE_Configuration_ExtId SectionExtId (section.fast_rep ()); - SECTION_HASH::ENTRY* section_entry; + SECTION_HASH::ENTRY* section_entry = 0; SECTION_HASH* hashmap = index_; if (hashmap->find (SectionExtId, section_entry)) return -1; @@ -1801,7 +1801,7 @@ ACE_Configuration_Heap::set_string_value (const ACE_Configuration_Section_Key& k return -1; // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; + VALUE_HASH::ENTRY* entry = 0; ACE_Configuration_ExtId item_name (t_name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -1860,7 +1860,7 @@ ACE_Configuration_Heap::set_integer_value (const ACE_Configuration_Section_Key& return -1; // section does not exist // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; + VALUE_HASH::ENTRY* entry = 0; ACE_Configuration_ExtId item_name (t_name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -1910,7 +1910,7 @@ ACE_Configuration_Heap::set_binary_value (const ACE_Configuration_Section_Key& k return -1; // section does not exist // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; + VALUE_HASH::ENTRY* entry = 0; ACE_Configuration_ExtId item_name (t_name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -2100,7 +2100,7 @@ ACE_Configuration_Heap::find_value (const ACE_Configuration_Section_Key& key, // Find it ACE_Configuration_ExtId ValueExtId (t_name); - VALUE_HASH::ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry = 0; if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) return -1; // value does not exist @@ -2130,7 +2130,7 @@ ACE_Configuration_Heap::remove_value (const ACE_Configuration_Section_Key& key, // Find it ACE_Configuration_ExtId ValueExtId (t_name); - VALUE_HASH::ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry = 0; if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) return -1; diff --git a/ACE/ace/MEM_Acceptor.h b/ACE/ace/MEM_Acceptor.h index 09b60e45c63..9d82579170c 100644 --- a/ACE/ace/MEM_Acceptor.h +++ b/ACE/ace/MEM_Acceptor.h @@ -58,7 +58,7 @@ public: /// Default constructor. ACE_MEM_Acceptor (void); - /// destructor. + /// Destructor. ~ACE_MEM_Acceptor (void); /// Initiate a passive mode socket. diff --git a/ACE/ace/Monitor_Control_Types.cpp b/ACE/ace/Monitor_Control_Types.cpp index c91056c067a..a1bf3399c2b 100644 --- a/ACE/ace/Monitor_Control_Types.cpp +++ b/ACE/ace/Monitor_Control_Types.cpp @@ -53,17 +53,20 @@ namespace ACE Monitor_Control_Types::Constraint& Monitor_Control_Types::Constraint::operator= (const Constraint& rhs) { - if (this->control_action != 0) - { - this->control_action->remove_ref (); - } - - this->expr = rhs.expr; - this->control_action = rhs.control_action; - - if (this->control_action != 0) + if (this != &rhs) { - this->control_action->add_ref (); + if (this->control_action != 0) + { + this->control_action->remove_ref (); + } + + this->expr = rhs.expr; + this->control_action = rhs.control_action; + + if (this->control_action != 0) + { + this->control_action->add_ref (); + } } return *this; diff --git a/ACE/ace/Name_Space.cpp b/ACE/ace/Name_Space.cpp index 2f15a9e71d3..22cc5b3f2db 100644 --- a/ACE/ace/Name_Space.cpp +++ b/ACE/ace/Name_Space.cpp @@ -42,7 +42,7 @@ ACE_Name_Binding::ACE_Name_Binding (const ACE_Name_Binding &s) ACE_TRACE ("ACE_Name_Binding::ACE_Name_Binding"); } -void +const ACE_Name_Binding& ACE_Name_Binding::operator = (const ACE_Name_Binding &s) { ACE_TRACE ("ACE_Name_Binding::operator ="); @@ -54,6 +54,8 @@ ACE_Name_Binding::operator = (const ACE_Name_Binding &s) this->value_ = s.value_; this->type_ = ACE_OS::strdup (s.type_); } + + return *this; } bool diff --git a/ACE/ace/Name_Space.h b/ACE/ace/Name_Space.h index fff070d1e96..1848443d37c 100644 --- a/ACE/ace/Name_Space.h +++ b/ACE/ace/Name_Space.h @@ -49,7 +49,7 @@ public: ACE_Name_Binding (const ACE_Name_Binding &); /// Assignment operator. - void operator= (const ACE_Name_Binding &); + const ACE_Name_Binding& operator= (const ACE_Name_Binding &); /// Destructor. ~ACE_Name_Binding (void); diff --git a/ACE/ace/SOCK.h b/ACE/ace/SOCK.h index 1defcba62dd..f78f693e3c1 100644 --- a/ACE/ace/SOCK.h +++ b/ACE/ace/SOCK.h @@ -125,7 +125,6 @@ protected: * pointer/reference. */ ~ACE_SOCK (void); - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/System_Time.cpp b/ACE/ace/System_Time.cpp index d1ae525b8d6..e5ff1175473 100644 --- a/ACE/ace/System_Time.cpp +++ b/ACE/ace/System_Time.cpp @@ -85,7 +85,7 @@ ACE_System_Time::get_master_system_time (time_t &time_out) if (this->delta_time_ == 0) { // Try to find it - void * temp; + void * temp = 0; if (this->shmem_->find (ACE_DEFAULT_TIME_SERVER_STR, temp) == -1) { // No time entry in shared memory (meaning no Clerk exists) diff --git a/ACE/ace/UUID.cpp b/ACE/ace/UUID.cpp index 2a4d4fe6e63..d43bbc8139c 100644 --- a/ACE/ace/UUID.cpp +++ b/ACE/ace/UUID.cpp @@ -113,19 +113,19 @@ namespace ACE_Utils const UUID & UUID::operator = (const UUID & rhs) { - if (this == &rhs) - return *this; - - // Copy the values of the UUID. - this->time_low_ = rhs.time_low_; - this->time_mid_ = rhs.time_mid_; - this->time_hi_and_version_ = rhs.time_hi_and_version_; - this->clock_seq_hi_and_reserved_ = rhs.clock_seq_hi_and_reserved_; - this->clock_seq_low_ = rhs.clock_seq_low_; - this->node_ = rhs.node_; - - // Delete the string version of the UUID. - this->as_string_.reset (0); + if (this != &rhs) + { + // Copy the values of the UUID. + this->time_low_ = rhs.time_low_; + this->time_mid_ = rhs.time_mid_; + this->time_hi_and_version_ = rhs.time_hi_and_version_; + this->clock_seq_hi_and_reserved_ = rhs.clock_seq_hi_and_reserved_; + this->clock_seq_low_ = rhs.clock_seq_low_; + this->node_ = rhs.node_; + + // Delete the string version of the UUID. + this->as_string_.reset (0); + } return *this; } |