Skip to content

Commit 23aa678

Browse files
authored
Merge pull request #2534 from jwillemsen/jwi-nullptrace
Use clang-tidy to use nullptr
2 parents b8afbb9 + 97a38d3 commit 23aa678

230 files changed

Lines changed: 2155 additions & 2155 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ACE/ace/ACE.cpp

Lines changed: 67 additions & 67 deletions
Large diffs are not rendered by default.

ACE/ace/Abstract_Timer_Queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class ACE_Abstract_Timer_Queue
154154
* cancellation succeeded and 0 if the @a timer_id wasn't found.
155155
*/
156156
virtual int cancel (long timer_id,
157-
const void **act = 0,
157+
const void **act = nullptr,
158158
int dont_call_handle_close = 1) = 0;
159159

160160
/**

ACE/ace/Acceptor.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::open
7373

7474
// Must supply a valid Reactor to Acceptor::open()...
7575

76-
if (reactor == 0)
76+
if (reactor == nullptr)
7777
{
7878
errno = EINVAL;
7979
return -1;
@@ -187,7 +187,7 @@ ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp,
187187
addr_str,
188188
ACE_TEXT ("# acceptor factory\n"));
189189

190-
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
190+
if (*strp == nullptr && (*strp = ACE_OS::strdup (buf)) == nullptr)
191191
return -1;
192192
else
193193
ACE_OS::strsncpy (*strp, buf, length);
@@ -563,18 +563,18 @@ ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::open
563563
{
564564
ACE_TRACE ("ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::open");
565565

566-
if (this->service_name_ == 0 && service_name != 0)
566+
if (this->service_name_ == 0 && service_name != nullptr)
567567
ACE_ALLOCATOR_RETURN (this->service_name_,
568568
ACE_OS::strdup (service_name),
569569
-1);
570-
if (this->service_description_ == 0 && service_description != 0)
570+
if (this->service_description_ == 0 && service_description != nullptr)
571571
ACE_ALLOCATOR_RETURN (this->service_description_,
572572
ACE_OS::strdup (service_description),
573573
-1);
574574
this->reactor (reactor);
575575

576576
// Must supply a valid Reactor to Acceptor::open()...
577-
if (reactor == 0)
577+
if (reactor == nullptr)
578578
{
579579
errno = EINVAL;
580580
return -1;
@@ -659,15 +659,15 @@ ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::ACE_Strategy_Acceptor
659659
delete_concurrency_strategy_ (false),
660660
scheduling_strategy_ (0),
661661
delete_scheduling_strategy_ (false),
662-
service_name_ (0),
663-
service_description_ (0)
662+
service_name_ (nullptr),
663+
service_description_ (nullptr)
664664
{
665665
ACE_TRACE ("ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::ACE_Strategy_Acceptor");
666666

667-
if (service_name != 0)
667+
if (service_name != nullptr)
668668
ACE_ALLOCATOR (this->service_name_,
669669
ACE_OS::strdup (service_name));
670-
if (service_description != 0)
670+
if (service_description != nullptr)
671671
ACE_ALLOCATOR (this->service_description_,
672672
ACE_OS::strdup (service_description));
673673
this->use_select_ = use_select;
@@ -694,8 +694,8 @@ ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::ACE_Strategy_Acceptor
694694
delete_concurrency_strategy_ (false),
695695
scheduling_strategy_ (0),
696696
delete_scheduling_strategy_ (false),
697-
service_name_ (0),
698-
service_description_ (0)
697+
service_name_ (nullptr),
698+
service_description_ (nullptr)
699699
{
700700
ACE_TRACE ("ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::ACE_Strategy_Acceptor");
701701

@@ -859,7 +859,7 @@ ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp,
859859
? ACE_TEXT ("<unknown>")
860860
: this->service_description_);
861861

862-
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
862+
if (*strp == nullptr && (*strp = ACE_OS::strdup (buf)) == nullptr)
863863
return -1;
864864
else
865865
ACE_OS::strsncpy (*strp, buf, length);
@@ -1031,7 +1031,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::register_handler
10311031
this->restart_ = restart;
10321032
ACE_Time_Value *tv = (ACE_Time_Value *) synch_options.time_value ();
10331033

1034-
if (tv != 0
1034+
if (tv != nullptr
10351035
&& this->reactor ()->schedule_timer (this,
10361036
synch_options.arg (),
10371037
*tv) == -1)
@@ -1222,7 +1222,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp,
12221222
addr_str,
12231223
ACE_TEXT ("#oneshot acceptor factory\n"));
12241224

1225-
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
1225+
if (*strp == nullptr && (*strp = ACE_OS::strdup (buf)) == nullptr)
12261226
return -1;
12271227
else
12281228
ACE_OS::strsncpy (*strp, buf, length);

ACE/ace/Acceptor.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ class ACE_Strategy_Acceptor
298298
typedef ACE_Scheduling_Strategy<SVC_HANDLER> SCHEDULING_STRATEGY;
299299

300300
/// Default constructor.
301-
ACE_Strategy_Acceptor (const ACE_TCHAR service_name[] = 0,
302-
const ACE_TCHAR service_description[] = 0,
301+
ACE_Strategy_Acceptor (const ACE_TCHAR service_name[] = nullptr,
302+
const ACE_TCHAR service_description[] = nullptr,
303303
int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
304304
int reuse_addr = 1);
305305

@@ -311,12 +311,12 @@ class ACE_Strategy_Acceptor
311311
*/
312312
ACE_Strategy_Acceptor (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr,
313313
ACE_Reactor * = ACE_Reactor::instance (),
314-
ACE_Creation_Strategy<SVC_HANDLER> * = 0,
315-
ACE_Accept_Strategy<SVC_HANDLER, PEER_ACCEPTOR> * = 0,
316-
ACE_Concurrency_Strategy<SVC_HANDLER> * = 0,
317-
ACE_Scheduling_Strategy<SVC_HANDLER> * = 0,
318-
const ACE_TCHAR service_name[] = 0,
319-
const ACE_TCHAR service_description[] = 0,
314+
ACE_Creation_Strategy<SVC_HANDLER> * = nullptr,
315+
ACE_Accept_Strategy<SVC_HANDLER, PEER_ACCEPTOR> * = nullptr,
316+
ACE_Concurrency_Strategy<SVC_HANDLER> * = nullptr,
317+
ACE_Scheduling_Strategy<SVC_HANDLER> * = nullptr,
318+
const ACE_TCHAR service_name[] = nullptr,
319+
const ACE_TCHAR service_description[] = nullptr,
320320
int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
321321
int reuse_addr = 1);
322322

