diff options
author | Slava Monich <slava.monich@jolla.com> | 2018-10-20 02:05:50 +0300 |
---|---|---|
committer | Daniel Wagner <wagi@monom.org> | 2018-10-28 19:57:24 +0100 |
commit | 88424f9f89cfab810252d53bafd1354b80f8dd17 (patch) | |
tree | 5e2a42cbd3048d499e67d4ae2e6793654804247a /tools | |
parent | acf200507c9a9648f0839d9a11d0a1215ae99a41 (diff) | |
download | connman-88424f9f89cfab810252d53bafd1354b80f8dd17.tar.gz |
notifier: Constify vtables
connman_notifier vtables are read-only structures. Declaring them const
at compile time allows the compiler to actually make them read-only at
runtime.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/iptables-unit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/iptables-unit.c b/tools/iptables-unit.c index 426631a0..0ab42491 100644 --- a/tools/iptables-unit.c +++ b/tools/iptables-unit.c @@ -318,7 +318,7 @@ static void test_iptables_target0(void) assert_rule_not_exists("filter", "-A INPUT -m mark --mark 0x2"); } -struct connman_notifier *nat_notifier; +const struct connman_notifier *nat_notifier; struct connman_service { char *dummy; @@ -329,14 +329,14 @@ char *connman_service_get_interface(struct connman_service *service) return "eth0"; } -int connman_notifier_register(struct connman_notifier *notifier) +int connman_notifier_register(const struct connman_notifier *notifier) { nat_notifier = notifier; return 0; } -void connman_notifier_unregister(struct connman_notifier *notifier) +void connman_notifier_unregister(const struct connman_notifier *notifier) { nat_notifier = NULL; } |