From: Gerhard Sittig Date: Tue, 17 Oct 2023 19:28:16 +0000 (+0200) Subject: output/srzip: decorate read pointer as const for awareness X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=201bd256a8aa85035423023914889fe9f5db52db;p=libsigrok.git output/srzip: decorate read pointer as const for awareness Recipients of sample data as received from the data feed should consider this data read-only, they are handed a reference to a message which is also sent to other recipients. Add the 'const' decoration in the output/srzip module to raise awareness during future maintenance. --- diff --git a/src/output/srzip.c b/src/output/srzip.c index 28223c7c..e3b57e3e 100644 --- a/src/output/srzip.c +++ b/src/output/srzip.c @@ -396,12 +396,13 @@ static int zip_append(const struct sr_output *o, * @returns SR_OK et al error codes. */ static int zip_append_queue(const struct sr_output *o, - uint8_t *buf, size_t unitsize, size_t length, gboolean flush) + const uint8_t *buf, size_t unitsize, size_t length, gboolean flush) { struct out_context *outc; struct logic_buff *buff; size_t send_size, remain, copy_size; - uint8_t *wrptr, *rdptr; + const uint8_t *rdptr; + uint8_t *wrptr; int ret; outc = o->priv;