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

@ -125,7 +125,7 @@ bool CBoot::FindMapFile(std::string* existing_map_file,
bool CBoot::LoadMapFromFilename()
{
std::string strMapFilename;
bool found = FindMapFile(&strMapFilename, NULL);
bool found = FindMapFile(&strMapFilename, nullptr);
if (found && g_symbolDB.LoadMap(strMapFilename.c_str()))
{
UpdateDebugger_MapLoaded();
@ -201,7 +201,7 @@ bool CBoot::BootUp()
case SCoreStartupParameter::BOOT_ISO:
{
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_StartupPara.m_strFilename);
if (pVolume == NULL)
if (pVolume == nullptr)
break;
bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume);

View File

@ -30,10 +30,10 @@ public:
// Tries to find a map file for the current game by looking first in the
// local user directory, then in the shared user directory.
//
// If existing_map_file is not NULL and a map file exists, it is set to the
// If existing_map_file is not nullptr and a map file exists, it is set to the
// path to the existing map file.
//
// If writable_map_file is not NULL, it is set to the path to where a map
// If writable_map_file is not nullptr, it is set to the path to where a map
// file should be saved.
//
// Returns true if a map file exists, false if none could be found.
@ -43,7 +43,7 @@ public:
private:
static void RunFunction(u32 _iAddr);
static void UpdateDebugger_MapLoaded(const char* _gameID = NULL);
static void UpdateDebugger_MapLoaded(const char* _gameID = nullptr);
static bool LoadMapFromFilename();
static bool Boot_ELF(const char *filename);

View File

@ -34,13 +34,13 @@ CDolLoader::~CDolLoader()
for (auto& sect : text_section)
{
delete [] sect;
sect = NULL;
sect = nullptr;
}
for (auto& sect : data_section)
{
delete [] sect;
sect = NULL;
sect = nullptr;
}
}
@ -54,9 +54,9 @@ void CDolLoader::Initialize(u8* _pBuffer, u32 _Size)
p[i] = Common::swap32(p[i]);
for (auto& sect : text_section)
sect = NULL;
sect = nullptr;
for (auto& sect : data_section)
sect = NULL;
sect = nullptr;
u32 HID4_pattern = 0x7c13fba6;
u32 HID4_mask = 0xfc1fffff;

View File

@ -90,7 +90,7 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
// DOL
const DiscIO::SNANDContent* pContent = ContentLoader.GetContentByIndex(ContentLoader.GetBootIndex());
if (pContent == NULL)
if (pContent == nullptr)
return false;
WII_IPC_HLE_Interface::SetDefaultContentFile(_pFilename);
@ -119,7 +119,7 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
// Load patches and run startup patches
const DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_pFilename);
if (pVolume != NULL)
if (pVolume != nullptr)
PatchEngine::LoadPatches();
return true;

View File

@ -82,7 +82,7 @@ ElfReader::ElfReader(void *ptr)
const char *ElfReader::GetSectionName(int section) const
{
if (sections[section].sh_type == SHT_NULL)
return NULL;
return nullptr;
int nameOffset = sections[section].sh_name;
char *ptr = (char*)GetSectionDataPtr(header->e_shstrndx);
@ -90,7 +90,7 @@ const char *ElfReader::GetSectionName(int section) const
if (ptr)
return ptr + nameOffset;
else
return NULL;
return nullptr;
}
bool ElfReader::LoadInto(u32 vaddr)
@ -181,7 +181,7 @@ SectionID ElfReader::GetSectionByName(const char *name, int firstSection) const
{
const char *secname = GetSectionName(i);
if (secname != NULL && strcmp(name, secname) == 0)
if (secname != nullptr && strcmp(name, secname) == 0)
return i;
}
return -1;

View File

@ -51,11 +51,11 @@ public:
const u8 *GetSectionDataPtr(int section) const
{
if (section < 0 || section >= header->e_shnum)
return 0;
return nullptr;
if (sections[section].sh_type != SHT_NOBITS)
return GetPtr(sections[section].sh_offset);
else
return 0;
return nullptr;
}
bool IsCodeSection(int section) const
{