From: Gerhard Sittig Date: Sat, 23 Apr 2022 19:01:12 +0000 (+0200) Subject: input: decorate sr_input_find() parameter as const X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e3847923a4ddf50349dcf21259cd4a02722c2960;p=libsigrok.git input: decorate sr_input_find() parameter as const The caller's input module name is only read for comparison. Decorate it with the 'const' attribute to simplify calling application code. --- diff --git a/include/libsigrok/proto.h b/include/libsigrok/proto.h index 41d9cfcc..357512ca 100644 --- a/include/libsigrok/proto.h +++ b/include/libsigrok/proto.h @@ -166,7 +166,7 @@ SR_API const char *sr_input_name_get(const struct sr_input_module *imod); SR_API const char *sr_input_description_get(const struct sr_input_module *imod); SR_API const char *const *sr_input_extensions_get( const struct sr_input_module *imod); -SR_API const struct sr_input_module *sr_input_find(char *id); +SR_API const struct sr_input_module *sr_input_find(const char *id); SR_API const struct sr_option **sr_input_options_get(const struct sr_input_module *imod); SR_API void sr_input_options_free(const struct sr_option **options); SR_API struct sr_input *sr_input_new(const struct sr_input_module *imod, diff --git a/src/input/input.c b/src/input/input.c index b5de532b..c4957e76 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -173,7 +173,7 @@ SR_API const char *const *sr_input_extensions_get( * * @since 0.4.0 */ -SR_API const struct sr_input_module *sr_input_find(char *id) +SR_API const struct sr_input_module *sr_input_find(const char *id) { int i;