Skip to content

Commit

Permalink
Merge branch 'jwi-defaultannotation' of https://github.com/jwillemsen…
Browse files Browse the repository at this point in the history
…/taox11 into jwi-defaultannotation
  • Loading branch information
jwillemsen committed Oct 27, 2023
2 parents a8d55d7 + cc762b5 commit c7f3460
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 46 deletions.
24 changes: 12 additions & 12 deletions tao/x11/anytypecode/any_basic_impl_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ namespace TAOX11_NAMESPACE
Any_Basic_Impl_T<TRAITS, MARSHAL_POLICY> *
Any_Basic_Impl_T<TRAITS, MARSHAL_POLICY>::create_empty (CORBA::typecode_reference tc)
{
impl_type * retval {};
ACE_NEW_NORETURN (retval,
impl_type (std::move(tc), value_type (0)));
impl_type * retval = new (std::nothrow) impl_type (std::move(tc), value_type (0));
if (!retval)
throw TAO_CORBA::NO_MEMORY ();
return retval;
}

Expand Down Expand Up @@ -241,9 +241,9 @@ namespace TAOX11_NAMESPACE
Any_Object_Impl_T<TRAITS, MARSHAL_POLICY> *
Any_Object_Impl_T<TRAITS, MARSHAL_POLICY>::create_empty (CORBA::typecode_reference tc)
{
impl_type * retval {};
ACE_NEW_NORETURN (retval,
impl_type (std::move(tc), value_type (0)));
impl_type * retval = new (std::nothrow) impl_type (std::move(tc), value_type (0));
if (!retval)
throw TAO_CORBA::NO_MEMORY ();
return retval;
}

Expand Down Expand Up @@ -359,9 +359,9 @@ namespace TAOX11_NAMESPACE
Any_Value_Impl_T<TRAITS, MARSHAL_POLICY> *
Any_Value_Impl_T<TRAITS, MARSHAL_POLICY>::create_empty (CORBA::typecode_reference tc)
{
impl_type * retval {};
ACE_NEW_NORETURN (retval,
impl_type (std::move(tc), value_type (0)));
impl_type * retval = new (std::nothrow) impl_type (std::move(tc), value_type (0));
if (!retval)
throw TAO_CORBA::NO_MEMORY ();
return retval;
}

Expand Down Expand Up @@ -470,9 +470,9 @@ namespace TAOX11_NAMESPACE
Any_AbstractBase_Impl_T<TRAITS, MARSHAL_POLICY> *
Any_AbstractBase_Impl_T<TRAITS, MARSHAL_POLICY>::create_empty (CORBA::typecode_reference tc)
{
impl_type * retval {};
ACE_NEW_NORETURN (retval,
impl_type (std::move(tc), value_type (0)));
impl_type * retval = new (std::nothrow) impl_type (std::move(tc), value_type (0));
if (!retval)
throw TAO_CORBA::NO_MEMORY ();
return retval;
}
} // namespace TAOX11_NAMESPACE
Expand Down
16 changes: 5 additions & 11 deletions tao/x11/anytypecode/typecode_case_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,24 @@ template <typename DiscriminatorType,
typename StringType,
typename TypeCodeType>
TAO_TAO::TypeCode::Case<StringType, TypeCodeType> *
TAOX11_NAMESPACE::TypeCode::Case_T<DiscriminatorType,
StringType,
TypeCodeType>::clone () const
TAOX11_NAMESPACE::TypeCode::Case_T<DiscriminatorType, StringType, TypeCodeType>::clone () const
{
TAO_TAO::TypeCode::Case<StringType, TypeCodeType> * p {};

using case_type = Case_T<DiscriminatorType,
StringType,
TypeCodeType>;

// The compiler generated memberwise copy constructor is sufficient.
ACE_NEW_NORETURN (p,
case_type (*this));

TAO_TAO::TypeCode::Case<StringType, TypeCodeType> * p = new (std::nothrow) case_type (*this);
if (!p)
throw TAO_CORBA::NO_MEMORY ();
return p;
}

