summaryrefslogtreecommitdiff
path: root/lib/sqfs/comp/gzip.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-03 19:43:54 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-04 00:58:53 +0100
commit44c81eeffe9c8820b1009a7a5c728782aa5ebf40 (patch)
tree544eceb6dc5633018e5147c88ca9b07dd0fb54d9 /lib/sqfs/comp/gzip.c
parent6f47796dc0761fac359ec59ce26c7af5154e538d (diff)
Add a generic copying mechanism to sqfs_object_t
This patch adds a deep-copy callback to sqfs_object_t and removes the copying mechanism from sqfs_compressor_t. This is also interesting for other types. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/gzip.c')
-rw-r--r--lib/sqfs/comp/gzip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqfs/comp/gzip.c b/lib/sqfs/comp/gzip.c
index 34164a6..351d733 100644
--- a/lib/sqfs/comp/gzip.c
+++ b/lib/sqfs/comp/gzip.c
@@ -221,7 +221,7 @@ static sqfs_s32 gzip_do_block(sqfs_compressor_t *base, const sqfs_u8 *in,
return 0;
}
-static sqfs_compressor_t *gzip_create_copy(sqfs_compressor_t *cmp)
+static sqfs_object_t *gzip_create_copy(const sqfs_object_t *cmp)
{
gzip_compressor_t *gzip = malloc(sizeof(*gzip));
int ret;
@@ -244,7 +244,7 @@ static sqfs_compressor_t *gzip_create_copy(sqfs_compressor_t *cmp)
return NULL;
}
- return (sqfs_compressor_t *)gzip;
+ return (sqfs_object_t *)gzip;
}
sqfs_compressor_t *gzip_compressor_create(const sqfs_compressor_config_t *cfg)
@@ -283,7 +283,7 @@ sqfs_compressor_t *gzip_compressor_create(const sqfs_compressor_config_t *cfg)
base->do_block = gzip_do_block;
base->write_options = gzip_write_options;
base->read_options = gzip_read_options;
- base->create_copy = gzip_create_copy;
+ ((sqfs_object_t *)base)->copy = gzip_create_copy;
((sqfs_object_t *)base)->destroy = gzip_destroy;
if (gzip->compress) {