Skip to content

Commit

Permalink
do not AlignConsecutiveDeclarations
Browse files Browse the repository at this point in the history
and set SpaceAfterLogicalNot: false according review comments
check unique_ptr with bool operator too
  • Loading branch information
ClausKlein committed Jun 3, 2021
1 parent 2c7d1c0 commit c412d45
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This configuration requires clang-format version v12.0 or newer.
BasedOnStyle: Mozilla
#
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: false
AllowAllParametersOfDeclarationOnNextLine: false
Expand Down Expand Up @@ -43,7 +43,7 @@ ColumnLimit: 123 # MAYBE up to 160
IndentPPDirectives: AfterHash
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
SpaceAfterLogicalNot: true
SpaceAfterLogicalNot: false
SpaceBeforeParens: Always
SpaceInEmptyBlock: false
...
6 changes: 3 additions & 3 deletions TAO/tests/Bug_3251_Regression/DllOrb.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class bug_3251_Export DllOrb : public ACE_Task_Base

private:
std::unique_ptr<ACE_Thread_Barrier> ma_barrier_;
CORBA::ORB_var mv_orb_;
PortableServer::POA_var mv_rootPOA_;
PortableServer::POAManager_var mv_poaManager_;
CORBA::ORB_var mv_orb_;
PortableServer::POA_var mv_rootPOA_;
PortableServer::POAManager_var mv_poaManager_;
};

ACE_FACTORY_DECLARE (bug_3251, DllOrb)
Expand Down
6 changes: 3 additions & 3 deletions TAO/tests/Bug_3542_Regression/DllOrb.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class bug_3542_Export DllOrb : public ACE_Task_Base

private:
std::unique_ptr<ACE_Thread_Barrier> ma_barrier_;
CORBA::ORB_var mv_orb_;
PortableServer::POA_var mv_rootPOA_;
PortableServer::POAManager_var mv_poaManager_;
CORBA::ORB_var mv_orb_;
PortableServer::POA_var mv_rootPOA_;
PortableServer::POAManager_var mv_poaManager_;
};

ACE_FACTORY_DECLARE (bug_3542, DllOrb)
Expand Down
8 changes: 4 additions & 4 deletions TAO/tests/Oneway_Send_Timeouts/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class Server
private:
bool parse_args (int argc, ACE_TCHAR* argv[]);

CORBA::ORB_var orb_;
CORBA::ORB_var management_orb_;
bool shutdown_;
TAO_SYNCH_MUTEX mutex_;
CORBA::ORB_var orb_;
CORBA::ORB_var management_orb_;
bool shutdown_;
TAO_SYNCH_MUTEX mutex_;
std::unique_ptr<Test_i> test_i_;
};

Expand Down
10 changes: 5 additions & 5 deletions TAO/tests/Oneway_Send_Timeouts/Server_Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Server_Task : public ACE_Task_Base
bool initializer = false;
{
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
if (server_.get () == 0)
if (!server_)
{
ACE_ARGV my_args (args_.c_str ());

Expand Down Expand Up @@ -53,7 +53,7 @@ class Server_Task : public ACE_Task_Base

bool ready ()
{
if (server_.get () != 0)
if (server_)
{
return server_->init_;
}
Expand All @@ -63,16 +63,16 @@ class Server_Task : public ACE_Task_Base

void force_shutdown ()
{
if (server_.get () != 0)
if (server_)
{
server_->shutdown ();
}
}

private:
std::string args_;
std::string args_;
std::unique_ptr<Server> server_;
TAO_SYNCH_MUTEX mutex_;
TAO_SYNCH_MUTEX mutex_;
};

#endif //_SERVER_TASK_
6 changes: 3 additions & 3 deletions TAO/tests/Oneway_Send_Timeouts/Test_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class Test_i : public virtual POA_Test
virtual void shutdown ();

private:
volatile bool sleep_;
volatile bool unsleep_;
volatile bool shutdown_;
volatile bool sleep_;
volatile bool unsleep_;
volatile bool shutdown_;
CORBA::ORB_var orb_;
};

Expand Down
12 changes: 6 additions & 6 deletions TAO/tests/Oneway_Send_Timeouts/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool MyMain::init_server (const ACE_TCHAR* args)

server_task_->activate (THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, thread_pool);

int duration = 4; // wait 3 seconds for initialization
int duration = 4; // wait 3 seconds for initialization
ACE_Time_Value current = ACE_High_Res_Timer::gettimeofday_hr ();
ACE_Time_Value timeout = current + ACE_Time_Value (duration);

Expand All @@ -63,7 +63,7 @@ bool MyMain::init_server (const ACE_TCHAR* args)
current += sleep_time;
}

if (! server_task_->ready ())
if (!server_task_->ready ())
{
server_task_->force_shutdown ();
server_task_->wait ();
Expand All @@ -77,7 +77,7 @@ bool MyMain::init_server (const ACE_TCHAR* args)
bool MyMain::init_client (const ACE_TCHAR* args)
{
std::string my_args (ACE_TEXT_ALWAYS_CHAR (args));
int thread_pool = 1;
int thread_pool = 1;

#ifdef ACE_HAS_CPP14
client_task_ = std::make_unique<Client_Task> (my_args);
Expand Down Expand Up @@ -125,12 +125,12 @@ MyMain::MyMain (int argc, ACE_TCHAR* argv[])

void MyMain::run ()
{
if (server_task_.get () != 0)
if (server_task_)
{
server_task_->wait ();
}

if (client_task_.get () != 0)
if (client_task_)
{
client_task_->wait ();
}
Expand All @@ -140,7 +140,7 @@ void MyMain::run ()

MyMain::~MyMain ()
{
if (! shutdown_)
if (!shutdown_)
{
this->run ();
}
Expand Down

0 comments on commit c412d45

Please sign in to comment.