Skip to content

Commit d3d1a20

Browse files
authored
Merge pull request #2238 from jwillemsen/jwi-dynamicany
Minor modernization of DynamicAny code
2 parents e0d8ed1 + f7fd457 commit d3d1a20

21 files changed

+560
-436
lines changed

TAO/tao/AnyTypeCode/Indirected_Type_TypeCode.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ void
6363
TAO::TypeCode::Indirected_Type::set_recursive_tc (CORBA::TypeCode_ptr tc)
6464
{
6565
// link only once (should never happen that this is called twice but test anyway)
66-
if (this->recursive_tc_ == 0)
66+
if (this->recursive_tc_ == nullptr)
6767
{
6868
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
6969

70-
if (tc == 0) // should never happen
70+
if (tc == nullptr) // should never happen
7171
return;
7272

7373
// make sure we are the right kind
@@ -105,7 +105,7 @@ TAO::TypeCode::Indirected_Type::equivalent_i (
105105
CORBA::TypeCode_ptr
106106
TAO::TypeCode::Indirected_Type::get_compact_typecode_i () const
107107
{
108-
return this->recursive_tc_ ? this->recursive_tc_->get_compact_typecode () : 0;
108+
return this->recursive_tc_ ? this->recursive_tc_->get_compact_typecode () : nullptr;
109109
}
110110

111111
char const *
@@ -117,7 +117,7 @@ TAO::TypeCode::Indirected_Type::id_i () const
117117
char const *
118118
TAO::TypeCode::Indirected_Type::name_i () const
119119
{
120-
return this->recursive_tc_ ? this->recursive_tc_->name () : 0;
120+
return this->recursive_tc_ ? this->recursive_tc_->name () : nullptr;
121121
}
122122

123123
CORBA::ULong
@@ -130,14 +130,14 @@ char const *
130130
TAO::TypeCode::Indirected_Type::member_name_i (
131131
CORBA::ULong index) const
132132
{
133-
return this->recursive_tc_ ? this->recursive_tc_->member_name (index) : 0;
133+
return this->recursive_tc_ ? this->recursive_tc_->member_name (index) : nullptr;
134134
}
135135

136136
CORBA::TypeCode_ptr
137137
TAO::TypeCode::Indirected_Type::member_type_i (
138138
CORBA::ULong index) const
139139
{
140-
return this->recursive_tc_ ? this->recursive_tc_->member_type (index) : 0;
140+
return this->recursive_tc_ ? this->recursive_tc_->member_type (index) : nullptr;
141141
}
142142

143143
CORBA::Visibility
@@ -155,19 +155,19 @@ TAO::TypeCode::Indirected_Type::type_modifier_i () const
155155
CORBA::TypeCode_ptr
156156
TAO::TypeCode::Indirected_Type::concrete_base_type_i () const
157157
{
158-
return this->recursive_tc_ ? this->recursive_tc_->concrete_base_type () : 0;
158+
return this->recursive_tc_ ? this->recursive_tc_->concrete_base_type () : nullptr;
159159
}
160160

161161
CORBA::Any *
162162
TAO::TypeCode::Indirected_Type::member_label_i (CORBA::ULong index) const
163163
{
164-
return this->recursive_tc_ ? this->recursive_tc_->member_label (index) : 0;
164+
return this->recursive_tc_ ? this->recursive_tc_->member_label (index) : nullptr;
165165
}
166166

167167
CORBA::TypeCode_ptr
168168
TAO::TypeCode::Indirected_Type::discriminator_type_i () const
169169
{
170-
return this->recursive_tc_ ? this->recursive_tc_->discriminator_type () : 0;
170+
return this->recursive_tc_ ? this->recursive_tc_->discriminator_type () : nullptr;
171171
}
172172

173173
CORBA::Long

TAO/tao/DynamicAny/DynAnyUtils_T.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace TAO
113113
ANY_TC any_tc,
114114
CORBA::Boolean allow_truncation)
115115
{
116-
DA_IMPL *p = 0;
116+
DA_IMPL *p {};
117117
ACE_NEW_THROW_EX (p,
118118
DA_IMPL (allow_truncation),
119119
CORBA::NO_MEMORY ());
@@ -128,7 +128,7 @@ namespace TAO
128128
// Currently only TAO_DynValue_i can throw the original (duplicate
129129
// of a previously found TAO_DynValue_i). The new BLANK one created
130130
// above on which we called init() will be deleted automatically by
131-
// the ACE_Auto_Basic_Ptr.
131+
// the unique_ptr.
132132
return original;
133133
}
134134

@@ -142,7 +142,7 @@ namespace TAO
142142
ANY_TC any_tc,
143143
CORBA::Boolean allow_truncation)
144144
{
145-
DA_IMPL *p = 0;
145+
DA_IMPL *p {};
146146
ACE_NEW_THROW_EX (p,
147147
DA_IMPL (allow_truncation),
148148
CORBA::NO_MEMORY ());
@@ -157,7 +157,7 @@ namespace TAO
157157
// Currently only TAO_DynValue_i can throw the original (duplicate
158158
// of a previously found TAO_DynValue_i). The new BLANK one created
159159
// above on which we called init() will be deleted automatically by
160-
// the ACE_Auto_Basic_Ptr.
160+
// the unique_ptr.
161161
return original;
162162
}
163163

0 commit comments

Comments
 (0)