Skip to content

Commit

Permalink
Merge pull request #2238 from jwillemsen/jwi-dynamicany
Browse files Browse the repository at this point in the history
Minor modernization of DynamicAny code
  • Loading branch information
jwillemsen authored May 22, 2024
2 parents e0d8ed1 + f7fd457 commit d3d1a20
Show file tree
Hide file tree
Showing 21 changed files with 560 additions and 436 deletions.
18 changes: 9 additions & 9 deletions TAO/tao/AnyTypeCode/Indirected_Type_TypeCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ void
TAO::TypeCode::Indirected_Type::set_recursive_tc (CORBA::TypeCode_ptr tc)
{
// link only once (should never happen that this is called twice but test anyway)
if (this->recursive_tc_ == 0)
if (this->recursive_tc_ == nullptr)
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);

if (tc == 0) // should never happen
if (tc == nullptr) // should never happen
return;

// make sure we are the right kind
Expand Down Expand Up @@ -105,7 +105,7 @@ TAO::TypeCode::Indirected_Type::equivalent_i (
CORBA::TypeCode_ptr
TAO::TypeCode::Indirected_Type::get_compact_typecode_i () const
{
return this->recursive_tc_ ? this->recursive_tc_->get_compact_typecode () : 0;
return this->recursive_tc_ ? this->recursive_tc_->get_compact_typecode () : nullptr;
}

char const *
Expand All @@ -117,7 +117,7 @@ TAO::TypeCode::Indirected_Type::id_i () const
char const *
TAO::TypeCode::Indirected_Type::name_i () const
{
return this->recursive_tc_ ? this->recursive_tc_->name () : 0;
return this->recursive_tc_ ? this->recursive_tc_->name () : nullptr;
}

CORBA::ULong
Expand All @@ -130,14 +130,14 @@ char const *
TAO::TypeCode::Indirected_Type::member_name_i (
CORBA::ULong index) const
{
return this->recursive_tc_ ? this->recursive_tc_->member_name (index) : 0;
return this->recursive_tc_ ? this->recursive_tc_->member_name (index) : nullptr;
}

CORBA::TypeCode_ptr
TAO::TypeCode::Indirected_Type::member_type_i (
CORBA::ULong index) const
{
return this->recursive_tc_ ? this->recursive_tc_->member_type (index) : 0;
return this->recursive_tc_ ? this->recursive_tc_->member_type (index) : nullptr;
}

CORBA::Visibility
Expand All @@ -155,19 +155,19 @@ TAO::TypeCode::Indirected_Type::type_modifier_i () const
CORBA::TypeCode_ptr
TAO::TypeCode::Indirected_Type::concrete_base_type_i () const
{
return this->recursive_tc_ ? this->recursive_tc_->concrete_base_type () : 0;
return this->recursive_tc_ ? this->recursive_tc_->concrete_base_type () : nullptr;
}

CORBA::Any *
TAO::TypeCode::Indirected_Type::member_label_i (CORBA::ULong index) const
{
return this->recursive_tc_ ? this->recursive_tc_->member_label (index) : 0;
return this->recursive_tc_ ? this->recursive_tc_->member_label (index) : nullptr;
}

CORBA::TypeCode_ptr
TAO::TypeCode::Indirected_Type::discriminator_type_i () const
{
return this->recursive_tc_ ? this->recursive_tc_->discriminator_type () : 0;
return this->recursive_tc_ ? this->recursive_tc_->discriminator_type () : nullptr;
}

CORBA::Long
Expand Down
8 changes: 4 additions & 4 deletions TAO/tao/DynamicAny/DynAnyUtils_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace TAO
ANY_TC any_tc,
CORBA::Boolean allow_truncation)
{
DA_IMPL *p = 0;
DA_IMPL *p {};
ACE_NEW_THROW_EX (p,
DA_IMPL (allow_truncation),
CORBA::NO_MEMORY ());
Expand All @@ -128,7 +128,7 @@ namespace TAO
// Currently only TAO_DynValue_i can throw the original (duplicate
// of a previously found TAO_DynValue_i). The new BLANK one created
// above on which we called init() will be deleted automatically by
// the ACE_Auto_Basic_Ptr.
// the unique_ptr.
return original;
}

Expand All @@ -142,7 +142,7 @@ namespace TAO
ANY_TC any_tc,
CORBA::Boolean allow_truncation)
{
DA_IMPL *p = 0;
DA_IMPL *p {};
ACE_NEW_THROW_EX (p,
DA_IMPL (allow_truncation),
CORBA::NO_MEMORY ());
Expand All @@ -157,7 +157,7 @@ namespace TAO
// Currently only TAO_DynValue_i can throw the original (duplicate
// of a previously found TAO_DynValue_i). The new BLANK one created
// above on which we called init() will be deleted automatically by
// the ACE_Auto_Basic_Ptr.
// the unique_ptr.
return original;
}

Expand Down
Loading

0 comments on commit d3d1a20

Please sign in to comment.