From a50b7cebd58520d7f7ddbb82214788bc794791ac Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 7 Dec 2016 17:30:16 +0100 Subject: [PATCH] lib: remove vty->index Signed-off-by: David Lamparter --- isisd/Makefile.am | 3 +-- ldpd/Makefile.am | 3 +-- lib/Makefile.am | 3 +-- lib/if.c | 2 +- lib/keychain.c | 2 +- lib/routemap.c | 2 +- lib/vrf.c | 2 +- lib/vty.h | 31 +++---------------------------- zebra/Makefile.am | 3 +-- 9 files changed, 11 insertions(+), 40 deletions(-) diff --git a/isisd/Makefile.am b/isisd/Makefile.am index 05f96c3807..89a39ef065 100644 --- a/isisd/Makefile.am +++ b/isisd/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 DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 LIBS = @LIBS@ diff --git a/ldpd/Makefile.am b/ldpd/Makefile.am index 1f4d910192..c292adf6fc 100644 --- a/ldpd/Makefile.am +++ b/ldpd/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 DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 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 diff --git a/lib/if.c b/lib/if.c index a1bac2ce81..fb12f201b2 100644 --- a/lib/if.c +++ b/lib/if.c @@ -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; } diff --git a/lib/vrf.c b/lib/vrf.c index 0d0b1cc27d..14501c5265 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -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; } diff --git a/lib/vty.h b/lib/vty.h index 3ca9159211..24bdcd1817 100644 --- a/lib/vty.h +++ b/lib/vty.h @@ -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 */ \ diff --git a/zebra/Makefile.am b/zebra/Makefile.am index d1c160ade6..65927262f2 100644 --- a/zebra/Makefile.am +++ b/zebra/Makefile.am @@ -2,8 +2,7 @@ include ../common.am ## 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 DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 -- 2.39.5