diff options
author | David Lamparter <equinox@diac24.net> | 2021-02-21 06:18:10 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2021-03-17 06:18:17 +0100 |
commit | bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c (patch) | |
tree | cd62a7c64fe8eb9f3252e1b608f1fb939c2a772c /pathd | |
parent | *: require ISO C11 (or C++11) (diff) | |
download | frr-bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c.tar.xz frr-bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c.zip |
*: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet. Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition. And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...
With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.
Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'pathd')
-rw-r--r-- | pathd/path_cli.c | 2 | ||||
-rw-r--r-- | pathd/path_memory.c | 2 | ||||
-rw-r--r-- | pathd/path_memory.h | 2 | ||||
-rw-r--r-- | pathd/path_pcep_memory.c | 6 | ||||
-rw-r--r-- | pathd/path_pcep_memory.h | 6 | ||||
-rw-r--r-- | pathd/pathd.c | 6 |
6 files changed, 12 insertions, 12 deletions
diff --git a/pathd/path_cli.c b/pathd/path_cli.c index 8beb42813..a46ec5fac 100644 --- a/pathd/path_cli.c +++ b/pathd/path_cli.c @@ -46,7 +46,7 @@ static int config_write_traffic_eng(struct vty *vty); static int config_write_segment_lists(struct vty *vty); static int config_write_sr_policies(struct vty *vty); -DEFINE_MTYPE_STATIC(PATHD, PATH_CLI, "Client") +DEFINE_MTYPE_STATIC(PATHD, PATH_CLI, "Client"); /* Vty node structures. */ static struct cmd_node segment_routing_node = { diff --git a/pathd/path_memory.c b/pathd/path_memory.c index ad4904a29..7a78c09cf 100644 --- a/pathd/path_memory.c +++ b/pathd/path_memory.c @@ -22,4 +22,4 @@ #include "pathd/path_memory.h" -DEFINE_MGROUP(PATHD, "pathd") +DEFINE_MGROUP(PATHD, "pathd"); diff --git a/pathd/path_memory.h b/pathd/path_memory.h index e2f6787f6..a0896cdad 100644 --- a/pathd/path_memory.h +++ b/pathd/path_memory.h @@ -21,6 +21,6 @@ #include "memory.h" -DECLARE_MGROUP(PATHD) +DECLARE_MGROUP(PATHD); #endif /* _FRR_PATH_MEMORY_H_ */ diff --git a/pathd/path_pcep_memory.c b/pathd/path_pcep_memory.c index 8f608090a..5cb5fb33e 100644 --- a/pathd/path_pcep_memory.c +++ b/pathd/path_pcep_memory.c @@ -22,6 +22,6 @@ #include "pathd/path_pcep_memory.h" -DEFINE_MTYPE(PATHD, PCEP, "PCEP module") -DEFINE_MTYPE(PATHD, PCEPLIB_INFRA, "PCEPlib Infrastructure") -DEFINE_MTYPE(PATHD, PCEPLIB_MESSAGES, "PCEPlib PCEP Messages") +DEFINE_MTYPE(PATHD, PCEP, "PCEP module"); +DEFINE_MTYPE(PATHD, PCEPLIB_INFRA, "PCEPlib Infrastructure"); +DEFINE_MTYPE(PATHD, PCEPLIB_MESSAGES, "PCEPlib PCEP Messages"); diff --git a/pathd/path_pcep_memory.h b/pathd/path_pcep_memory.h index 05c5e2d82..a44d178b2 100644 --- a/pathd/path_pcep_memory.h +++ b/pathd/path_pcep_memory.h @@ -21,8 +21,8 @@ #include "pathd/path_memory.h" -DECLARE_MTYPE(PCEP) -DECLARE_MTYPE(PCEPLIB_INFRA) -DECLARE_MTYPE(PCEPLIB_MESSAGES) +DECLARE_MTYPE(PCEP); +DECLARE_MTYPE(PCEPLIB_INFRA); +DECLARE_MTYPE(PCEPLIB_MESSAGES); #endif /* _FRR_PATH_PCEP_MEMORY_H_ */ diff --git a/pathd/pathd.c b/pathd/pathd.c index e2c7c9572..33e69e42d 100644 --- a/pathd/pathd.c +++ b/pathd/pathd.c @@ -30,9 +30,9 @@ #define HOOK_DELAY 3 -DEFINE_MTYPE_STATIC(PATHD, PATH_SEGMENT_LIST, "Segment List") -DEFINE_MTYPE_STATIC(PATHD, PATH_SR_POLICY, "SR Policy") -DEFINE_MTYPE_STATIC(PATHD, PATH_SR_CANDIDATE, "SR Policy candidate path") +DEFINE_MTYPE_STATIC(PATHD, PATH_SEGMENT_LIST, "Segment List"); +DEFINE_MTYPE_STATIC(PATHD, PATH_SR_POLICY, "SR Policy"); +DEFINE_MTYPE_STATIC(PATHD, PATH_SR_CANDIDATE, "SR Policy candidate path"); DEFINE_HOOK(pathd_candidate_created, (struct srte_candidate * candidate), (candidate)) |