summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-02-21 06:18:10 +0100
committerDavid Lamparter <equinox@diac24.net>2021-03-17 06:18:17 +0100
commitbf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c (patch)
treecd62a7c64fe8eb9f3252e1b608f1fb939c2a772c /pbrd
parent*: require ISO C11 (or C++11) (diff)
downloadfrr-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 'pbrd')
-rw-r--r--pbrd/pbr_map.c6
-rw-r--r--pbrd/pbr_memory.c2
-rw-r--r--pbrd/pbr_memory.h2
-rw-r--r--pbrd/pbr_nht.c2
-rw-r--r--pbrd/pbr_vrf.c2
-rw-r--r--pbrd/pbr_zebra.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index 5b851988f..c3417a275 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -37,9 +37,9 @@
#include "pbr_debug.h"
#include "pbr_vrf.h"
-DEFINE_MTYPE_STATIC(PBRD, PBR_MAP, "PBR Map")
-DEFINE_MTYPE_STATIC(PBRD, PBR_MAP_SEQNO, "PBR Map Sequence")
-DEFINE_MTYPE_STATIC(PBRD, PBR_MAP_INTERFACE, "PBR Map Interface")
+DEFINE_MTYPE_STATIC(PBRD, PBR_MAP, "PBR Map");
+DEFINE_MTYPE_STATIC(PBRD, PBR_MAP_SEQNO, "PBR Map Sequence");
+DEFINE_MTYPE_STATIC(PBRD, PBR_MAP_INTERFACE, "PBR Map Interface");
static uint32_t pbr_map_sequence_unique;
diff --git a/pbrd/pbr_memory.c b/pbrd/pbr_memory.c
index febe406ca..5531d4193 100644
--- a/pbrd/pbr_memory.c
+++ b/pbrd/pbr_memory.c
@@ -24,4 +24,4 @@
#include "pbrd/pbr_memory.h"
-DEFINE_MGROUP(PBRD, "pbrd")
+DEFINE_MGROUP(PBRD, "pbrd");
diff --git a/pbrd/pbr_memory.h b/pbrd/pbr_memory.h
index a87d51909..eb13d5d9d 100644
--- a/pbrd/pbr_memory.h
+++ b/pbrd/pbr_memory.h
@@ -19,6 +19,6 @@
*/
#ifndef __PBR_MEMORY_H__
-DECLARE_MGROUP(PBRD)
+DECLARE_MGROUP(PBRD);
#endif
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index ba9ad97ab..e127999b0 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -35,7 +35,7 @@
#include "pbrd/pbr_memory.h"
#include "pbrd/pbr_debug.h"
-DEFINE_MTYPE_STATIC(PBRD, PBR_NHG, "PBR Nexthop Groups")
+DEFINE_MTYPE_STATIC(PBRD, PBR_NHG, "PBR Nexthop Groups");
struct hash *pbr_nhg_hash;
static struct hash *pbr_nhrc_hash;
diff --git a/pbrd/pbr_vrf.c b/pbrd/pbr_vrf.c
index 328460740..1b69e23ce 100644
--- a/pbrd/pbr_vrf.c
+++ b/pbrd/pbr_vrf.c
@@ -28,7 +28,7 @@
#include "pbr_nht.h"
#include "pbr_zebra.h"
-DEFINE_MTYPE_STATIC(PBRD, PBR_MAP_VRF, "PBR Map VRF")
+DEFINE_MTYPE_STATIC(PBRD, PBR_MAP_VRF, "PBR Map VRF");
static struct pbr_vrf *pbr_vrf_alloc(void)
{
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 467bbc8f7..4b73e13c2 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -41,7 +41,7 @@
#include "pbr_debug.h"
#include "pbr_vrf.h"
-DEFINE_MTYPE_STATIC(PBRD, PBR_INTERFACE, "PBR Interface")
+DEFINE_MTYPE_STATIC(PBRD, PBR_INTERFACE, "PBR Interface");
/* Zebra structure to hold current status. */
struct zclient *zclient;