summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-07 21:20:06 -0700
committerGitHub <noreply@github.com>2017-06-07 21:20:06 -0700
commitffd8309aca806a6cf5ca4da85f5854ef14c8e0d9 (patch)
treeba029b5a68e1613f3dca3185a854ef70d05de61e /Source/Core/DiscIO
parenta2358786dc66eab8fa63987751d4e3fc1a3ee525 (diff)
parent9ee63608b3c7160cadb0291e577b158d1b8aa5c6 (diff)
Merge branch 'master' into fix-unittests
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/CISOBlob.h2
-rw-r--r--Source/Core/DiscIO/FileSystemGCWii.cpp10
-rw-r--r--Source/Core/DiscIO/VolumeDirectory.cpp2
-rw-r--r--Source/Core/DiscIO/VolumeWii.cpp3
4 files changed, 9 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/CISOBlob.h b/Source/Core/DiscIO/CISOBlob.h
index b674dedc18..a1c8c97b40 100644
--- a/Source/Core/DiscIO/CISOBlob.h
+++ b/Source/Core/DiscIO/CISOBlob.h
@@ -48,7 +48,7 @@ private:
CISOFileReader(File::IOFile file);
typedef u16 MapType;
- static const MapType UNUSED_BLOCK_ID = -1;
+ static const MapType UNUSED_BLOCK_ID = UINT16_MAX;
File::IOFile m_file;
u64 m_size;
diff --git a/Source/Core/DiscIO/FileSystemGCWii.cpp b/Source/Core/DiscIO/FileSystemGCWii.cpp
index cf14144f50..b809047679 100644
--- a/Source/Core/DiscIO/FileSystemGCWii.cpp
+++ b/Source/Core/DiscIO/FileSystemGCWii.cpp
@@ -77,10 +77,10 @@ u64 FileSystemGCWii::ReadFile(const std::string& _rFullPath, u8* _pBuffer, u64 _
u64 read_length = std::min(_MaxBufferSize, pFileInfo->m_FileSize - _OffsetInFile);
- DEBUG_LOG(
- DISCIO,
- "Reading %" PRIx64 " bytes at %" PRIx64 " from file %s. Offset: %" PRIx64 " Size: %" PRIx64,
- read_length, _OffsetInFile, _rFullPath.c_str(), pFileInfo->m_Offset, pFileInfo->m_FileSize);
+ DEBUG_LOG(DISCIO, "Reading %" PRIx64 " bytes at %" PRIx64 " from file %s. Offset: %" PRIx64
+ " Size: %" PRIx64,
+ read_length, _OffsetInFile, _rFullPath.c_str(), pFileInfo->m_Offset,
+ pFileInfo->m_FileSize);
m_rVolume->Read(pFileInfo->m_Offset + _OffsetInFile, read_length, _pBuffer, m_partition);
return read_length;
@@ -155,7 +155,7 @@ bool FileSystemGCWii::ExportApploader(const std::string& _rExportFolder) const
std::optional<u64> FileSystemGCWii::GetBootDOLOffset() const
{
std::optional<u32> offset = m_rVolume->ReadSwapped<u32>(0x420, m_partition);
- return offset ? static_cast<u64>(*offset) << 2 : std::optional<u64>();
+ return offset ? static_cast<u64>(*offset) << m_offset_shift : std::optional<u64>();
}
std::optional<u32> FileSystemGCWii::GetBootDOLSize(u64 dol_offset) const
diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp
index ed965983e6..f6f603d8ff 100644
--- a/Source/Core/DiscIO/VolumeDirectory.cpp
+++ b/Source/Core/DiscIO/VolumeDirectory.cpp
@@ -35,7 +35,7 @@ const size_t VolumeDirectory::MAX_ID_LENGTH;
VolumeDirectory::VolumeDirectory(const std::string& directory, bool is_wii,
const std::string& apploader, const std::string& dol)
- : m_data_start_address(-1), m_disk_header(DISKHEADERINFO_ADDRESS),
+ : m_data_start_address(UINT64_MAX), m_disk_header(DISKHEADERINFO_ADDRESS),
m_disk_header_info(std::make_unique<SDiskHeaderInfo>()), m_fst_address(0), m_dol_address(0)
{
m_root_directory = ExtractDirectoryName(directory);
diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp
index f928bbcdf3..4b6ef56539 100644
--- a/Source/Core/DiscIO/VolumeWii.cpp
+++ b/Source/Core/DiscIO/VolumeWii.cpp
@@ -32,7 +32,8 @@ namespace DiscIO
constexpr u64 PARTITION_DATA_OFFSET = 0x20000;
VolumeWii::VolumeWii(std::unique_ptr<BlobReader> reader)
- : m_pReader(std::move(reader)), m_game_partition(PARTITION_NONE), m_last_decrypted_block(-1)
+ : m_pReader(std::move(reader)), m_game_partition(PARTITION_NONE),
+ m_last_decrypted_block(UINT64_MAX)
{
_assert_(m_pReader);