summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DriveBlob.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2014-03-09 21:14:26 +0100
committerTillmann Karras <tilkax@gmail.com>2014-03-09 21:14:26 +0100
commitd802d392811be44d34ae9cd23f616db93e54c50f (patch)
treef9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/DiscIO/DriveBlob.cpp
parentf28116b7da6aac6069084596dc4dbf866bdebfd8 (diff)
clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
Diffstat (limited to 'Source/Core/DiscIO/DriveBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DriveBlob.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/DiscIO/DriveBlob.cpp b/Source/Core/DiscIO/DriveBlob.cpp
index 819a37971c..6785ee0cf4 100644
--- a/Source/Core/DiscIO/DriveBlob.cpp
+++ b/Source/Core/DiscIO/DriveBlob.cpp
@@ -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;