From 4160b50a0b4c51f8b7191928cdf38d9fb0147fe2 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 4 Dec 2022 00:39:47 +0100 Subject: Add a helper function to initialize libsquashfs objects Signed-off-by: David Oberhollenzer --- lib/sqfs/win32/io_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqfs/win32') diff --git a/lib/sqfs/win32/io_file.c b/lib/sqfs/win32/io_file.c index cfef296..548a246 100644 --- a/lib/sqfs/win32/io_file.c +++ b/lib/sqfs/win32/io_file.c @@ -187,6 +187,8 @@ sqfs_file_t *sqfs_open_file(const char *filename, sqfs_u32 flags) return NULL; } + sqfs_object_init(file, stdio_destroy, stdio_copy); + if (flags & SQFS_FILE_OPEN_READ_ONLY) { file->readonly = true; access_flags = GENERIC_READ; @@ -231,7 +233,5 @@ sqfs_file_t *sqfs_open_file(const char *filename, sqfs_u32 flags) base->write_at = stdio_write_at; base->get_size = stdio_get_size; base->truncate = stdio_truncate; - ((sqfs_object_t *)base)->destroy = stdio_destroy; - ((sqfs_object_t *)base)->copy = stdio_copy; return base; } -- cgit v1.2.3