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/dir_reader/dir_reader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqfs/dir_reader') diff --git a/lib/sqfs/dir_reader/dir_reader.c b/lib/sqfs/dir_reader/dir_reader.c index 68cebd3..38700df 100644 --- a/lib/sqfs/dir_reader/dir_reader.c +++ b/lib/sqfs/dir_reader/dir_reader.c @@ -122,6 +122,8 @@ sqfs_dir_reader_t *sqfs_dir_reader_create(const sqfs_super_t *super, if (rd == NULL) return NULL; + sqfs_object_init(rd, dir_reader_destroy, dir_reader_copy); + if (flags & SQFS_DIR_READER_DOT_ENTRIES) { ret = rbtree_init(&rd->dcache, sizeof(sqfs_u32), sizeof(sqfs_u64), dcache_key_compare); @@ -150,8 +152,6 @@ sqfs_dir_reader_t *sqfs_dir_reader_create(const sqfs_super_t *super, if (rd->meta_dir == NULL) goto fail_mdir; - ((sqfs_object_t *)rd)->destroy = dir_reader_destroy; - ((sqfs_object_t *)rd)->copy = dir_reader_copy; rd->super = super; rd->flags = flags; rd->state = DIR_STATE_NONE; -- cgit v1.2.3