compress: zstd: update ringbuffer api usage to use const buffer pointer
This commit is contained in:
@@ -106,7 +106,8 @@ static enum b_status compress(struct b_compressor *compressor)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
size_t in_available = 0, out_capacity = 0;
|
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);
|
status = b_ringbuffer_open_read_buffer(in, &in_buf, &in_available);
|
||||||
if (!B_OK(status)) {
|
if (!B_OK(status)) {
|
||||||
@@ -221,7 +222,8 @@ static enum b_status decompress(struct b_compressor *compressor)
|
|||||||
|
|
||||||
while (!(compressor->c_flags & COMPRESSOR_EOF)) {
|
while (!(compressor->c_flags & COMPRESSOR_EOF)) {
|
||||||
size_t in_available = 0, out_capacity = 0;
|
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);
|
status = b_ringbuffer_open_read_buffer(in, &in_buf, &in_available);
|
||||||
if (!B_OK(status)) {
|
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);
|
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) {
|
&& nr_consumed > 0) {
|
||||||
status = B_SUCCESS;
|
status = B_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user