summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/CompressedBlob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DiscIO/CompressedBlob.cpp')
-rw-r--r--Source/Core/DiscIO/CompressedBlob.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/CompressedBlob.cpp b/Source/Core/DiscIO/CompressedBlob.cpp
index 8f491a41c6..056c2f4fd3 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,12 +104,12 @@ 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.",
m_file_name);
- m_file.Clear();
+ m_file.ClearError();
return false;
}
@@ -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;
}