service: Const-qualify 'connman_service_get_interface'.
PATCH 1/1 service: Const-qualify 'connman_service_get_interface'.
Const-qualify the network service argument to make it clear to the compiler, static analyzers, and human readers that the function is strictly a getter with no network service mutation side effects.
--- include/service.h | 2 +- src/service.c | 2 +- tools/iptables-unit.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/service.h +1 -1
@@ -116,7 +116,7 @@ void connman_service_unref_debug(struct connman_service *service,enum connman_service_type connman_service_get_type (const struct connman_service *service);enum connman_service_state connman_service_get_state (const struct connman_service *service); -char *connman_service_get_interface (struct connman_service *service); +char *connman_service_get_interface (const struct connman_service *service);const char *connman_service_get_identifier (const struct connman_service *service);const char *connman_service_get_domainname (const struct connman_service *service);
src/service.c +1 -1
@@ -6196,7 +6196,7 @@ enum connman_service_type connman_service_get_type(const struct connman_service* * Get network interface of service */ -char *connman_service_get_interface (struct connman_service *service) +char *connman_service_get_interface (const struct connman_service *service) {int index;
tools/iptables-unit.c +1 -1
@@ -624,7 +624,7 @@ struct connman_service {char *dummy; }; -char *connman_service_get_interface (struct connman_service *service) +char *connman_service_get_interface (const struct connman_service *service) {return "eth0" ; }
Signature · 1 line
2.42.0
Hi Grant,
Quoted 8 lines
Const-qualify the network service argument to make it clear to the compiler, static analyzers, and human readers that the function is strictly a getter with no network service mutation side effects.
---include/service.h | 2 +- src/service.c | 2 +- tools/iptables-unit.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
patch has been applied.
Regards
Marcel