Skip to content

Commit

Permalink
Merge pull request #2331 from jwillemsen/master
Browse files Browse the repository at this point in the history
Use uniform initialization
  • Loading branch information
jwillemsen authored Feb 12, 2025
2 parents 279244f + 2b381a9 commit 94721e3
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion TAO/docs/tutorials/Quoter/Event_Service/Stock_Consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Stock_Consumer::disconnect ()
void
Stock_Consumer::push (const CORBA::Any& data)
{
const Quoter::Event *event = 0;
const Quoter::Event *event {};
if ((data >>= event) == 0)
return; // Invalid event

Expand Down
2 changes: 1 addition & 1 deletion TAO/docs/tutorials/Quoter/Event_Service/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <H3>Connecting as a consumer</H3>
void
Stock_Consumer::push (const CORBA::Any& data)
{
const Quoter::Event *event = 0;
const Quoter::Event *event {};
if ((data >>= event) == 0)
return; // Invalid event
</PRE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Stock_Consumer::push (const RtecEventComm::EventSet &data)
for (CORBA::ULong i = 0; i != data.length (); ++i) {
const RtecEventComm::Event &e = data[i];

const Quoter::Event *event = 0;
const Quoter::Event *event {};
if ((e.data.any_value >>= event) == 0)
continue; // Invalid event

Expand Down
2 changes: 1 addition & 1 deletion TAO/docs/tutorials/Quoter/RT_Event_Service/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <H3>Connecting as a consumer</H3>
for (CORBA::ULong i = 0; i != data.length (); ++i) {
RtecEventComm::Event &e = data[i];

Quoter::Event *event;
Quoter::Event *event {};
if ((e.data.any_value >>= event) == 0)
continue; // Invalid event
</PRE>
Expand Down
4 changes: 2 additions & 2 deletions TAO/examples/Simulator/Event_Supplier/Event_Con.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Demo_Consumer::push (const RtecEventComm::EventSet &events)

if (ret)
{
const Navigation *navigation_ = 0;
const Navigation *navigation_ {};
events[i].data.any_value >>= navigation_;
ACE_DEBUG ((LM_DEBUG, "Found a Navigation struct in the any: pos_lat = %d\n", navigation_->position_latitude));
}
Expand All @@ -178,7 +178,7 @@ Demo_Consumer::push (const RtecEventComm::EventSet &events)

if (ret)
{
const Weapons *weapons_ = 0;
const Weapons *weapons_ {};
events[i].data.any_value >>= weapons_;
ACE_DEBUG ((LM_DEBUG, "Found a Weapons struct in the any: nr_of_weapons = %u\n", weapons_->number_of_weapons));
}
Expand Down
4 changes: 2 additions & 2 deletions TAO/interop-tests/wchar/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ run_one_test (interop::WChar_Passer_ptr server,
}
case ANY_WSTRING_FROM_SERVER:
{
const CORBA::WChar *ws;
const CORBA::WChar *ws {};
CORBA::Any_var test = server->any_from_server (data_set,
interop::is_wstring);
if (test >>= ws)
Expand All @@ -172,7 +172,7 @@ run_one_test (interop::WChar_Passer_ptr server,
{
CORBA::Any a;
a <<= ref.get_wstring(data_set);
const CORBA::WChar *ws;
const CORBA::WChar *ws {};
CORBA::Any_var test = server->any_echo (a);
if (test >>= ws)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TestConsumer : public POA_CosEventComm::PushConsumer

virtual void push(const CORBA::Any& a)
{
MyEvent* vt;
MyEvent* vt {};
a >>= vt;

std::cout << std::endl
Expand Down
4 changes: 2 additions & 2 deletions TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Criteria_Evaluator::~Criteria_Evaluator ()
const LifeCycleService::Criteria_Evaluator::SeqNamedValuePair *
Criteria_Evaluator::getInitialization ()
{
const LifeCycleService::Criteria_Evaluator::SeqNamedValuePair *sequence_ptr = 0;
const LifeCycleService::Criteria_Evaluator::SeqNamedValuePair *sequence_ptr {};

CORBA::Any_ptr any_ptr =
this->getCriteriaMember ("initialization");

if (any_ptr == 0)
if (any_ptr == nullptr)
throw LifeCycleService::Criteria_Evaluator::NotAvailable(
"No initialization member found.\n");

Expand Down
2 changes: 1 addition & 1 deletion TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ TAO_CEC_DynamicImplementationServer::is_a (CORBA::ServerRequest_ptr request)
CORBA::NamedValue_ptr nv = list->item (0);

CORBA::Any_ptr ap = nv->value ();
const char *value = 0;
const char *value {};
*ap >>= value;

if (TAO_debug_level >= 10)
Expand Down
2 changes: 1 addition & 1 deletion TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TAO_FT_Heart_Beat_Policy::heartbeat_policy_value ()
CORBA::Policy_ptr
TAO_FT_Heart_Beat_Policy::create (const CORBA::Any& val)
{
const FT::HeartbeatPolicyValue *value = 0;
const FT::HeartbeatPolicyValue *value {};
if ((val >>= value) == 0)
throw CORBA::PolicyError (CORBA::BAD_POLICY_VALUE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,17 @@ TAO_FTEC_Event_Channel_Impl::connect_push_consumer (
CORBA::Any_var any
= Request_Context_Repository().get_cached_result();

const FtRtecEventChannelAdmin::ObjectId *oid = 0;
const FtRtecEventChannelAdmin::ObjectId *oid {};

if (any.in() >>= oid) {
FtRtecEventChannelAdmin::ObjectId* result = 0;
FtRtecEventChannelAdmin::ObjectId* result {};
ACE_NEW_THROW_EX(result,
FtRtecEventChannelAdmin::ObjectId(*oid),
CORBA::NO_MEMORY());
return result;
}

FtRtecEventChannelAdmin::ObjectId* retval = 0;
FtRtecEventChannelAdmin::ObjectId* retval {};
ACE_NEW_THROW_EX(retval, FtRtecEventChannelAdmin::ObjectId, CORBA::NO_MEMORY());

FtRtecEventChannelAdmin::ObjectId_var object_id = retval;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ Request_Context_Repository::set_object_id(
FtRtecEventChannelAdmin::ObjectId_var
get_object_id(CORBA::Any_var a)
{
const FtRtecEventChannelAdmin::ObjectId *object_id = 0;
const FtRtecEventChannelAdmin::ObjectId *object_id {};

if ((a.in() >>= object_id) == 0)
throw CORBA::NO_MEMORY();

FtRtecEventChannelAdmin::ObjectId *r = 0;
FtRtecEventChannelAdmin::ObjectId *r {};
ACE_NEW_THROW_EX(r,
FtRtecEventChannelAdmin::ObjectId(*object_id),
CORBA::NO_MEMORY());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TAO_Set_Update_Interceptor::send_request (
{
CORBA::Any_var a = Request_Context_Repository().get_ft_request_service_context(ri);

const IOP::ServiceContext* scp = 0;
const IOP::ServiceContext* scp {};

if ((a.in() >>= scp) == 0)
return;
Expand Down
2 changes: 1 addition & 1 deletion TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ TAO_Notify_StructProperty_T<TYPE>::set (

if (property_seq.find (this->name_, value) == 0)
{
const TYPE* extract_type = 0;
const TYPE* extract_type {};

if ((value >>= extract_type) && extract_type != 0) // make sure we get something valid.
{
Expand Down
2 changes: 1 addition & 1 deletion TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace TAO
int find (const PG_Property_Set & decoder, const ACE_CString & key, TYPE & value)
{
int result = 0;
const PortableGroup::Value * any = nullptr;
const PortableGroup::Value * any {};
if (decoder.find (key, any))
{
result = ((*any) >>= value);
Expand Down
2 changes: 1 addition & 1 deletion TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ TAO::SSLIOP::CredentialsAcquirer::get_credentials (CORBA::Boolean on_list)
{
this->check_validity ();

const ::SSLIOP::AuthData *data = 0;
const ::SSLIOP::AuthData *data {};

if (!(this->acquisition_arguments_ >>= data))
throw CORBA::BAD_PARAM ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void EchoEventConsumer_i::push(const RtecEventComm::EventSet& events)
{
//ACE_OS::printf(".");
// Extract event data from the any.
const char* eventData;
const char* eventData {};
std::ostringstream out;

#ifndef ACE_LACKS_GETPID
Expand Down
3 changes: 1 addition & 2 deletions TAO/tao/Messaging/ExceptionHolder_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ namespace TAO
throw ::CORBA::MARSHAL (TAO::VMCID, CORBA::COMPLETED_MAYBE);
}

CORBA::SystemException* exception =
TAO::create_system_exception (type_id.in ());
CORBA::SystemException* exception = TAO::create_system_exception (type_id.in ());

if (!exception)
{
Expand Down

0 comments on commit 94721e3

Please sign in to comment.