From 8410841b870304eb8d0a2293b284242e5390a643 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Wed, 30 Jul 2025 18:31:54 +0100 Subject: [PATCH] compress: zstd: update ringbuffer api usage to use const buffer pointer --- compress/function/zstd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compress/function/zstd.c b/compress/function/zstd.c index d5ba8cc..5614b9e 100644 --- a/compress/function/zstd.c +++ b/compress/function/zstd.c @@ -106,7 +106,8 @@ static enum b_status compress(struct b_compressor *compressor) while (1) { size_t in_available = 0, out_capacity = 0; - void *in_buf = NULL, *out_buf = NULL; + const void *in_buf = NULL; + void *out_buf = NULL; status = b_ringbuffer_open_read_buffer(in, &in_buf, &in_available); if (!B_OK(status)) { @@ -221,7 +222,8 @@ static enum b_status decompress(struct b_compressor *compressor) while (!(compressor->c_flags & COMPRESSOR_EOF)) { size_t in_available = 0, out_capacity = 0; - void *in_buf = NULL, *out_buf = NULL; + const void *in_buf = NULL; + void *out_buf = NULL; status = b_ringbuffer_open_read_buffer(in, &in_buf, &in_available); if (!B_OK(status)) { @@ -267,7 +269,7 @@ static enum b_status decompress(struct b_compressor *compressor) b_ringbuffer_close_write_buffer(out, &out_buf, z_out.pos); } - if ((status == B_ERR_NO_SPACE || status == B_ERR_NO_SPACE) + if ((status == B_ERR_NO_SPACE || status == B_ERR_NO_DATA) && nr_consumed > 0) { status = B_SUCCESS; }