diff options
author | Simon Glass <sjg@chromium.org> | 2022-02-28 22:08:25 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-06 21:01:42 +0300 |
commit | ccfc9d78414df0fcb1c476c9e25925bc2ffe8897 (patch) | |
tree | 03e5e26443de6e2c867dac60480b00f46670f852 /lib/lzma | |
parent | 423cf0acdacd2260e362f1caec8a3aa6d2f59788 (diff) | |
download | u-boot-ccfc9d78414df0fcb1c476c9e25925bc2ffe8897.tar.xz |
lzma: Tidy up the function prototype
This should use a const pointer for the input stream. Fix this and also
add a proper comment.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/lzma')
-rw-r--r-- | lib/lzma/LzmaTools.c | 4 | ||||
-rw-r--r-- | lib/lzma/LzmaTools.h | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/lib/lzma/LzmaTools.c b/lib/lzma/LzmaTools.c index 521258e623..af88900d31 100644 --- a/lib/lzma/LzmaTools.c +++ b/lib/lzma/LzmaTools.c @@ -37,8 +37,8 @@ static void *SzAlloc(void *p, size_t size) { return malloc(size); } static void SzFree(void *p, void *address) { free(address); } -int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, - unsigned char *inStream, SizeT length) +int lzmaBuffToBuffDecompress(unsigned char *outStream, SizeT *uncompressedSize, + const unsigned char *inStream, SizeT length) { int res = SZ_ERROR_DATA; int i; diff --git a/lib/lzma/LzmaTools.h b/lib/lzma/LzmaTools.h index e52dfb8fac..2c46859a62 100644 --- a/lib/lzma/LzmaTools.h +++ b/lib/lzma/LzmaTools.h @@ -13,6 +13,19 @@ #include <lzma/LzmaTypes.h> -extern int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, - unsigned char *inStream, SizeT length); +/** + * lzmaBuffToBuffDecompress() - Decompress LZMA data + * + * @outStream: output buffer + * @uncompressedSize: On entry, the mnaximum uncompressed size of the data; + * on exit, the actual uncompressed size after processing + * @inStream: Compressed bytes to decompress + * @length: Sizeof @inStream + * @return 0 if OK, SZ_ERROR_DATA if the data is in a format that cannot be + * decompressed; SZ_ERROR_OUTPUT_EOF if *uncompressedSize is too small; + * see also other SZ_ERROR... values + */ +int lzmaBuffToBuffDecompress(unsigned char *outStream, SizeT *uncompressedSize, + const unsigned char *inStream, SizeT length); + #endif |