template <typename DiscriminatorType,
typename StringType,
typename TypeCodeType>
bool
TAOX11_NAMESPACE::TypeCode::Case_T<DiscriminatorType,
StringType,
TypeCodeType>::marshal_label (TAO_OutputCDR & cdr) const
TAOX11_NAMESPACE::TypeCode::Case_T<DiscriminatorType, StringType, TypeCodeType>::marshal_label (TAO_OutputCDR & cdr) const
{
return
(cdr <<
Expand Down
6 changes: 2 additions & 4 deletions tao/x11/anytypecode/typecode_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,7 @@ void TAOX11_NAMESPACE::CORBA::TypeCode::Bounds::_tao_decode (TAO_InputCDR &cdr)

TAOX11_NAMESPACE::CORBA::Exception *TAOX11_NAMESPACE::CORBA::TypeCode::Bounds::_tao_duplicate () const
{
TAOX11_NAMESPACE::CORBA::Exception * result = nullptr;
ACE_NEW_NORETURN (result, Bounds (*this));
TAOX11_NAMESPACE::CORBA::Exception * result = new (std::nothrow) Bounds (*this);
if (!result)
throw TAO_CORBA::NO_MEMORY ();
return result;
Expand Down Expand Up @@ -544,8 +543,7 @@ void TAOX11_NAMESPACE::CORBA::TypeCode::BadKind::_tao_decode (TAO_InputCDR &cdr)

TAOX11_NAMESPACE::CORBA::Exception *TAOX11_NAMESPACE::CORBA::TypeCode::BadKind::_tao_duplicate () const
{
TAOX11_NAMESPACE::CORBA::Exception * result = nullptr;
ACE_NEW_NORETURN (result, BadKind (*this));
TAOX11_NAMESPACE::CORBA::Exception * result = new (std::nothrow) BadKind (*this);
if (!result)
throw TAO_CORBA::NO_MEMORY ();
return result;
Expand Down
3 changes: 1 addition & 2 deletions tao/x11/orb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ namespace TAOX11_NAMESPACE

TAOX11_NAMESPACE::CORBA::Exception *ORB::InvalidName::_tao_duplicate () const
{
TAOX11_NAMESPACE::CORBA::Exception * result = 0;
ACE_NEW_NORETURN (result, InvalidName (*this));
TAOX11_NAMESPACE::CORBA::Exception * result = new (std::nothrow) InvalidName (*this);
if (!result)
throw TAO_CORBA::NO_MEMORY ();
return result;
Expand Down
10 changes: 4 additions & 6 deletions tao/x11/system_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ namespace TAOX11_NAMESPACE {
void \
CORBA::_nam_ ::_raise_tao () const \
{ \
TAO_CORBA::_nam_ * result {}; \
ACE_NEW_NORETURN (result, TAO_CORBA::_nam_ (TAO_CORBA::ULong (this->minor ()), \
TAO_CORBA::CompletionStatus (this->completed ()))); \
TAO_CORBA::_nam_ * result = new (std::nothrow) \
TAO_CORBA::_nam_ (TAO_CORBA::ULong (this->minor ()), \
TAO_CORBA::CompletionStatus (this->completed ())); \
if (!result) \
{ \
throw TAO_CORBA::NO_MEMORY (); \
Expand All @@ -218,9 +218,7 @@ namespace TAOX11_NAMESPACE {
CORBA::Exception * \
CORBA::name ::_tao_duplicate () const \
{ \
CORBA::Exception * result {}; \
ACE_NEW_NORETURN (result, CORBA::name (*this)); \
return result; \
return new (std::nothrow) CORBA::name (*this); \
}

// expand the list
Expand Down
3 changes: 1 addition & 2 deletions tao/x11/user_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ namespace TAOX11_NAMESPACE {
/// Constructor using a repository id.
UserException (const char *repository_id,
const char *local_name)
: CORBA::Exception (repository_id,
local_name)
: CORBA::Exception (repository_id, local_name)
{
}

Expand Down
3 changes: 1 addition & 2 deletions tao/x11/user_exception_proxy_in_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ namespace TAOX11_NAMESPACE
TAO_CORBA::Exception *
UserExceptionProxy::in<USEREX>::_tao_duplicate () const
{
TAO_CORBA::Exception *result;
ACE_NEW_NORETURN (result, UserExceptionProxy::in<USEREX> (*this));
TAO_CORBA::Exception *result = new (std::nothrow) UserExceptionProxy::in<USEREX> (*this);
if (!result)
throw TAO_CORBA::NO_MEMORY ();
return result;
Expand Down
4 changes: 1 addition & 3 deletions tao/x11/user_exception_proxy_in_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ namespace TAOX11_NAMESPACE

static TAO_CORBA::Exception *_alloc ()
{
TAO_CORBA::Exception *result = nullptr;
ACE_NEW_NORETURN (result,
UserExceptionProxy::in<USEREX> ());
TAO_CORBA::Exception *result = new (std::nothrow) UserExceptionProxy::in<USEREX> ();
if (!result)
throw TAO_CORBA::NO_MEMORY ();
return result;
Expand Down
3 changes: 1 addition & 2 deletions tao/x11/user_exception_proxy_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace TAOX11_NAMESPACE
TAO_CORBA::Exception *
UserExceptionProxy::out::_tao_duplicate () const
{
TAO_CORBA::Exception *result {};
ACE_NEW_NORETURN (result, UserExceptionProxy::out (*this->user_exc_));
TAO_CORBA::Exception *result = new (std::nothrow) UserExceptionProxy::out (*this->user_exc_);
if (!result)
throw TAO_CORBA::NO_MEMORY ();
return result;
Expand Down
10 changes: 8 additions & 2 deletions tests/exceptions/extended/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ test_bar_object (IDL::traits<Test::Foo>::ref_type foo)
catch (const Test::BarEx &x)
{
uint16_t const prev_result = result;
IDL::traits<Test::Bar>::ref_type bar =
x.bar_i();
IDL::traits<Test::Bar>::ref_type bar = x.bar_i();
if (!bar)
{
TAOX11_TEST_ERROR << "test_bar_object - ERROR : catching a Test::BarEx but "
Expand Down Expand Up @@ -64,6 +63,13 @@ test_bar_object (IDL::traits<Test::Foo>::ref_type foo)
<< "found <" << ex.struct_i ().msg () << ">" << std::endl;
++result;
}
if (std::strcmp(ex._name (), "StructEx") != 0)
{
TAOX11_TEST_ERROR << "test_bar_object - ERROR : Correct exception caught "
<< "but '_name' seems to contain a wrong value. expected <StructEx> - "
<< "found <" << ex._name () << ">" << std::endl;
++result;
}
}
catch (...)
{
Expand Down

0 comments on commit c7f3460

Please sign in to comment.