From cdb1c79153b2b1377fa0ca7e1beda2b6b9b2c687 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 27 Sep 2019 18:43:07 +0200 Subject: Remove use of ssize_t from library API ssize_t is only available on POSIX platforms and even there it is only defined to hold at least -1 in the range of negative numbers. This commit replaces ssize_t return types with sqfs_s32 and the coresponding function arguments with sqfs_u32. Because the range of positiv numbers for a signed 32 bit number is only half that of the unsigned version, additional checks have to be added. Signed-off-by: David Oberhollenzer --- include/sqfs/compress.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/sqfs/compress.h') diff --git a/include/sqfs/compress.h b/include/sqfs/compress.h index 76bbd4c..ca126f7 100644 --- a/include/sqfs/compress.h +++ b/include/sqfs/compress.h @@ -83,8 +83,8 @@ struct sqfs_compressor_t { * the output buffer was too small when extracting or that * the result is larger than the input when compressing. */ - ssize_t (*do_block)(sqfs_compressor_t *cmp, const sqfs_u8 *in, - size_t size, sqfs_u8 *out, size_t outsize); + sqfs_s32 (*do_block)(sqfs_compressor_t *cmp, const sqfs_u8 *in, + sqfs_u32 size, sqfs_u8 *out, sqfs_u32 outsize); /** * @brief Create an exact copt of agiven compressor -- cgit v1.2.3