From: Gerhard Sittig Date: Tue, 12 Oct 2021 14:29:24 +0000 (+0200) Subject: input: accept const sdi in feed queue API X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=57140e5a804dd5b616120f05e38c3409241bb37c;p=libsigrok.git input: accept const sdi in feed queue API The common feed queue support code needs an sdi to submit sample data to the session feed. Decorate this argument as const to silence compiler warnings. This matches the sr_session_send() API. --- diff --git a/src/input/feed_queue.c b/src/input/feed_queue.c index 98443244..bd5c16c7 100644 --- a/src/input/feed_queue.c +++ b/src/input/feed_queue.c @@ -22,7 +22,7 @@ #include struct feed_queue_logic { - struct sr_dev_inst *sdi; + const struct sr_dev_inst *sdi; size_t unit_size; size_t alloc_count; size_t fill_count; @@ -31,7 +31,8 @@ struct feed_queue_logic { struct sr_datafeed_logic logic; }; -SR_API struct feed_queue_logic *feed_queue_logic_alloc(struct sr_dev_inst *sdi, +SR_API struct feed_queue_logic *feed_queue_logic_alloc( + const struct sr_dev_inst *sdi, size_t sample_count, size_t unit_size) { struct feed_queue_logic *q; @@ -105,7 +106,7 @@ SR_API void feed_queue_logic_free(struct feed_queue_logic *q) } struct feed_queue_analog { - struct sr_dev_inst *sdi; + const struct sr_dev_inst *sdi; size_t alloc_count; size_t fill_count; float *data_values; @@ -118,7 +119,8 @@ struct feed_queue_analog { GSList *channels; }; -SR_API struct feed_queue_analog *feed_queue_analog_alloc(struct sr_dev_inst *sdi, +SR_API struct feed_queue_analog *feed_queue_analog_alloc( + const struct sr_dev_inst *sdi, size_t sample_count, int digits, struct sr_channel *ch) { struct feed_queue_analog *q; diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 1c37ee27..1960264c 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -2683,7 +2683,7 @@ struct feed_queue_logic; struct feed_queue_analog; SR_API struct feed_queue_logic *feed_queue_logic_alloc( - struct sr_dev_inst *sdi, + const struct sr_dev_inst *sdi, size_t sample_count, size_t unit_size); SR_API int feed_queue_logic_submit(struct feed_queue_logic *q, const uint8_t *data, size_t count); @@ -2691,7 +2691,7 @@ SR_API int feed_queue_logic_flush(struct feed_queue_logic *q); SR_API void feed_queue_logic_free(struct feed_queue_logic *q); SR_API struct feed_queue_analog *feed_queue_analog_alloc( - struct sr_dev_inst *sdi, + const struct sr_dev_inst *sdi, size_t sample_count, int digits, struct sr_channel *ch); SR_API int feed_queue_analog_submit(struct feed_queue_analog *q, float data, size_t count);