diff options
| author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-27 18:43:07 +0200 | 
|---|---|---|
| committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-27 18:43:07 +0200 | 
| commit | cdb1c79153b2b1377fa0ca7e1beda2b6b9b2c687 (patch) | |
| tree | 18217e4bdff2e4e37adccbb7e078623f4fac3e6b /include | |
| parent | 40232f4bd4d7e8e001f7d1e8f120606f59b2c147 (diff) | |
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sqfs/compress.h | 4 | ||||
| -rw-r--r-- | include/sqfs/data_reader.h | 8 | 
2 files changed, 6 insertions, 6 deletions
| 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 diff --git a/include/sqfs/data_reader.h b/include/sqfs/data_reader.h index f41abeb..bf29417 100644 --- a/include/sqfs/data_reader.h +++ b/include/sqfs/data_reader.h @@ -140,10 +140,10 @@ SQFS_API int sqfs_data_reader_get_block(sqfs_data_reader_t *data,   *         past the end of the file and a negative @ref E_SQFS_ERROR value   *         on failure.   */ -SQFS_API ssize_t sqfs_data_reader_read(sqfs_data_reader_t *data, -				       const sqfs_inode_generic_t *inode, -				       sqfs_u64 offset, void *buffer, -				       size_t size); +SQFS_API sqfs_s32 sqfs_data_reader_read(sqfs_data_reader_t *data, +					const sqfs_inode_generic_t *inode, +					sqfs_u64 offset, void *buffer, +					sqfs_u32 size);  #ifdef __cplusplus  } | 
