clang-modernize -use-nullptr

and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
This commit is contained in:
Tillmann Karras
2014-03-09 21:14:26 +01:00
parent f28116b7da
commit d802d39281
292 changed files with 1526 additions and 1526 deletions

View File

@ -23,14 +23,14 @@ DriveReader::DriveReader(const char *drive)
SectorReader::SetSectorSize(2048);
auto const path = UTF8ToTStr(std::string("\\\\.\\") + drive);
hDisc = CreateFile(path.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL);
nullptr, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, nullptr);
if (hDisc != INVALID_HANDLE_VALUE)
{
// Do a test read to make sure everything is OK, since it seems you can get
// handles to empty drives.
DWORD not_used;
u8 *buffer = new u8[m_blocksize];
if (!ReadFile(hDisc, buffer, m_blocksize, (LPDWORD)&not_used, NULL))
if (!ReadFile(hDisc, buffer, m_blocksize, (LPDWORD)&not_used, nullptr))
{
delete [] buffer;
// OK, something is wrong.
@ -45,8 +45,8 @@ DriveReader::DriveReader(const char *drive)
// removal while reading from it.
pmrLockCDROM.PreventMediaRemoval = TRUE;
DeviceIoControl(hDisc, IOCTL_CDROM_MEDIA_REMOVAL,
&pmrLockCDROM, sizeof(pmrLockCDROM), NULL,
0, &dwNotUsed, NULL);
&pmrLockCDROM, sizeof(pmrLockCDROM), nullptr,
0, &dwNotUsed, nullptr);
#endif
#else
SectorReader::SetSectorSize(2048);
@ -66,8 +66,8 @@ DriveReader::~DriveReader()
// Unlock the disc in the CD-ROM drive.
pmrLockCDROM.PreventMediaRemoval = FALSE;
DeviceIoControl (hDisc, IOCTL_CDROM_MEDIA_REMOVAL,
&pmrLockCDROM, sizeof(pmrLockCDROM), NULL,
0, &dwNotUsed, NULL);
&pmrLockCDROM, sizeof(pmrLockCDROM), nullptr,
0, &dwNotUsed, nullptr);
#endif
if (hDisc != INVALID_HANDLE_VALUE)
{
@ -85,7 +85,7 @@ DriveReader *DriveReader::Create(const char *drive)
if (!reader->IsOK())
{
delete reader;
return 0;
return nullptr;
}
return reader;
}
@ -99,7 +99,7 @@ void DriveReader::GetBlock(u64 block_num, u8 *out_ptr)
LONG off_low = (LONG)offset & 0xFFFFFFFF;
LONG off_high = (LONG)(offset >> 32);
SetFilePointer(hDisc, off_low, &off_high, FILE_BEGIN);
if (!ReadFile(hDisc, lpSector, m_blocksize, (LPDWORD)&NotUsed, NULL))
if (!ReadFile(hDisc, lpSector, m_blocksize, (LPDWORD)&NotUsed, nullptr))
PanicAlertT("Disc Read Error");
#else
file_.Seek(m_blocksize * block_num, SEEK_SET);
@ -117,7 +117,7 @@ bool DriveReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *o
LONG off_low = (LONG)offset & 0xFFFFFFFF;
LONG off_high = (LONG)(offset >> 32);
SetFilePointer(hDisc, off_low, &off_high, FILE_BEGIN);
if (!ReadFile(hDisc, out_ptr, (DWORD)(m_blocksize * num_blocks), (LPDWORD)&NotUsed, NULL))
if (!ReadFile(hDisc, out_ptr, (DWORD)(m_blocksize * num_blocks), (LPDWORD)&NotUsed, nullptr))
{
PanicAlertT("Disc Read Error");
return false;