Skip to content

Commit e5649be

Browse files
authored
[IO] Modernize io/io: Replace NULL with nullptr
1 parent f30e8fd commit e5649be

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

io/io/src/TBufferFile.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,7 +2660,7 @@ void TBufferFile::WriteObjectClass(const void *actualObjectStart, const TClass *
26602660

26612661
if (!actualObjectStart) {
26622662

2663-
// save kNullTag to represent NULL pointer
2663+
// save kNullTag to represent nullptr pointer
26642664
*this << (UInt_t) kNullTag;
26652665

26662666
} else {

io/io/src/TBufferJSON.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ Int_t TBufferJSON::ExportToFile(const char *filename, const TObject *obj, const
809809
const char *objbuf = json.Data();
810810
Long_t objlen = json.Length();
811811

812-
unsigned long objcrc = R__crc32(0, NULL, 0);
812+
unsigned long objcrc = R__crc32(0, nullptr, 0);
813813
objcrc = R__crc32(objcrc, (const unsigned char *)objbuf, objlen);
814814

815815
// 10 bytes (ZIP header), compressed data, 8 bytes (CRC and original length)
@@ -889,7 +889,7 @@ Int_t TBufferJSON::ExportToFile(const char *filename, const void *obj, const TCl
889889
const char *objbuf = json.Data();
890890
Long_t objlen = json.Length();
891891

892-
unsigned long objcrc = R__crc32(0, NULL, 0);
892+
unsigned long objcrc = R__crc32(0, nullptr, 0);
893893
objcrc = R__crc32(objcrc, (const unsigned char *)objbuf, objlen);
894894

895895
// 10 bytes (ZIP header), compressed data, 8 bytes (CRC and original length)

io/io/src/TFileCacheRead.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ void TFileCacheRead::SetEnablePrefetchingImpl(Bool_t setPrefetching)
796796
}
797797
} else if (fPrefetch && !fEnablePrefetching) {
798798
SafeDelete(fPrefetch);
799-
fPrefetch = NULL;
799+
fPrefetch = nullptr;
800800
}
801801

802802
//environment variable used to switch to the new method of reading asynchronously

io/io/src/TMapFile.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ TMapFile::TMapFile(const char *name, const char *title, Option_t *option,
338338
fFd = (Longptr_t) CreateFile(fname, // pointer to name of the file
339339
GENERIC_WRITE | GENERIC_READ, // access (read-write) mode
340340
FILE_SHARE_WRITE | FILE_SHARE_READ, // share mode
341-
NULL, // pointer to security attributes
341+
nullptr, // pointer to security attributes
342342
OPEN_ALWAYS, // how to create
343343
FILE_ATTRIBUTE_TEMPORARY, // file attributes
344-
(HANDLE) NULL); // handle to file with attributes to copy
344+
(HANDLE) nullptr); // handle to file with attributes to copy
345345
#endif
346346
if (fFd == (Longptr_t)INVALID_HANDLE_VALUE) {
347347
SysError("TMapFile", "file %s can not be opened", fname);
@@ -355,10 +355,10 @@ TMapFile::TMapFile(const char *name, const char *title, Option_t *option,
355355
fFd = (Longptr_t) CreateFile(fname, // pointer to name of the file
356356
GENERIC_READ, // access (read-write) mode
357357
FILE_SHARE_WRITE | FILE_SHARE_READ, // share mode
358-
NULL, // pointer to security attributes
358+
nullptr, // pointer to security attributes
359359
OPEN_EXISTING, // how to create
360360
FILE_ATTRIBUTE_TEMPORARY, // file attributes
361-
(HANDLE) NULL); // handle to file with attributes to copy
361+
(HANDLE) nullptr); // handle to file with attributes to copy
362362
#endif
363363
if (fFd == (Longptr_t)INVALID_HANDLE_VALUE) {
364364
SysError("TMapFile", "file %s can not be opened for reading", fname);
@@ -864,7 +864,7 @@ void TMapFile::CreateSemaphore(int pid)
864864
char buffer[] ="ROOT_Semaphore_xxxxxxxx";
865865
int lbuf = strlen(buffer);
866866
if (!pid) fSemaphore = getpid();
867-
fhSemaphore = (ULongptr_t)CreateMutex(NULL,FALSE,itoa(fSemaphore,&buffer[lbuf-8],16));
867+
fhSemaphore = (ULongptr_t)CreateMutex(nullptr,FALSE,itoa(fSemaphore,&buffer[lbuf-8],16));
868868
if (fhSemaphore == 0) fSemaphore = (Longptr_t)INVALID_HANDLE_VALUE;
869869
#endif
870870
#endif

io/io/src/TStreamerInfo.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5391,7 +5391,7 @@ void TStreamerInfo::PrintValue(const char *name, char *pointer, Int_t i, Int_t l
53915391
} else {
53925392
if (i < 0) {
53935393
if (pointer==0) {
5394-
printf("NULL\n");
5394+
printf("nullptr\n");
53955395
} else {
53965396
const static TClassRef stringClass("string");
53975397
if (fClass == stringClass) {

io/io/test/RIoUring.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ TEST(RawUring, NopRoundTrip)
5858
// can make sqes
5959
struct io_uring_sqe *sqe;
6060
sqe = io_uring_get_sqe(&ring);
61-
ASSERT_NE(sqe, (io_uring_sqe*) NULL);
61+
ASSERT_NE(sqe, (io_uring_sqe*) nullptr);
6262

6363
// can submit sqes to the ring
6464
io_uring_prep_nop(sqe);

io/mpi/src/TMPIFile.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ void TMPIFile::SplitMPIComm()
501501
Int_t flag;
502502
MPI_Initialized(&flag);
503503
if (!flag) {
504-
MPI_Init(NULL, NULL);
504+
MPI_Init(nullptr, nullptr);
505505
}
506506
// get global size and current global rank
507507
MPI_Comm_size(MPI_COMM_WORLD, &fMPIGlobalSize);

io/sql/src/TSQLFile.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Up to now following member are supported:
5353
-# Object as data member. In that case object is saved in normal way to data base and column
5454
will contain id of this object.
5555
-# Pointer on object. Same as before. In case if object was already stored, just its id
56-
will be placed in the column. For NULL pointer 0 is used.
56+
will be placed in the column. For nullptr pointer 0 is used.
5757
-# TString. Now column with limited width like VARCAHR(255) in MySQL is used.
5858
Later this will be improved to support maximum possible strings
5959
-# Anything else. Data will be converted to raw format and saved in _streamer_ table.

io/sql/src/TSQLStructure.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ to database server.
4141
#include <iostream>
4242

4343
namespace sqlio {
44-
const Int_t Ids_NullPtr = 0; // used to identify NULL pointer in tables
44+
const Int_t Ids_NullPtr = 0; // used to identify nullptr pointer in tables
4545
const Int_t Ids_RootDir = 0; // dir:id, used for keys stored in root directory.
4646
const Int_t Ids_TSQLFile = 0; // keyid for TSQLFile entry in keys list
4747
const Int_t Ids_StreamerInfos = 1; // keyid used to store StreamerInfos in ROOT directory

io/xml/src/TXMLSetup.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,6 @@ Int_t TXMLSetup::AtoI(const char *sbuf, Int_t def, const char *errinfo)
291291
if (sbuf)
292292
return atoi(sbuf);
293293
if (errinfo)
294-
std::cerr << "<Error in TXMLSetup::AtoI>" << errinfo << " not valid integer: sbuf <NULL>" << std::endl;
294+
std::cerr << "<Error in TXMLSetup::AtoI>" << errinfo << " not valid integer: sbuf <nullptr>" << std::endl;
295295
return def;
296296
}

0 commit comments

Comments
 (0)