aboutsummaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/comp_lzo.c4
-rw-r--r--lib/common/data_writer_ostream.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/common/comp_lzo.c b/lib/common/comp_lzo.c
index 92a081c..2021d34 100644
--- a/lib/common/comp_lzo.c
+++ b/lib/common/comp_lzo.c
@@ -266,6 +266,8 @@ int lzo_compressor_create(const sqfs_compressor_config_t *cfg,
if (lzo == NULL)
return SQFS_ERROR_ALLOC;
+ sqfs_object_init(lzo, lzo_destroy, lzo_create_copy);
+
lzo->block_size = cfg->block_size;
lzo->algorithm = cfg->opt.lzo.algorithm;
lzo->level = cfg->level;
@@ -277,8 +279,6 @@ int lzo_compressor_create(const sqfs_compressor_config_t *cfg,
lzo_uncomp_block : lzo_comp_block;
base->write_options = lzo_write_options;
base->read_options = lzo_read_options;
- ((sqfs_object_t *)base)->copy = lzo_create_copy;
- ((sqfs_object_t *)base)->destroy = lzo_destroy;
*out = base;
return 0;
diff --git a/lib/common/data_writer_ostream.c b/lib/common/data_writer_ostream.c
index 94a04f2..fbd0431 100644
--- a/lib/common/data_writer_ostream.c
+++ b/lib/common/data_writer_ostream.c
@@ -64,7 +64,6 @@ ostream_t *data_writer_ostream_create(const char *filename,
int flags)
{
data_writer_ostream_t *strm = calloc(1, sizeof(*strm));
- sqfs_object_t *obj = (sqfs_object_t *)strm;
ostream_t *base = (ostream_t *)strm;
int ret;
@@ -73,6 +72,8 @@ ostream_t *data_writer_ostream_create(const char *filename,
return NULL;
}
+ sqfs_object_init(strm, stream_destroy, NULL);
+
ret = sqfs_block_processor_begin_file(proc, inode, NULL, flags);
if (ret != 0) {
@@ -86,6 +87,5 @@ ostream_t *data_writer_ostream_create(const char *filename,
base->append = stream_append;
base->flush = stream_flush;
base->get_filename = stream_get_filename;
- obj->destroy = stream_destroy;
return base;
}