]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd lib ospfd pbrd python: fix empty init 3368/head
authorF. Aragon <paco@voltanet.io>
Wed, 21 Nov 2018 11:58:48 +0000 (12:58 +0100)
committerF. Aragon <paco@voltanet.io>
Wed, 21 Nov 2018 13:45:42 +0000 (14:45 +0100)
ISO C forbids empty initializer braces. Empty initializers have been
replaced with {0}

Signed-off-by: F. Aragon <paco@voltanet.io>
isisd/isis_pdu.c
isisd/isis_tlvs.c
lib/command_py.c
ospfd/ospf_packet.c
pbrd/pbr_nht.c
python/clidef.py

index 99041b0e61c7e2289c5a5b190325b2dcaecdce48..f0aa52463d46370f14d267dd6e05d15a8595fcbe 100644 (file)
@@ -747,7 +747,7 @@ static int process_lsp(uint8_t pdu_type, struct isis_circuit *circuit,
                                       stream_get_endp(circuit->rcv_stream));
        }
 
-       struct isis_lsp_hdr hdr = {};
+       struct isis_lsp_hdr hdr = {0};
 
        hdr.pdu_len = stream_getw(circuit->rcv_stream);
        hdr.rem_lifetime = stream_getw(circuit->rcv_stream);
@@ -1119,8 +1119,8 @@ static int process_snp(uint8_t pdu_type, struct isis_circuit *circuit,
        stream_get(rem_sys_id, circuit->rcv_stream, ISIS_SYS_ID_LEN);
        stream_forward_getp(circuit->rcv_stream, 1); /* Circuit ID - unused */
 
-       uint8_t start_lsp_id[ISIS_SYS_ID_LEN + 2] = {};
-       uint8_t stop_lsp_id[ISIS_SYS_ID_LEN + 2] = {};
+       uint8_t start_lsp_id[ISIS_SYS_ID_LEN + 2] = {0};
+       uint8_t stop_lsp_id[ISIS_SYS_ID_LEN + 2] = {0};
 
        if (is_csnp) {
                stream_get(start_lsp_id, circuit->rcv_stream,
index fce3a0a113912802fc9b7172a75d26922a6d510c..ae97a413f3a68e5b2d689436c57499bf1d289a2e 100644 (file)
@@ -171,8 +171,7 @@ static int unpack_item_prefix_sid(uint16_t mtid, uint8_t len, struct stream *s,
                                  struct sbuf *log, void *dest, int indent)
 {
        struct isis_subtlvs *subtlvs = dest;
-       struct isis_prefix_sid sid = {
-       };
+       struct isis_prefix_sid sid = {0};
 
        sbuf_push(log, indent, "Unpacking SR Prefix-SID...\n");
 
@@ -2052,7 +2051,7 @@ static int unpack_tlv_purge_originator(enum isis_tlv_context context,
                                       void *dest, int indent)
 {
        struct isis_tlvs *tlvs = dest;
-       struct isis_purge_originator poi = {};
+       struct isis_purge_originator poi = {0};
 
        sbuf_push(log, indent, "Unpacking Purge Originator Identification TLV...\n");
        if (tlv_len < 7) {
@@ -3131,7 +3130,7 @@ static const struct tlv_ops *tlv_table[ISIS_CONTEXT_MAX][ISIS_TLV_MAX] = {
                [ISIS_TLV_IPV6_REACH] = &tlv_ipv6_reach_ops,
                [ISIS_TLV_MT_IPV6_REACH] = &tlv_ipv6_reach_ops,
        },
-       [ISIS_CONTEXT_SUBTLV_NE_REACH] = {},
+       [ISIS_CONTEXT_SUBTLV_NE_REACH] = {0},
        [ISIS_CONTEXT_SUBTLV_IP_REACH] = {
                [ISIS_SUBTLV_PREFIX_SID] = &tlv_prefix_sid_ops,
        },
@@ -3397,7 +3396,7 @@ static void tlvs_protocols_supported_to_adj(struct isis_tlvs *tlvs,
                        ipv6_supported = true;
        }
 
-       struct nlpids reduced = {};
+       struct nlpids reduced = {0};
 
        if (ipv4_supported && ipv6_supported) {
                reduced.count = 2;
index 58b7982665571a927b3cb0951ed622b2573f95a9..ca0c8be79da34b777c49e1f938271640743c8c4c 100644 (file)
@@ -92,7 +92,7 @@ static PyMemberDef members_graph_node[] = {
        member(deprecated, T_BOOL),  member(hidden, T_BOOL),
        member(text, T_STRING),      member(desc, T_STRING),
        member(min, T_LONGLONG),     member(max, T_LONGLONG),
-       member(varname, T_STRING),   {},
+       member(varname, T_STRING),   {0},
 };
 #undef member
 
@@ -137,7 +137,7 @@ static PyObject *graph_node_join(PyObject *self, PyObject *args)
 static PyMethodDef methods_graph_node[] = {
        {"next", graph_node_next, METH_NOARGS, "outbound graph edge list"},
        {"join", graph_node_join, METH_NOARGS, "outbound join node"},
-       {}};
+       {0}};
 
 static void graph_node_wrap_free(void *arg)
 {
@@ -228,7 +228,7 @@ static PyObject *graph_to_pyobj(struct wrap_graph *wgraph,
        }
 static PyMemberDef members_graph[] = {
        member(definition, T_STRING),
-       {},
+       {0},
 };
 #undef member
 
@@ -242,7 +242,7 @@ static PyObject *graph_first(PyObject *self, PyObject *args)
 
 static PyMethodDef methods_graph[] = {
        {"first", graph_first, METH_NOARGS, "first graph node"},
-       {}};
+       {0}};
 
 static PyObject *graph_parse(PyTypeObject *type, PyObject *args,
                             PyObject *kwds);
index 3bb3b79a6a728481e75f041f88c5ad58cb786a3c..27a94f2310e1ccf5b90430083e2a3297a6c673ae 100644 (file)
@@ -655,7 +655,7 @@ static int ospf_write(struct thread *thread)
        int pkt_count = 0;
 
 #ifdef GNU_LINUX
-       unsigned char cmsgbuf[64] = {};
+       unsigned char cmsgbuf[64] = {0};
        struct cmsghdr *cm = (struct cmsghdr *)cmsgbuf;
        struct in_pktinfo *pi;
 #endif
index 6103bd7db5e2cf71a6e85f90cc018c480b040aac..db958e833f68cf4bcd5c14ebbf73d9f5edfc6631 100644 (file)
@@ -232,9 +232,9 @@ void pbr_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc,
                                const struct nexthop *nhop)
 {
        char debugstr[256];
-       struct pbr_nexthop_group_cache pnhgc_find = {};
+       struct pbr_nexthop_group_cache pnhgc_find = {0};
        struct pbr_nexthop_group_cache *pnhgc;
-       struct pbr_nexthop_cache pnhc_find = {};
+       struct pbr_nexthop_cache pnhc_find = {0};
        struct pbr_nexthop_cache *pnhc;
 
        if (!pbr_nht_get_next_tableid(true)) {
@@ -270,9 +270,9 @@ void pbr_nhgroup_del_nexthop_cb(const struct nexthop_group_cmd *nhgc,
                                const struct nexthop *nhop)
 {
        char debugstr[256];
-       struct pbr_nexthop_group_cache pnhgc_find = {};
+       struct pbr_nexthop_group_cache pnhgc_find = {0};
        struct pbr_nexthop_group_cache *pnhgc;
-       struct pbr_nexthop_cache pnhc_find = {};
+       struct pbr_nexthop_cache pnhc_find = {0};
        struct pbr_nexthop_cache *pnhc;
        enum nexthop_types_t nh_afi = nhop->type;
 
index a140ce3d5454404312181bb02dee46f542b311b7..b6eb490b676994ca8397a7176ace89ebb1ec09e5 100644 (file)
@@ -67,19 +67,19 @@ class PrefixBase(RenderHandler):
     deref = '&'
 class Prefix4Handler(PrefixBase):
     argtype = 'const struct prefix_ipv4 *'
-    decl = Template('struct prefix_ipv4 $varname = { };')
+    decl = Template('struct prefix_ipv4 $varname = {0};')
     code = Template('_fail = !str2prefix_ipv4(argv[_i]->arg, &$varname);')
 class Prefix6Handler(PrefixBase):
     argtype = 'const struct prefix_ipv6 *'
-    decl = Template('struct prefix_ipv6 $varname = { };')
+    decl = Template('struct prefix_ipv6 $varname = {0};')
     code = Template('_fail = !str2prefix_ipv6(argv[_i]->arg, &$varname);')
 class PrefixEthHandler(PrefixBase):
     argtype = 'struct prefix_eth *'
-    decl = Template('struct prefix_eth $varname = { };')
+    decl = Template('struct prefix_eth $varname = {0};')
     code = Template('_fail = !str2prefix_eth(argv[_i]->arg, &$varname);')
 class PrefixGenHandler(PrefixBase):
     argtype = 'const struct prefix *'
-    decl = Template('struct prefix $varname = { };')
+    decl = Template('struct prefix $varname = {0};')
     code = Template('_fail = !str2prefix(argv[_i]->arg, &$varname);')
 
 # same for IP addresses.  result is union sockunion.
@@ -96,7 +96,7 @@ class IP4Handler(IPBase):
     code = Template('_fail = !inet_aton(argv[_i]->arg, &$varname);')
 class IP6Handler(IPBase):
     argtype = 'struct in6_addr'
-    decl = Template('struct in6_addr $varname = {};')
+    decl = Template('struct in6_addr $varname = {0};')
     code = Template('_fail = !inet_pton(AF_INET6, argv[_i]->arg, &$varname);')
 class IPGenHandler(IPBase):
     argtype = 'const union sockunion *'