From: Gerhard Sittig Date: Mon, 3 Aug 2020 15:48:38 +0000 (+0200) Subject: sw_limits: add const for limits param for config_get X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d579755a662c7516cf70a38c36e3266e7bdb3ee8;p=libsigrok.git sw_limits: add const for limits param for config_get The sr_sw_limits_config_get() routine exclusively reads the 'limits' parameter, need not write to it. Add the 'const' attribute. --- diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 339c43bc..378c86d4 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -2392,7 +2392,7 @@ struct sr_sw_limits { uint64_t start_time; }; -SR_PRIV int sr_sw_limits_config_get(struct sr_sw_limits *limits, uint32_t key, +SR_PRIV int sr_sw_limits_config_get(const struct sr_sw_limits *limits, uint32_t key, GVariant **data); SR_PRIV int sr_sw_limits_config_set(struct sr_sw_limits *limits, uint32_t key, GVariant *data); diff --git a/src/sw_limits.c b/src/sw_limits.c index 9d80c06b..55ca79da 100644 --- a/src/sw_limits.c +++ b/src/sw_limits.c @@ -57,7 +57,7 @@ SR_PRIV void sr_sw_limits_init(struct sr_sw_limits *limits) * @param data config item data * @return SR_ERR_NA if @p key is not a supported limit, SR_OK otherwise */ -SR_PRIV int sr_sw_limits_config_get(struct sr_sw_limits *limits, uint32_t key, +SR_PRIV int sr_sw_limits_config_get(const struct sr_sw_limits *limits, uint32_t key, GVariant **data) { switch (key) {