compress: zstd: update ringbuffer api usage to use const buffer pointer

This commit is contained in:
2025-07-30 18:31:54 +01:00
parent 5a7f0b8535
commit 8410841b87

View File

@@ -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;
}