@@ -368,12 +368,12 @@ class ACE_Strategy_Acceptor
368368
*/
369369
virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &,
370370
ACE_Reactor * = ACE_Reactor::instance (),
371-
ACE_Creation_Strategy<SVC_HANDLER> * = 0,
372-
ACE_Accept_Strategy<SVC_HANDLER, PEER_ACCEPTOR> * =0,
373-
ACE_Concurrency_Strategy<SVC_HANDLER> * = 0,
374-
ACE_Scheduling_Strategy<SVC_HANDLER> * = 0,
375-
const ACE_TCHAR *service_name = 0,
376-
const ACE_TCHAR *service_description = 0,
371+
ACE_Creation_Strategy<SVC_HANDLER> * = nullptr,
372+
ACE_Accept_Strategy<SVC_HANDLER, PEER_ACCEPTOR> * =nullptr,
373+
ACE_Concurrency_Strategy<SVC_HANDLER> * = nullptr,
374+
ACE_Scheduling_Strategy<SVC_HANDLER> * = nullptr,
375+
const ACE_TCHAR *service_name = nullptr,
376+
const ACE_TCHAR *service_description = nullptr,
377377
int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
378378
int reuse_addr = 1);
379379

@@ -554,7 +554,7 @@ class ACE_Oneshot_Acceptor : public ACE_Service_Object
554554
*/
555555
ACE_Oneshot_Acceptor (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr,
556556
ACE_Reactor *reactor = ACE_Reactor::instance (),
557-
ACE_Concurrency_Strategy<SVC_HANDLER> * = 0);
557+
ACE_Concurrency_Strategy<SVC_HANDLER> * = nullptr);
558558

559559
/**
560560
* Initialize the appropriate strategies for concurrency and then
@@ -566,7 +566,7 @@ class ACE_Oneshot_Acceptor : public ACE_Service_Object
566566
*/
567567
int open (const typename PEER_ACCEPTOR::PEER_ADDR &,
568568
ACE_Reactor *reactor = ACE_Reactor::instance (),
569-
ACE_Concurrency_Strategy<SVC_HANDLER> * = 0);
569+
ACE_Concurrency_Strategy<SVC_HANDLER> * = nullptr);
570570

571571
/// Close down the {Oneshot_Acceptor}.
572572
virtual ~ACE_Oneshot_Acceptor ();

