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 /isisd | |
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 'isisd')
-rw-r--r-- | isisd/fabricd.c | 6 | ||||
-rw-r--r-- | isisd/isis_bfd.c | 2 | ||||
-rw-r--r-- | isisd/isis_memory.c | 44 | ||||
-rw-r--r-- | isisd/isis_memory.h | 44 | ||||
-rw-r--r-- | isisd/isis_mt.c | 6 | ||||
-rw-r--r-- | isisd/isis_sr.c | 2 | ||||
-rw-r--r-- | isisd/isis_tlvs.c | 6 | ||||
-rw-r--r-- | isisd/isis_tlvs.h | 2 | ||||
-rw-r--r-- | isisd/isis_tx_queue.c | 4 |
9 files changed, 58 insertions, 58 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c index 57e9e91c1..426b96e90 100644 --- a/isisd/fabricd.c +++ b/isisd/fabricd.c @@ -33,9 +33,9 @@ #include "isisd/isis_tx_queue.h" #include "isisd/isis_csm.h" -DEFINE_MTYPE_STATIC(ISISD, FABRICD_STATE, "ISIS OpenFabric") -DEFINE_MTYPE_STATIC(ISISD, FABRICD_NEIGHBOR, "ISIS OpenFabric Neighbor Entry") -DEFINE_MTYPE_STATIC(ISISD, FABRICD_FLOODING_INFO, "ISIS OpenFabric Flooding Log") +DEFINE_MTYPE_STATIC(ISISD, FABRICD_STATE, "ISIS OpenFabric"); +DEFINE_MTYPE_STATIC(ISISD, FABRICD_NEIGHBOR, "ISIS OpenFabric Neighbor Entry"); +DEFINE_MTYPE_STATIC(ISISD, FABRICD_FLOODING_INFO, "ISIS OpenFabric Flooding Log"); /* Tracks initial synchronization as per section 2.4 * diff --git a/isisd/isis_bfd.c b/isisd/isis_bfd.c index 4fac73511..3b51ec04c 100644 --- a/isisd/isis_bfd.c +++ b/isisd/isis_bfd.c @@ -32,7 +32,7 @@ #include "isisd/isisd.h" #include "isisd/fabricd.h" -DEFINE_MTYPE_STATIC(ISISD, BFD_SESSION, "ISIS BFD Session") +DEFINE_MTYPE_STATIC(ISISD, BFD_SESSION, "ISIS BFD Session"); struct bfd_session { int family; diff --git a/isisd/isis_memory.c b/isisd/isis_memory.c index f716e060c..34f6b6089 100644 --- a/isisd/isis_memory.c +++ b/isisd/isis_memory.c @@ -25,25 +25,25 @@ #include "isis_memory.h" -DEFINE_MGROUP(ISISD, "isisd") -DEFINE_MTYPE(ISISD, ISIS, "ISIS") -DEFINE_MTYPE(ISISD, ISIS_TMP, "ISIS TMP") -DEFINE_MTYPE(ISISD, ISIS_CIRCUIT, "ISIS circuit") -DEFINE_MTYPE(ISISD, ISIS_LSP, "ISIS LSP") -DEFINE_MTYPE(ISISD, ISIS_ADJACENCY, "ISIS adjacency") -DEFINE_MTYPE(ISISD, ISIS_ADJACENCY_INFO, "ISIS adjacency info") -DEFINE_MTYPE(ISISD, ISIS_AREA, "ISIS area") -DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address") -DEFINE_MTYPE(ISISD, ISIS_DYNHN, "ISIS dyn hostname") -DEFINE_MTYPE(ISISD, ISIS_SPFTREE, "ISIS SPFtree") -DEFINE_MTYPE(ISISD, ISIS_VERTEX, "ISIS vertex") -DEFINE_MTYPE(ISISD, ISIS_ROUTE_INFO, "ISIS route info") -DEFINE_MTYPE(ISISD, ISIS_NEXTHOP, "ISIS nexthop") -DEFINE_MTYPE(ISISD, ISIS_NEXTHOP_LABELS, "ISIS nexthop MPLS labels") -DEFINE_MTYPE(ISISD, ISIS_DICT, "ISIS dictionary") -DEFINE_MTYPE(ISISD, ISIS_DICT_NODE, "ISIS dictionary node") -DEFINE_MTYPE(ISISD, ISIS_EXT_ROUTE, "ISIS redistributed route") -DEFINE_MTYPE(ISISD, ISIS_EXT_INFO, "ISIS redistributed route info") -DEFINE_MTYPE(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters") -DEFINE_MTYPE(ISISD, ISIS_ACL_NAME, "ISIS access-list name") -DEFINE_MTYPE(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name") +DEFINE_MGROUP(ISISD, "isisd"); +DEFINE_MTYPE(ISISD, ISIS, "ISIS"); +DEFINE_MTYPE(ISISD, ISIS_TMP, "ISIS TMP"); +DEFINE_MTYPE(ISISD, ISIS_CIRCUIT, "ISIS circuit"); +DEFINE_MTYPE(ISISD, ISIS_LSP, "ISIS LSP"); +DEFINE_MTYPE(ISISD, ISIS_ADJACENCY, "ISIS adjacency"); +DEFINE_MTYPE(ISISD, ISIS_ADJACENCY_INFO, "ISIS adjacency info"); +DEFINE_MTYPE(ISISD, ISIS_AREA, "ISIS area"); +DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address"); +DEFINE_MTYPE(ISISD, ISIS_DYNHN, "ISIS dyn hostname"); +DEFINE_MTYPE(ISISD, ISIS_SPFTREE, "ISIS SPFtree"); +DEFINE_MTYPE(ISISD, ISIS_VERTEX, "ISIS vertex"); +DEFINE_MTYPE(ISISD, ISIS_ROUTE_INFO, "ISIS route info"); +DEFINE_MTYPE(ISISD, ISIS_NEXTHOP, "ISIS nexthop"); +DEFINE_MTYPE(ISISD, ISIS_NEXTHOP_LABELS, "ISIS nexthop MPLS labels"); +DEFINE_MTYPE(ISISD, ISIS_DICT, "ISIS dictionary"); +DEFINE_MTYPE(ISISD, ISIS_DICT_NODE, "ISIS dictionary node"); +DEFINE_MTYPE(ISISD, ISIS_EXT_ROUTE, "ISIS redistributed route"); +DEFINE_MTYPE(ISISD, ISIS_EXT_INFO, "ISIS redistributed route info"); +DEFINE_MTYPE(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters"); +DEFINE_MTYPE(ISISD, ISIS_ACL_NAME, "ISIS access-list name"); +DEFINE_MTYPE(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name"); diff --git a/isisd/isis_memory.h b/isisd/isis_memory.h index 5bcd2a398..5fd881e42 100644 --- a/isisd/isis_memory.h +++ b/isisd/isis_memory.h @@ -24,27 +24,27 @@ #include "memory.h" -DECLARE_MGROUP(ISISD) -DECLARE_MTYPE(ISIS) -DECLARE_MTYPE(ISIS_TMP) -DECLARE_MTYPE(ISIS_CIRCUIT) -DECLARE_MTYPE(ISIS_LSP) -DECLARE_MTYPE(ISIS_ADJACENCY) -DECLARE_MTYPE(ISIS_ADJACENCY_INFO) -DECLARE_MTYPE(ISIS_AREA) -DECLARE_MTYPE(ISIS_AREA_ADDR) -DECLARE_MTYPE(ISIS_DYNHN) -DECLARE_MTYPE(ISIS_SPFTREE) -DECLARE_MTYPE(ISIS_VERTEX) -DECLARE_MTYPE(ISIS_ROUTE_INFO) -DECLARE_MTYPE(ISIS_NEXTHOP) -DECLARE_MTYPE(ISIS_NEXTHOP_LABELS) -DECLARE_MTYPE(ISIS_DICT) -DECLARE_MTYPE(ISIS_DICT_NODE) -DECLARE_MTYPE(ISIS_EXT_ROUTE) -DECLARE_MTYPE(ISIS_EXT_INFO) -DECLARE_MTYPE(ISIS_MPLS_TE) -DECLARE_MTYPE(ISIS_ACL_NAME) -DECLARE_MTYPE(ISIS_PLIST_NAME) +DECLARE_MGROUP(ISISD); +DECLARE_MTYPE(ISIS); +DECLARE_MTYPE(ISIS_TMP); +DECLARE_MTYPE(ISIS_CIRCUIT); +DECLARE_MTYPE(ISIS_LSP); +DECLARE_MTYPE(ISIS_ADJACENCY); +DECLARE_MTYPE(ISIS_ADJACENCY_INFO); +DECLARE_MTYPE(ISIS_AREA); +DECLARE_MTYPE(ISIS_AREA_ADDR); +DECLARE_MTYPE(ISIS_DYNHN); +DECLARE_MTYPE(ISIS_SPFTREE); +DECLARE_MTYPE(ISIS_VERTEX); +DECLARE_MTYPE(ISIS_ROUTE_INFO); +DECLARE_MTYPE(ISIS_NEXTHOP); +DECLARE_MTYPE(ISIS_NEXTHOP_LABELS); +DECLARE_MTYPE(ISIS_DICT); +DECLARE_MTYPE(ISIS_DICT_NODE); +DECLARE_MTYPE(ISIS_EXT_ROUTE); +DECLARE_MTYPE(ISIS_EXT_INFO); +DECLARE_MTYPE(ISIS_MPLS_TE); +DECLARE_MTYPE(ISIS_ACL_NAME); +DECLARE_MTYPE(ISIS_PLIST_NAME); #endif /* _QUAGGA_ISIS_MEMORY_H */ diff --git a/isisd/isis_mt.c b/isisd/isis_mt.c index 9465c5e75..a6e236c79 100644 --- a/isisd/isis_mt.c +++ b/isisd/isis_mt.c @@ -29,9 +29,9 @@ #include "isisd/isis_mt.h" #include "isisd/isis_tlvs.h" -DEFINE_MTYPE_STATIC(ISISD, MT_AREA_SETTING, "ISIS MT Area Setting") -DEFINE_MTYPE_STATIC(ISISD, MT_CIRCUIT_SETTING, "ISIS MT Circuit Setting") -DEFINE_MTYPE_STATIC(ISISD, MT_ADJ_INFO, "ISIS MT Adjacency Info") +DEFINE_MTYPE_STATIC(ISISD, MT_AREA_SETTING, "ISIS MT Area Setting"); +DEFINE_MTYPE_STATIC(ISISD, MT_CIRCUIT_SETTING, "ISIS MT Circuit Setting"); +DEFINE_MTYPE_STATIC(ISISD, MT_ADJ_INFO, "ISIS MT Adjacency Info"); bool isis_area_ipv6_dstsrc_enabled(struct isis_area *area) { diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 21f534641..60ddf8e7e 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -49,7 +49,7 @@ #include "isisd/isis_errors.h" /* Local variables and functions */ -DEFINE_MTYPE_STATIC(ISISD, ISIS_SR_INFO, "ISIS segment routing information") +DEFINE_MTYPE_STATIC(ISISD, ISIS_SR_INFO, "ISIS segment routing information"); static void sr_local_block_delete(struct isis_area *area); static int sr_local_block_init(struct isis_area *area); diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index a97c19a8b..fa47c2813 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -45,9 +45,9 @@ #include "isisd/isis_te.h" #include "isisd/isis_sr.h" -DEFINE_MTYPE_STATIC(ISISD, ISIS_TLV, "ISIS TLVs") -DEFINE_MTYPE(ISISD, ISIS_SUBTLV, "ISIS Sub-TLVs") -DEFINE_MTYPE_STATIC(ISISD, ISIS_MT_ITEM_LIST, "ISIS MT Item Lists") +DEFINE_MTYPE_STATIC(ISISD, ISIS_TLV, "ISIS TLVs"); +DEFINE_MTYPE(ISISD, ISIS_SUBTLV, "ISIS Sub-TLVs"); +DEFINE_MTYPE_STATIC(ISISD, ISIS_MT_ITEM_LIST, "ISIS MT Item Lists"); typedef int (*unpack_tlv_func)(enum isis_tlv_context context, uint8_t tlv_type, uint8_t tlv_len, struct stream *s, diff --git a/isisd/isis_tlvs.h b/isisd/isis_tlvs.h index 037f91f0b..0438d13ae 100644 --- a/isisd/isis_tlvs.h +++ b/isisd/isis_tlvs.h @@ -28,7 +28,7 @@ #include "openbsd-tree.h" #include "prefix.h" -DECLARE_MTYPE(ISIS_SUBTLV) +DECLARE_MTYPE(ISIS_SUBTLV); struct lspdb_head; struct isis_subtlvs; diff --git a/isisd/isis_tx_queue.c b/isisd/isis_tx_queue.c index 5c87e3915..7db76db0d 100644 --- a/isisd/isis_tx_queue.c +++ b/isisd/isis_tx_queue.c @@ -32,8 +32,8 @@ #include "isisd/isis_misc.h" #include "isisd/isis_tx_queue.h" -DEFINE_MTYPE_STATIC(ISISD, TX_QUEUE, "ISIS TX Queue") -DEFINE_MTYPE_STATIC(ISISD, TX_QUEUE_ENTRY, "ISIS TX Queue Entry") +DEFINE_MTYPE_STATIC(ISISD, TX_QUEUE, "ISIS TX Queue"); +DEFINE_MTYPE_STATIC(ISISD, TX_QUEUE_ENTRY, "ISIS TX Queue Entry"); struct isis_tx_queue { struct isis_circuit *circuit; |