summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-02-21 06:33:45 +0100
committerDavid Lamparter <equinox@diac24.net>2021-03-17 06:18:17 +0100
commit8451921b70044a2c1075e7ba391f095fabee2550 (patch)
treeb624fd822ce8e1c74840796b3c91a3a747b9e9ba /lib
parent*: require semicolon after DEFINE_MTYPE & co (diff)
downloadfrr-8451921b70044a2c1075e7ba391f095fabee2550.tar.xz
frr-8451921b70044a2c1075e7ba391f095fabee2550.zip
*: require semicolon after DEFINE_HOOK & co.
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/agentx.c2
-rw-r--r--lib/hook.h13
-rw-r--r--lib/if.c4
-rw-r--r--lib/if.h4
-rw-r--r--lib/libfrr.c8
-rw-r--r--lib/libfrr.h8
-rw-r--r--lib/log_vty.c2
-rw-r--r--lib/log_vty.h2
-rw-r--r--lib/northbound.h6
-rw-r--r--lib/routing_nb.h2
-rw-r--r--lib/routing_nb_config.c2
-rw-r--r--lib/smux.h2
-rw-r--r--lib/zlog.c6
-rw-r--r--lib/zlog.h6
14 files changed, 35 insertions, 32 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index c1ff7a61b..3f1a8edba 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -36,7 +36,7 @@
XREF_SETUP()
-DEFINE_HOOK(agentx_enabled, (), ())
+DEFINE_HOOK(agentx_enabled, (), ());
static int agentx_enabled = 0;
diff --git a/lib/hook.h b/lib/hook.h
index bef5351e9..ff3ef29fa 100644
--- a/lib/hook.h
+++ b/lib/hook.h
@@ -35,10 +35,10 @@ extern "C" {
*
* mydaemon.h:
* #include "hook.h"
- * DECLARE_HOOK (some_update_event, (struct eventinfo *info), (info))
+ * DECLARE_HOOK (some_update_event, (struct eventinfo *info), (info));
*
* mydaemon.c:
- * DEFINE_HOOK (some_update_event, (struct eventinfo *info), (info))
+ * DEFINE_HOOK (some_update_event, (struct eventinfo *info), (info));
* ...
* hook_call (some_update_event, info)
*
@@ -184,7 +184,7 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg,
#define HOOK_ADDARG(...) (hookarg , ## __VA_ARGS__)
/* use in header file - declares the hook and its arguments
- * usage: DECLARE_HOOK(my_hook, (int arg1, struct foo *arg2), (arg1, arg2))
+ * usage: DECLARE_HOOK(my_hook, (int arg1, struct foo *arg2), (arg1, arg2));
* as above, "passlist" must use the same order and same names as "arglist"
*
* theoretically passlist is not neccessary, but let's keep things simple and
@@ -201,7 +201,9 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg,
int(*funcptr) HOOK_ADDDEF arglist) \
{ \
return (void *)funcptr; \
- }
+ } \
+ MACRO_REQUIRE_SEMICOLON() /* end */
+
#define DECLARE_KOOH(hookname, arglist, passlist) \
DECLARE_HOOK(hookname, arglist, passlist)
@@ -230,7 +232,8 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg,
hooksum += hookp.farg HOOK_ADDARG passlist; \
} \
return hooksum; \
- }
+ } \
+ MACRO_REQUIRE_SEMICOLON() /* end */
#define DEFINE_HOOK(hookname, arglist, passlist) \
DEFINE_HOOK_INT(hookname, arglist, passlist, false)
diff --git a/lib/if.c b/lib/if.c
index 6af8aa6e0..d4016c285 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -55,8 +55,8 @@ RB_GENERATE(if_index_head, interface, index_entry, if_cmp_index_func);
DEFINE_QOBJ_TYPE(interface)
-DEFINE_HOOK(if_add, (struct interface * ifp), (ifp))
-DEFINE_KOOH(if_del, (struct interface * ifp), (ifp))
+DEFINE_HOOK(if_add, (struct interface * ifp), (ifp));
+DEFINE_KOOH(if_del, (struct interface * ifp), (ifp));
static struct interface_master{
int (*create_hook)(struct interface *ifp);
diff --git a/lib/if.h b/lib/if.h
index 1ea295fb4..8c8684175 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -378,8 +378,8 @@ DECLARE_QOBJ_TYPE(interface)
* can use 1000+ so they run after the daemon has initialised daemon-specific
* interface data
*/
-DECLARE_HOOK(if_add, (struct interface * ifp), (ifp))
-DECLARE_KOOH(if_del, (struct interface * ifp), (ifp))
+DECLARE_HOOK(if_add, (struct interface * ifp), (ifp));
+DECLARE_KOOH(if_del, (struct interface * ifp), (ifp));
#define METRIC_MAX (~0)
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 51b97369c..5b0a523fb 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -45,10 +45,10 @@
#include "defaults.h"
#include "frrscript.h"
-DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm))
-DEFINE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm))
-DEFINE_KOOH(frr_early_fini, (), ())
-DEFINE_KOOH(frr_fini, (), ())
+DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
+DEFINE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm));
+DEFINE_KOOH(frr_early_fini, (), ());
+DEFINE_KOOH(frr_fini, (), ());
const char frr_sysconfdir[] = SYSCONFDIR;
char frr_vtydir[256];
diff --git a/lib/libfrr.h b/lib/libfrr.h
index 825f502bd..c1af59891 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -141,8 +141,8 @@ extern enum frr_cli_mode frr_get_cli_mode(void);
extern uint32_t frr_get_fd_limit(void);
extern bool frr_is_startup_fd(int fd);
-DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm))
-DECLARE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm))
+DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
+DECLARE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm));
extern void frr_config_fork(void);
extern void frr_run(struct thread_master *master);
@@ -153,10 +153,10 @@ extern bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len,
/* these two are before the protocol daemon does its own shutdown
* it's named this way being the counterpart to frr_late_init */
-DECLARE_KOOH(frr_early_fini, (), ())
+DECLARE_KOOH(frr_early_fini, (), ());
extern void frr_early_fini(void);
/* and these two are after the daemon did its own cleanup */
-DECLARE_KOOH(frr_fini, (), ())
+DECLARE_KOOH(frr_fini, (), ());
extern void frr_fini(void);
extern char config_default[512];
diff --git a/lib/log_vty.c b/lib/log_vty.c
index d1dcac234..7dadca805 100644
--- a/lib/log_vty.c
+++ b/lib/log_vty.c
@@ -33,7 +33,7 @@
#define ZLOG_MAXLVL(a, b) MAX(a, b)
-DEFINE_HOOK(zlog_rotate, (), ())
+DEFINE_HOOK(zlog_rotate, (), ());
static const int log_default_lvl = LOG_DEBUG;
diff --git a/lib/log_vty.h b/lib/log_vty.h
index 16c447546..f0fb7d3db 100644
--- a/lib/log_vty.h
+++ b/lib/log_vty.h
@@ -34,7 +34,7 @@ extern void log_config_write(struct vty *vty);
extern int log_level_match(const char *s);
extern void log_show_syslog(struct vty *vty);
-DECLARE_HOOK(zlog_rotate, (), ())
+DECLARE_HOOK(zlog_rotate, (), ());
extern void zlog_rotate(void);
#ifdef __cplusplus
diff --git a/lib/northbound.h b/lib/northbound.h
index 3e1342f98..21aad64a0 100644
--- a/lib/northbound.h
+++ b/lib/northbound.h
@@ -677,9 +677,9 @@ typedef int (*nb_oper_data_cb)(const struct lys_node *snode,
/* Hooks. */
DECLARE_HOOK(nb_notification_send, (const char *xpath, struct list *arguments),
- (xpath, arguments))
-DECLARE_HOOK(nb_client_debug_config_write, (struct vty *vty), (vty))
-DECLARE_HOOK(nb_client_debug_set_all, (uint32_t flags, bool set), (flags, set))
+ (xpath, arguments));
+DECLARE_HOOK(nb_client_debug_config_write, (struct vty *vty), (vty));
+DECLARE_HOOK(nb_client_debug_set_all, (uint32_t flags, bool set), (flags, set));
/* Northbound debugging records */
extern struct debug nb_dbg_cbs_config;
diff --git a/lib/routing_nb.h b/lib/routing_nb.h
index ffba631a1..bdd12b262 100644
--- a/lib/routing_nb.h
+++ b/lib/routing_nb.h
@@ -24,7 +24,7 @@ int routing_control_plane_protocols_control_plane_protocol_destroy(
* callbacks for routing to handle configuration events
* based on the control plane protocol
*/
-DECLARE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args))
+DECLARE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args));
void routing_control_plane_protocols_register_vrf_dependency(void);
diff --git a/lib/routing_nb_config.c b/lib/routing_nb_config.c
index 17698d2b8..f66f32015 100644
--- a/lib/routing_nb_config.c
+++ b/lib/routing_nb_config.c
@@ -24,7 +24,7 @@
#include "routing_nb.h"
-DEFINE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args))
+DEFINE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args));
/*
* XPath: /frr-routing:routing/control-plane-protocols/control-plane-protocol
diff --git a/lib/smux.h b/lib/smux.h
index 57128b792..c063833e4 100644
--- a/lib/smux.h
+++ b/lib/smux.h
@@ -157,7 +157,7 @@ extern void oid_copy_int(oid oid[], int *val);
extern void oid2string(oid oid[], int len, char *string);
extern void oid_copy_str(oid oid[], const char *string, int len);
-DECLARE_HOOK(agentx_enabled, (), ())
+DECLARE_HOOK(agentx_enabled, (), ());
#ifdef __cplusplus
}
diff --git a/lib/zlog.c b/lib/zlog.c
index ca7f8da2e..730485464 100644
--- a/lib/zlog.c
+++ b/lib/zlog.c
@@ -59,10 +59,10 @@ DEFINE_MTYPE_STATIC(LIB, LOG_TLSBUF, "log thread-local buffer");
DEFINE_HOOK(zlog_init, (const char *progname, const char *protoname,
unsigned short instance, uid_t uid, gid_t gid),
- (progname, protoname, instance, uid, gid))
-DEFINE_KOOH(zlog_fini, (), ())
+ (progname, protoname, instance, uid, gid));
+DEFINE_KOOH(zlog_fini, (), ());
DEFINE_HOOK(zlog_aux_init, (const char *prefix, int prio_min),
- (prefix, prio_min))
+ (prefix, prio_min));
char zlog_prefix[128];
size_t zlog_prefixsz;
diff --git a/lib/zlog.h b/lib/zlog.h
index 4fdb47bb9..d95b801b2 100644
--- a/lib/zlog.h
+++ b/lib/zlog.h
@@ -247,17 +247,17 @@ extern void zlog_init(const char *progname, const char *protoname,
unsigned short instance, uid_t uid, gid_t gid);
DECLARE_HOOK(zlog_init, (const char *progname, const char *protoname,
unsigned short instance, uid_t uid, gid_t gid),
- (progname, protoname, instance, uid, gid))
+ (progname, protoname, instance, uid, gid));
extern void zlog_fini(void);
-DECLARE_KOOH(zlog_fini, (), ())
+DECLARE_KOOH(zlog_fini, (), ());
/* for tools & test programs, i.e. anything not a daemon.
* (no cleanup needed at exit)
*/
extern void zlog_aux_init(const char *prefix, int prio_min);
DECLARE_HOOK(zlog_aux_init, (const char *prefix, int prio_min),
- (prefix, prio_min))
+ (prefix, prio_min));
extern void zlog_startup_end(void);