ACE/ace/Activation_Queue.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ACE_Activation_Queue::ACE_Activation_Queue (ACE_Message_Queue<ACE_SYNCH> *new_qu
3838
, allocator_(alloc)
3939
, data_block_allocator_(db_alloc)
4040
{
41-
if (this->allocator_ == 0)
41+
if (this->allocator_ == nullptr)
4242
this->allocator_ = ACE_Allocator::instance ();
4343

4444
if (new_queue)
@@ -81,7 +81,7 @@ ACE_Activation_Queue::~ACE_Activation_Queue ()
8181
ACE_Method_Request *
8282
ACE_Activation_Queue::dequeue (ACE_Time_Value *tv)
8383
{
84-
ACE_Message_Block *mb = 0;
84+
ACE_Message_Block *mb = nullptr;
8585

8686
// Dequeue the message.
8787
if (this->queue_->dequeue_head (mb, tv) != -1)
@@ -94,14 +94,14 @@ ACE_Activation_Queue::dequeue (ACE_Time_Value *tv)
9494
return mr;
9595
}
9696
else
97-
return 0;
97+
return nullptr;
9898
}
9999

100100
int
101101
ACE_Activation_Queue::enqueue (ACE_Method_Request *mr,
102102
ACE_Time_Value *tv)
103103
{
104-
ACE_Message_Block *mb = 0;
104+
ACE_Message_Block *mb = nullptr;
105105

106106
// We pass sizeof (*mr) here so that flow control will work
107107
// correctly. Since we also pass <mr> note that no unnecessary
@@ -110,10 +110,10 @@ ACE_Activation_Queue::enqueue (ACE_Method_Request *mr,
110110
static_cast<ACE_Message_Block *> (this->allocator_->malloc (sizeof (ACE_Message_Block))),
111111
ACE_Message_Block (sizeof (*mr), // size
112112
ACE_Message_Block::MB_DATA, // type
113-
0, // cont
113+
nullptr, // cont
114114
(char *) mr, // data
115-
0, // allocator
116-
0, // locking strategy
115+
nullptr, // allocator
116+
nullptr, // locking strategy
117117
mr->priority (), // priority
118118
ACE_Time_Value::zero, // execution time
119119
ACE_Time_Value::max_time, // absolute time of deadline

ACE/ace/Addr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ACE_Addr::ACE_Addr (int type, int size) :
3131
void *
3232
ACE_Addr::get_addr () const
3333
{
34-
return 0;
34+
return nullptr;
3535
}
3636

3737
void

ACE/ace/Array_Base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ class ACE_Array_Base
6060

6161
/// Dynamically create an uninitialized array.
6262
ACE_Array_Base (size_type size = 0,
63-
ACE_Allocator * the_allocator = 0);
63+
ACE_Allocator * the_allocator = nullptr);
6464

6565
/// Dynamically initialize the entire array to the @a default_value.
6666
ACE_Array_Base (size_type size,
6767
T const & default_value,
68-
ACE_Allocator * the_allocator = 0);
68+
ACE_Allocator * the_allocator = nullptr);
6969

7070
/**
7171
* The copy constructor performs initialization by making an exact

ACE/ace/Asynch_Acceptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ ACE_Asynch_Acceptor<HANDLER>::accept (size_t bytes_to_read, const void *act)
202202
{
203203
ACE_TRACE ("ACE_Asynch_Acceptor<>::accept");
204204

205-
ACE_Message_Block *message_block = 0;
205+
ACE_Message_Block *message_block = nullptr;
206206
// The space_needed calculation is drive by needs of Windows. POSIX doesn't
207207
// need to extra 16 bytes, but it doesn't hurt.
208208
size_t space_needed = sizeof (sockaddr_in) + 16;
@@ -307,7 +307,7 @@ ACE_Asynch_Acceptor<HANDLER>::handle_accept (const ACE_Asynch_Accept::Result &re
307307
local_address);
308308

309309
// Pass the ACT
310-
if (result.act () != 0)
310+
if (result.act () != nullptr)
311311
new_handler->act (result.act ());
312312

313313
// Set up the handler's new handle value

ACE/ace/Asynch_Connector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ ACE_Asynch_Connector<HANDLER>::handle_connect (const ACE_Asynch_Connect::Result
138138
local_address);
139139

140140
// Pass the ACT
141-
if (result.act () != 0)
141+
if (result.act () != nullptr)
142142
new_handler->act (result.act ());
143143

144144
// Set up the handler's new handle value

0 commit comments

Comments
 (0)