]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: remove extra struct in ospf6_lsa_handler
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 4 Sep 2018 10:55:19 +0000 (12:55 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 8 Sep 2018 23:16:25 +0000 (01:16 +0200)
This serves no other purpose than to generate stupid warnings for
overwritten initializers on old gcc versions.

Signed-off-by: David Lamparter <equinox@diac24.net>
ospf6d/ospf6_lsa.c
ospf6d/ospf6_lsa.h
ospf6d/ospf6_neighbor.c

index 8b720b6d844ae0e98cea494cd3a89b0736d70fbf..40b3522c3d7c94f033cdda8495544912623e79b1 100644 (file)
@@ -130,7 +130,7 @@ uint8_t ospf6_lstype_debug(uint16_t type)
 {
        const struct ospf6_lsa_handler *handler;
        handler = ospf6_get_lsa_handler(type);
-       return handler->debug;
+       return handler->lh_debug;
 }
 
 /* RFC2328: Section 13.2 */
@@ -844,13 +844,13 @@ DEFUN (debug_ospf6_lsa_type,
 
        if (argc == 5) {
                if (strmatch(argv[idx_type]->text, "originate"))
-                       SET_FLAG(handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
+                       SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_ORIGINATE);
                else if (strmatch(argv[idx_type]->text, "examine"))
-                       SET_FLAG(handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
+                       SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_EXAMIN);
                else if (strmatch(argv[idx_type]->text, "flooding"))
-                       SET_FLAG(handler->debug, OSPF6_LSA_DEBUG_FLOOD);
+                       SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_FLOOD);
        } else
-               SET_FLAG(handler->debug, OSPF6_LSA_DEBUG);
+               SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG);
 
        return CMD_SUCCESS;
 }
@@ -896,13 +896,14 @@ DEFUN (no_debug_ospf6_lsa_type,
 
        if (argc == 6) {
                if (strmatch(argv[idx_type]->text, "originate"))
-                       UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
+                       UNSET_FLAG(handler->lh_debug,
+                                  OSPF6_LSA_DEBUG_ORIGINATE);
                if (strmatch(argv[idx_type]->text, "examine"))
-                       UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
+                       UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_EXAMIN);
                if (strmatch(argv[idx_type]->text, "flooding"))
-                       UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG_FLOOD);
+                       UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_FLOOD);
        } else
-               UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG);
+               UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG);
 
        return CMD_SUCCESS;
 }
@@ -924,16 +925,16 @@ int config_write_ospf6_debug_lsa(struct vty *vty)
                handler = vector_slot(ospf6_lsa_handler_vector, i);
                if (handler == NULL)
                        continue;
-               if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG))
+               if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG))
                        vty_out(vty, "debug ospf6 lsa %s\n",
                                ospf6_lsa_handler_name(handler));
-               if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG_ORIGINATE))
+               if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_ORIGINATE))
                        vty_out(vty, "debug ospf6 lsa %s originate\n",
                                ospf6_lsa_handler_name(handler));
-               if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG_EXAMIN))
+               if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_EXAMIN))
                        vty_out(vty, "debug ospf6 lsa %s examine\n",
                                ospf6_lsa_handler_name(handler));
-               if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG_FLOOD))
+               if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_FLOOD))
                        vty_out(vty, "debug ospf6 lsa %s flooding\n",
                                ospf6_lsa_handler_name(handler));
        }
index e88d10ad7e594b129821334929b94b5ea4f72981..d871a8842ecb3969fe8b0eea28433db9e6fdebdb 100644 (file)
@@ -137,21 +137,14 @@ struct ospf6_lsa {
 #define OSPF6_LSA_SEQWRAPPED 0x20
 
 struct ospf6_lsa_handler {
-       const struct {
-               uint16_t type; /* host byte order */
-               const char *name;
-               const char *short_name;
-               int (*show)(struct vty *, struct ospf6_lsa *);
-               char *(*get_prefix_str)(struct ospf6_lsa *, char *buf,
-                                       int buflen, int pos);
-       } s;
-#define lh_type       s.type
-#define lh_name       s.name
-#define lh_short_name s.short_name
-#define lh_show       s.show
-#define lh_get_prefix_str s.get_prefix_str
-       uint8_t debug;
-#define lh_debug debug
+       uint16_t lh_type; /* host byte order */
+       const char *lh_name;
+       const char *lh_short_name;
+       int (*lh_show)(struct vty *, struct ospf6_lsa *);
+       char *(*lh_get_prefix_str)(struct ospf6_lsa *, char *buf,
+                                  int buflen, int pos);
+
+       uint8_t lh_debug;
 };
 
 #define OSPF6_LSA_IS_KNOWN(t)                                                  \
index 0cc7294d67995cae0bb0037da7edda552c15fbf0..4c24f47131893ff1ea8b463088900a7ccb08fa58 100644 (file)
@@ -921,7 +921,7 @@ DEFUN (no_debug_ospf6,
                handler = vector_slot(ospf6_lsa_handler_vector, i);
 
                if (handler != NULL) {
-                       UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG);
+                       UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG);
                }
        }