diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-01-29 05:58:31 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-01-29 06:49:21 +0100 |
| commit | 36cfcb530f6810afca93e75c47f767a453a99361 (patch) | |
| tree | 10070f47738c1662a74dd101993dc76d7fbfbca0 /Source/Core/DiscIO/CompressedBlob.cpp | |
| parent | c2d8191fbb2115ddbf09bb026dd68b81d5624394 (diff) | |
IOFile: Make origin parameter to Seek() an enum class.
Diffstat (limited to 'Source/Core/DiscIO/CompressedBlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/CompressedBlob.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/CompressedBlob.cpp b/Source/Core/DiscIO/CompressedBlob.cpp index 8f491a41c6..f537d8b583 100644 --- a/Source/Core/DiscIO/CompressedBlob.cpp +++ b/Source/Core/DiscIO/CompressedBlob.cpp @@ -38,7 +38,7 @@ CompressedBlobReader::CompressedBlobReader(File::IOFile file, const std::string& : m_file(std::move(file)), m_file_name(filename) { m_file_size = m_file.GetSize(); - m_file.Seek(0, SEEK_SET); + m_file.Seek(0, File::SeekOrigin::Begin); m_file.ReadArray(&m_header, 1); SetSectorSize(m_header.block_size); @@ -104,7 +104,7 @@ bool CompressedBlobReader::GetBlock(u64 block_num, u8* out_ptr) // clear unused part of zlib buffer. maybe this can be deleted when it works fully. memset(&m_zlib_buffer[comp_block_size], 0, m_zlib_buffer.size() - comp_block_size); - m_file.Seek(offset, SEEK_SET); + m_file.Seek(offset, File::SeekOrigin::Begin); if (!m_file.ReadBytes(m_zlib_buffer.data(), comp_block_size)) { ERROR_LOG_FMT(DISCIO, "The disc image \"{}\" is truncated, some of the data is missing.", @@ -301,9 +301,9 @@ bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path, std::vector<u32> hashes(header.num_blocks); // seek past the header (we will write it at the end) - outfile.Seek(sizeof(CompressedBlobHeader), SEEK_CUR); + outfile.Seek(sizeof(CompressedBlobHeader), File::SeekOrigin::Current); // seek past the offset and hash tables (we will write them at the end) - outfile.Seek((sizeof(u64) + sizeof(u32)) * header.num_blocks, SEEK_CUR); + outfile.Seek((sizeof(u64) + sizeof(u32)) * header.num_blocks, File::SeekOrigin::Current); // Now we are ready to write compressed data! u64 inpos = 0; @@ -361,7 +361,7 @@ bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path, else { // Okay, go back and fill in headers - outfile.Seek(0, SEEK_SET); + outfile.Seek(0, File::SeekOrigin::Begin); outfile.WriteArray(&header, 1); outfile.WriteArray(offsets.data(), header.num_blocks); outfile.WriteArray(hashes.data(), header.num_blocks); @@ -385,11 +385,11 @@ bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path, bool IsGCZBlob(File::IOFile& file) { const u64 position = file.Tell(); - if (!file.Seek(0, SEEK_SET)) + if (!file.Seek(0, File::SeekOrigin::Begin)) return false; CompressedBlobHeader header; bool is_gcz = file.ReadArray(&header, 1) && header.magic_cookie == GCZ_MAGIC; - file.Seek(position, SEEK_SET); + file.Seek(position, File::SeekOrigin::Begin); return is_gcz; } |
