diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-12-04 00:39:47 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-01-19 16:24:56 +0100 |
commit | 4160b50a0b4c51f8b7191928cdf38d9fb0147fe2 (patch) | |
tree | 996998b7fe506101c8d91aeb71891eaac358902e /lib/io/compress | |
parent | 42194bf57d470e548e03c44f5c2340d7d23a3ecb (diff) |
Add a helper function to initialize libsquashfs objects
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/io/compress')
-rw-r--r-- | lib/io/compress/ostream_compressor.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/io/compress/ostream_compressor.c b/lib/io/compress/ostream_compressor.c index 314ce6b..f63a3d2 100644 --- a/lib/io/compress/ostream_compressor.c +++ b/lib/io/compress/ostream_compressor.c @@ -63,7 +63,6 @@ static void comp_destroy(sqfs_object_t *obj) ostream_t *ostream_compressor_create(ostream_t *strm, int comp_id) { ostream_comp_t *comp = NULL; - sqfs_object_t *obj; ostream_t *base; switch (comp_id) { @@ -94,6 +93,8 @@ ostream_t *ostream_compressor_create(ostream_t *strm, int comp_id) if (comp == NULL) return NULL; + sqfs_object_init(comp, comp_destroy, NULL); + comp->wrapped = strm; comp->inbuf_used = 0; @@ -101,8 +102,5 @@ ostream_t *ostream_compressor_create(ostream_t *strm, int comp_id) base->append = comp_append; base->flush = comp_flush; base->get_filename = comp_get_filename; - - obj = (sqfs_object_t *)comp; - obj->destroy = comp_destroy; return base; } |