diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2016-12-07 17:30:16 +0100 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2016-12-09 17:36:25 +0100 | 
| commit | a50b7cebd58520d7f7ddbb82214788bc794791ac (patch) | |
| tree | dcf212f69beda2084d6c5c68a314eccb0e693546 /lib | |
| parent | 52c6b0e20a94e29126e3ddb180704d9d4c87e14f (diff) | |
lib: remove vty->index
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Makefile.am | 3 | ||||
| -rw-r--r-- | lib/if.c | 2 | ||||
| -rw-r--r-- | lib/keychain.c | 2 | ||||
| -rw-r--r-- | lib/routemap.c | 2 | ||||
| -rw-r--r-- | lib/vrf.c | 2 | ||||
| -rw-r--r-- | lib/vty.h | 31 | 
6 files changed, 8 insertions, 34 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index ffbbacc872..29584f82b5 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,6 @@  ## Process this file with automake to produce Makefile.in. -AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \ -	      -DVTY_DEPRECATE_INDEX +AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib  AM_CFLAGS = $(WERROR)  DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"  AM_YFLAGS = -d @@ -784,7 +784,7 @@ DEFUN (interface,        vty_out (vty, "%% interface %s not in %s%s", ifname, vrfname, VTY_NEWLINE);        return CMD_WARNING;      } -  VTY_PUSH_CONTEXT_COMPAT (INTERFACE_NODE, ifp); +  VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp);    return CMD_SUCCESS;  } diff --git a/lib/keychain.c b/lib/keychain.c index f8a3ffc012..cd8039b95b 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -251,7 +251,7 @@ DEFUN (key_chain,    struct keychain *keychain;    keychain = keychain_get (argv[idx_word]->arg); -  VTY_PUSH_CONTEXT_COMPAT (KEYCHAIN_NODE, keychain); +  VTY_PUSH_CONTEXT (KEYCHAIN_NODE, keychain);    return CMD_SUCCESS;  } diff --git a/lib/routemap.c b/lib/routemap.c index d6a5b713c5..5f2b2c0dfb 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2549,7 +2549,7 @@ DEFUN (route_map,    map = route_map_get (mapname);    index = route_map_index_get (map, permit, pref); -  VTY_PUSH_CONTEXT_COMPAT (RMAP_NODE, index); +  VTY_PUSH_CONTEXT (RMAP_NODE, index);    return CMD_SUCCESS;  } @@ -494,7 +494,7 @@ DEFUN (vrf,    vrfp = vrf_get (VRF_UNKNOWN, vrfname); -  VTY_PUSH_CONTEXT_COMPAT (VRF_NODE, vrfp); +  VTY_PUSH_CONTEXT (VRF_NODE, vrfp);    return CMD_SUCCESS;  } @@ -29,14 +29,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  #define VTY_BUFSIZ 512  #define VTY_MAXHIST 20 -#if defined(VTY_DEPRECATE_INDEX) && defined(__GNUC__) && \ -    (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && \ -    !defined(__ICC) -#define INDEX_WARNING __attribute__((deprecated)) -#else -#define INDEX_WARNING -#endif -  /* VTY struct. */  struct vty   { @@ -82,10 +74,6 @@ struct vty    /* History insert end point */    int hindex; -  /* For current referencing point of interface, route-map, -     access-list etc... */ -  void *index INDEX_WARNING; -    /* qobj object ID (replacement for "index") */    uint64_t qobj_index; @@ -139,32 +127,19 @@ struct vty    char address[SU_ADDRSTRLEN];  }; -#undef INDEX_WARNING -  static inline void vty_push_context(struct vty *vty, -                                    int node, uint64_t id, void *idx) +                                    int node, uint64_t id)  {    vty->node = node;    vty->qobj_index = id; -#if defined(VTY_DEPRECATE_INDEX) && defined(__GNUC__) && \ -    (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -  vty->index = idx; -#pragma GCC diagnostic pop -#else -  vty->index = idx; -#endif  }  /* note: VTY_PUSH_CONTEXT(..., NULL) doesn't work, since it will try to   * dereference "NULL->qobj_node.nid" */  #define VTY_PUSH_CONTEXT(nodeval, ptr) \ -	vty_push_context(vty, nodeval, QOBJ_ID_0SAFE(ptr), NULL) +	vty_push_context(vty, nodeval, QOBJ_ID_0SAFE(ptr))  #define VTY_PUSH_CONTEXT_NULL(nodeval) \ -	vty_push_context(vty, nodeval, 0ULL, NULL) -#define VTY_PUSH_CONTEXT_COMPAT(nodeval, ptr) \ -	vty_push_context(vty, nodeval, QOBJ_ID_0SAFE(ptr), ptr) +	vty_push_context(vty, nodeval, 0ULL)  #define VTY_PUSH_CONTEXT_SUB(nodeval, ptr) do { \  		vty->node = nodeval; \  		/* qobj_index stays untouched */ \  | 
