summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/CompressedBlob.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2010-12-04 03:50:55 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2010-12-04 03:50:55 +0000
commite70e6236248aebe8740a3369e613d07f351c9546 (patch)
treefcbfedcf5f06064ab1fdc721f89ad5552924feb1 /Source/Core/DiscIO/Src/CompressedBlob.cpp
parent97e3a3ea6fda441b2b342f795aa0afd9de2d8e14 (diff)
Second attempt at issue 3458. Fixes issue 3458.
Replaces all occurrences of ftell and fseek with ftello and fseeko, respectively. This matters on non-win32 where only these names are altered by the _FILE_OFFSET_BITS define. Win32 still just maps the funcs to ftelli64/fseeki64. Also add some File::GetSize I had skipped in my last commit. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6515 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/CompressedBlob.cpp')
-rw-r--r--Source/Core/DiscIO/Src/CompressedBlob.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/DiscIO/Src/CompressedBlob.cpp b/Source/Core/DiscIO/Src/CompressedBlob.cpp
index 9d0daa74f7..ba29cccddf 100644
--- a/Source/Core/DiscIO/Src/CompressedBlob.cpp
+++ b/Source/Core/DiscIO/Src/CompressedBlob.cpp
@@ -108,7 +108,7 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
// clear unused part of zlib buffer. maybe this can be deleted when it works fully.
memset(zlib_buffer + comp_block_size, 0, zlib_buffer_size - comp_block_size);
- fseek(file, offset, SEEK_SET);
+ fseeko(file, offset, SEEK_SET);
fread(zlib_buffer, 1, comp_block_size, file);
u8* source = zlib_buffer;
@@ -203,9 +203,9 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type,
u8* in_buf = new u8[block_size];
// seek past the header (we will write it at the end)
- fseek(f, sizeof(CompressedBlobHeader), SEEK_CUR);
+ fseeko(f, sizeof(CompressedBlobHeader), SEEK_CUR);
// seek past the offset and hash tables (we will write them at the end)
- fseek(f, (sizeof(u64) + sizeof(u32)) * header.num_blocks, SEEK_CUR);
+ fseeko(f, (sizeof(u64) + sizeof(u32)) * header.num_blocks, SEEK_CUR);
// Now we are ready to write compressed data!
u64 position = 0;
@@ -217,7 +217,7 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type,
{
if (i % progress_monitor == 0)
{
- u64 inpos = ftell(inf);
+ u64 inpos = ftello(inf);
int ratio = 0;
if (inpos != 0)
ratio = (int)(100 * position / inpos);
@@ -279,7 +279,7 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type,
header.compressed_data_size = position;
// Okay, go back and fill in headers
- fseek(f, 0, SEEK_SET);
+ fseeko(f, 0, SEEK_SET);
fwrite(&header, sizeof(header), 1, f);
fwrite(offsets, sizeof(u64), header.num_blocks, f);
fwrite(hashes, sizeof(u32), header.num_blocks, f);