From a32b5a9c793e4f4a4577837b73e783386842db02 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 24 Jun 2021 16:07:45 +0200 Subject: Remove casual un-const casting in various places Signed-off-by: David Oberhollenzer --- lib/sqfs/comp/gzip.c | 4 ++-- lib/sqfs/comp/lz4.c | 6 +++--- lib/sqfs/inode.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/sqfs') diff --git a/lib/sqfs/comp/gzip.c b/lib/sqfs/comp/gzip.c index 9be84db..91cd87e 100644 --- a/lib/sqfs/comp/gzip.c +++ b/lib/sqfs/comp/gzip.c @@ -138,7 +138,7 @@ static int find_strategy(gzip_compressor_t *gzip, const sqfs_u8 *in, strategy = flag_to_zlib_strategy(i); - gzip->strm.next_in = (void *)in; + gzip->strm.next_in = (z_const Bytef *)in; gzip->strm.avail_in = size; gzip->strm.next_out = out; gzip->strm.avail_out = outsize; @@ -189,7 +189,7 @@ static sqfs_s32 gzip_do_block(sqfs_compressor_t *base, const sqfs_u8 *in, if (ret != Z_OK) return SQFS_ERROR_COMPRESSOR; - gzip->strm.next_in = (void *)in; + gzip->strm.next_in = (const void *)in; gzip->strm.avail_in = size; gzip->strm.next_out = out; gzip->strm.avail_out = outsize; diff --git a/lib/sqfs/comp/lz4.c b/lib/sqfs/comp/lz4.c index f326870..152ae75 100644 --- a/lib/sqfs/comp/lz4.c +++ b/lib/sqfs/comp/lz4.c @@ -75,10 +75,10 @@ static sqfs_s32 lz4_comp_block(sqfs_compressor_t *base, const sqfs_u8 *in, return SQFS_ERROR_ARG_INVALID; if (lz4->high_compression) { - ret = LZ4_compress_HC((void *)in, (void *)out, + ret = LZ4_compress_HC((const void *)in, (void *)out, size, outsize, LZ4HC_CLEVEL_MAX); } else { - ret = LZ4_compress_default((void *)in, (void *)out, + ret = LZ4_compress_default((const void *)in, (void *)out, size, outsize); } @@ -97,7 +97,7 @@ static sqfs_s32 lz4_uncomp_block(sqfs_compressor_t *base, const sqfs_u8 *in, if (outsize >= 0x7FFFFFFF) return SQFS_ERROR_ARG_INVALID; - ret = LZ4_decompress_safe((void *)in, (void *)out, size, outsize); + ret = LZ4_decompress_safe((const void *)in, (void *)out, size, outsize); if (ret < 0) return SQFS_ERROR_COMPRESSOR; diff --git a/lib/sqfs/inode.c b/lib/sqfs/inode.c index 02d23e2..01e5ebe 100644 --- a/lib/sqfs/inode.c +++ b/lib/sqfs/inode.c @@ -349,8 +349,8 @@ int sqfs_inode_unpack_dir_index_entry(const sqfs_inode_generic_t *inode, size_t index) { sqfs_dir_index_t ent; + const char *ptr; size_t offset; - char *ptr; if (inode->base.type != SQFS_INODE_EXT_DIR) { if (inode->base.type == SQFS_INODE_DIR) @@ -360,7 +360,7 @@ int sqfs_inode_unpack_dir_index_entry(const sqfs_inode_generic_t *inode, } offset = 0; - ptr = (char *)inode->extra; + ptr = (const char *)inode->extra; for (;;) { if (offset >= inode->payload_bytes_used) -- cgit v1.2.3