diff options
Diffstat (limited to 'core/io/zip_io.cpp')
-rw-r--r-- | core/io/zip_io.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/core/io/zip_io.cpp b/core/io/zip_io.cpp index 3a2a207d22..68dd633e70 100644 --- a/core/io/zip_io.cpp +++ b/core/io/zip_io.cpp @@ -33,7 +33,6 @@ #include "core/os/copymem.h" void *zipio_open(void *data, const char *p_fname, int mode) { - FileAccess *&f = *(FileAccess **)data; String fname; @@ -42,7 +41,6 @@ void *zipio_open(void *data, const char *p_fname, int mode) { if (mode & ZLIB_FILEFUNC_MODE_WRITE) { f = FileAccess::open(fname, FileAccess::WRITE); } else { - f = FileAccess::open(fname, FileAccess::READ); } @@ -53,31 +51,26 @@ void *zipio_open(void *data, const char *p_fname, int mode) { } uLong zipio_read(void *data, void *fdata, void *buf, uLong size) { - FileAccess *f = *(FileAccess **)data; return f->get_buffer((uint8_t *)buf, size); } uLong zipio_write(voidpf opaque, voidpf stream, const void *buf, uLong size) { - FileAccess *f = *(FileAccess **)opaque; f->store_buffer((uint8_t *)buf, size); return size; } long zipio_tell(voidpf opaque, voidpf stream) { - FileAccess *f = *(FileAccess **)opaque; return f->get_position(); } long zipio_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { - FileAccess *f = *(FileAccess **)opaque; int pos = offset; switch (origin) { - case ZLIB_FILEFUNC_SEEK_CUR: pos = f->get_position() + offset; break; @@ -93,7 +86,6 @@ long zipio_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { } int zipio_close(voidpf opaque, voidpf stream) { - FileAccess *&f = *(FileAccess **)opaque; if (f) { f->close(); @@ -104,25 +96,21 @@ int zipio_close(voidpf opaque, voidpf stream) { } int zipio_testerror(voidpf opaque, voidpf stream) { - FileAccess *f = *(FileAccess **)opaque; return (f && f->get_error() != OK) ? 1 : 0; } voidpf zipio_alloc(voidpf opaque, uInt items, uInt size) { - voidpf ptr = memalloc(items * size); zeromem(ptr, items * size); return ptr; } void zipio_free(voidpf opaque, voidpf address) { - memfree(address); } zlib_filefunc_def zipio_create_io_from_file(FileAccess **p_file) { - zlib_filefunc_def io; io.opaque = p_file; io.zopen_file = zipio_open; |