diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
| commit | 633dc75e857d649ffab7c4398e92536bccc9e1de (patch) | |
| tree | f9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/DiscIO/VolumeCreator.cpp | |
| parent | f4012638672472afdbd9956229f273a18a77fd77 (diff) | |
| parent | d802d392811be44d34ae9cd23f616db93e54c50f (diff) | |
Merge pull request #142 from Tilka/clang-modernize
Run clang-modernize and manually fix the result
Diffstat (limited to 'Source/Core/DiscIO/VolumeCreator.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeCreator.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/DiscIO/VolumeCreator.cpp b/Source/Core/DiscIO/VolumeCreator.cpp index 1a36e6a66f..a223c263ea 100644 --- a/Source/Core/DiscIO/VolumeCreator.cpp +++ b/Source/Core/DiscIO/VolumeCreator.cpp @@ -75,8 +75,8 @@ EDiscType GetDiscType(IBlobReader& _rReader); IVolume* CreateVolumeFromFilename(const std::string& _rFilename, u32 _PartitionGroup, u32 _VolumeNum) { IBlobReader* pReader = CreateBlobReader(_rFilename.c_str()); - if (pReader == NULL) - return NULL; + if (pReader == nullptr) + return nullptr; switch (GetDiscType(*pReader)) { @@ -94,7 +94,7 @@ IVolume* CreateVolumeFromFilename(const std::string& _rFilename, u32 _PartitionG IVolume* pVolume = CreateVolumeFromCryptedWiiImage(*pReader, _PartitionGroup, 0, _VolumeNum, region == 'K'); - if (pVolume == NULL) + if (pVolume == nullptr) { delete pReader; } @@ -106,16 +106,16 @@ IVolume* CreateVolumeFromFilename(const std::string& _rFilename, u32 _PartitionG case DISC_TYPE_UNK: default: std::string Filename, ext; - SplitPath(_rFilename, NULL, &Filename, &ext); + SplitPath(_rFilename, nullptr, &Filename, &ext); Filename += ext; NOTICE_LOG(DISCIO, "%s does not have the Magic word for a gcm, wiidisc or wad file\n" "Set Log Verbosity to Warning and attempt to load the game again to view the values", Filename.c_str()); delete pReader; - return NULL; + return nullptr; } // unreachable code - return NULL; + return nullptr; } IVolume* CreateVolumeFromDirectory(const std::string& _rDirectory, bool _bIsWii, const std::string& _rApploader, const std::string& _rDOL) @@ -123,7 +123,7 @@ IVolume* CreateVolumeFromDirectory(const std::string& _rDirectory, bool _bIsWii, if (CVolumeDirectory::IsValidDirectory(_rDirectory)) return new CVolumeDirectory(_rDirectory, _bIsWii, _rApploader, _rDOL); - return NULL; + return nullptr; } bool IsVolumeWiiDisc(const IVolume *_rVolume) @@ -152,7 +152,7 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part // Check if we're looking for a valid partition if ((int)_VolumeNum != -1 && _VolumeNum > numPartitions) - return NULL; + return nullptr; #ifdef _WIN32 struct SPartition @@ -170,14 +170,14 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part SPartitionGroup PartitionGroup[4]; // read all partitions - for (u32 x = 0; x < 4; x++) + for (SPartitionGroup& group : PartitionGroup) { for (u32 i = 0; i < numPartitions; i++) { SPartition Partition; Partition.Offset = ((u64)Reader.Read32(PartitionsOffset + (i * 8) + 0)) << 2; Partition.Type = Reader.Read32(PartitionsOffset + (i * 8) + 4); - PartitionGroup[x].PartitionsVec.push_back(Partition); + group.PartitionsVec.push_back(Partition); } } @@ -217,7 +217,7 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part } } - return NULL; + return nullptr; } EDiscType GetDiscType(IBlobReader& _rReader) |
