[PATCH 07/15] include/net-snmp/system/*: Remove unused preprocessor symbols

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
Several preprocessor symbols are defined or undefined in system header
files but are not used anywhere in the Net-SNMP code base. Hence remove
the #define and #undef directives for these symbols from the system
header files.
---
 include/net-snmp/system/aix.h       |  2 +-
 include/net-snmp/system/cygwin.h    |  4 ----
 include/net-snmp/system/darwin10.h  |  2 --
 include/net-snmp/system/darwin11.h  |  2 --
 include/net-snmp/system/darwin12.h  |  2 --
 include/net-snmp/system/darwin13.h  |  2 --
 include/net-snmp/system/darwin14.h  |  2 --
 include/net-snmp/system/darwin7.h   |  3 ---
 include/net-snmp/system/darwin9.h   |  2 --
 include/net-snmp/system/dragonfly.h |  4 ----
 include/net-snmp/system/dynix.h     |  3 ---
 include/net-snmp/system/freebsd.h   |  3 ---
 include/net-snmp/system/freebsd2.h  |  1 -
 include/net-snmp/system/freebsd3.h  |  2 --
 include/net-snmp/system/freebsd4.h  |  4 ----
 include/net-snmp/system/generic.h   | 14 --------------
 include/net-snmp/system/hpux.h      | 10 ----------
 include/net-snmp/system/linux.h     |  2 --
 include/net-snmp/system/mingw32.h   |  3 ---
 include/net-snmp/system/mips.h      |  2 --
 include/net-snmp/system/netbsd.h    |  5 -----
 include/net-snmp/system/nto-qnx6.h  |  3 ---
 include/net-snmp/system/openbsd.h   |  1 -
 include/net-snmp/system/openbsd5.h  |  2 --
 include/net-snmp/system/solaris.h   |  3 ---
 25 files changed, 1 insertion(+), 82 deletions(-)

diff --git a/include/net-snmp/system/aix.h b/include/net-snmp/system/aix.h
index 46beb317fd06..5d6c34b6a0b1 100644
--- a/include/net-snmp/system/aix.h
+++ b/include/net-snmp/system/aix.h
@@ -1,6 +1,6 @@
 #include <net-snmp/system/generic.h>
 #include <sys/select.h>
-#undef TOTAL_MEMORY_SYMBOL
+
 #undef NPROC_SYMBOL
 #undef RTHASHSIZE_SYMBOL
 #undef RTHOST_SYMBOL
diff --git a/include/net-snmp/system/cygwin.h b/include/net-snmp/system/cygwin.h
index a9b76fb5d7de..5704f757da35 100644
--- a/include/net-snmp/system/cygwin.h
+++ b/include/net-snmp/system/cygwin.h
@@ -6,7 +6,3 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>	/* uint32_t */
 #endif
-
-#undef bsdlike
-#undef MBSTAT_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/darwin10.h b/include/net-snmp/system/darwin10.h
index b9e2a5dd3bd5..2afd8bd1cbcd 100644
--- a/include/net-snmp/system/darwin10.h
+++ b/include/net-snmp/system/darwin10.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin11.h b/include/net-snmp/system/darwin11.h
index 93e76e2fdeaa..f600aadebe3a 100644
--- a/include/net-snmp/system/darwin11.h
+++ b/include/net-snmp/system/darwin11.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin12.h b/include/net-snmp/system/darwin12.h
index 22bcc57bd135..9cd8f1dd6a77 100644
--- a/include/net-snmp/system/darwin12.h
+++ b/include/net-snmp/system/darwin12.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin13.h b/include/net-snmp/system/darwin13.h
index db46762df1d3..e185fe2ea895 100644
--- a/include/net-snmp/system/darwin13.h
+++ b/include/net-snmp/system/darwin13.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin14.h b/include/net-snmp/system/darwin14.h
index 53f5101b0866..b54e3ae13fc7 100644
--- a/include/net-snmp/system/darwin14.h
+++ b/include/net-snmp/system/darwin14.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin7.h b/include/net-snmp/system/darwin7.h
index 8d4554d45ee9..db034cace5eb 100644
--- a/include/net-snmp/system/darwin7.h
+++ b/include/net-snmp/system/darwin7.h
@@ -7,9 +7,6 @@
  */
 #undef HAVE_FSTAB_H
 
-#define MBSTAT_SYMBOL "mbstat"
-#undef TOTAL_MEMORY_SYMBOL
-
 #define SWAPFILE_DIR "/private/var/vm"
 #define SWAPFILE_PREFIX "swapfile"
 
diff --git a/include/net-snmp/system/darwin9.h b/include/net-snmp/system/darwin9.h
index 48979d5bd788..e1f64a8cac38 100644
--- a/include/net-snmp/system/darwin9.h
+++ b/include/net-snmp/system/darwin9.h
@@ -60,8 +60,6 @@
 /*
  * use new host resources files as well
  */
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/dragonfly.h b/include/net-snmp/system/dragonfly.h
index 35d016b3d142..eba7792bd458 100644
--- a/include/net-snmp/system/dragonfly.h
+++ b/include/net-snmp/system/dragonfly.h
@@ -17,9 +17,5 @@
 #undef NPROC_SYMBOL
 #define NPROC_SYMBOL "nprocs"
 
-#undef TOTAL_MEMORY_SYMBOL
-
-#undef MBSTAT_SYMBOL
-
 #undef INP_NEXT_SYMBOL
 #define INP_NEXT_SYMBOL inp_next
diff --git a/include/net-snmp/system/dynix.h b/include/net-snmp/system/dynix.h
index 63e979b1ab91..c7930cfee1ed 100644
--- a/include/net-snmp/system/dynix.h
+++ b/include/net-snmp/system/dynix.h
@@ -20,9 +20,6 @@
  */
 #define dynix dynix
 
-#undef TOTAL_MEMORY_SYMBOL
-#undef MBSTAT_SYMBOL
-
 /*
  * Not enough alcohool in bloodstream [fmc] 
  */
diff --git a/include/net-snmp/system/freebsd.h b/include/net-snmp/system/freebsd.h
index a30683f9efd0..6b897636d911 100644
--- a/include/net-snmp/system/freebsd.h
+++ b/include/net-snmp/system/freebsd.h
@@ -8,9 +8,6 @@
 #undef INP_NEXT_SYMBOL
 #define INP_NEXT_SYMBOL inp_list.le_next
 
-#undef INP_PREV_SYMBOL
-#define INP_PREV_SYMBOL inp_list.le_prev
-
 #undef TCP_TTL_SYMBOL
 #define TCP_TTL_SYMBOL "ip_defttl"
 
diff --git a/include/net-snmp/system/freebsd2.h b/include/net-snmp/system/freebsd2.h
index a2673ac6acce..845e30c47545 100644
--- a/include/net-snmp/system/freebsd2.h
+++ b/include/net-snmp/system/freebsd2.h
@@ -7,4 +7,3 @@
 #undef PROC_SYMBOL
 #undef NPROC_SYMBOL
 #undef LOADAVE_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/freebsd3.h b/include/net-snmp/system/freebsd3.h
index 4d87b5caaaff..7cd7f3cf290c 100644
--- a/include/net-snmp/system/freebsd3.h
+++ b/include/net-snmp/system/freebsd3.h
@@ -7,5 +7,3 @@
 
 #undef PROC_SYMBOL
 #undef NPROC_SYMBOL
-
-#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/freebsd4.h b/include/net-snmp/system/freebsd4.h
index 2c41e82f8619..9f447236e819 100644
--- a/include/net-snmp/system/freebsd4.h
+++ b/include/net-snmp/system/freebsd4.h
@@ -15,9 +15,5 @@
 #undef NPROC_SYMBOL
 #define NPROC_SYMBOL "nprocs"
 
-#undef TOTAL_MEMORY_SYMBOL
-
-#undef MBSTAT_SYMBOL
-
 #undef INP_NEXT_SYMBOL
 #define INP_NEXT_SYMBOL inp_next
diff --git a/include/net-snmp/system/generic.h b/include/net-snmp/system/generic.h
index 545604ff137a..f32021b56f5d 100644
--- a/include/net-snmp/system/generic.h
+++ b/include/net-snmp/system/generic.h
@@ -1,8 +1,6 @@
 #ifndef __NET_SNMP_SYSTEM_GENERIC_H__
 #define __NET_SNMP_SYSTEM_GENERIC_H__
 
-#define bsdlike bsdlike
-
 /*
  * nlist symbols in ip.c 
  */
@@ -21,17 +19,6 @@
  */
 #define LOADAVE_SYMBOL "avenrun"
 
-/*
- * nlist symbols in hr_proc.c and memory.c 
- */
-#define PHYSMEM_SYMBOL "physmem"
-#define TOTAL_MEMORY_SYMBOL "total"
-#define MBSTAT_SYMBOL "mbstat"
-#define SWDEVT_SYMBOL "swdevt"
-#define FSWDEVT_SYMBOL "fswdevt"
-#define NSWAPFS_SYMBOL "nswapfs"
-#define NSWAPDEV_SYMBOL "nswapdev"
-
 /*
  * process nlist symbols. 
  */
@@ -67,6 +54,5 @@
  * udp_inpcb list symbol 
  */
 #define INP_NEXT_SYMBOL inp_next
-#define INP_PREV_SYMBOL inp_prev
 
 #endif /* !__NET_SNMP_SYSTEM_GENERIC_H__ */
diff --git a/include/net-snmp/system/hpux.h b/include/net-snmp/system/hpux.h
index 1abf8f86d463..532ecc36b8e7 100644
--- a/include/net-snmp/system/hpux.h
+++ b/include/net-snmp/system/hpux.h
@@ -24,20 +24,12 @@
  * hpux specific 
  */
 #define MIB_IPCOUNTER_SYMBOL "MIB_ipcounter"
-#define MIB_TCPCOUNTER_SYMBOL "MIB_tcpcounter"
-#define MIB_UDPCOUNTER_SYMBOL "MIB_udpcounter"
 #endif
 
 #if defined(hpux10) || defined(hpux11)
-#undef SWDEVT_SYMBOL
-#undef FSWDEVT_SYMBOL
-#undef NSWAPFS_SYMBOL
-#undef NSWAPDEV_SYMBOL
 #undef LOADAVE_SYMBOL
 #undef PROC_SYMBOL
 #undef NPROC_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
-#undef MBSTAT_SYMBOL
 #endif
 
 #ifdef hpux11
@@ -52,8 +44,6 @@
 #undef RTHASHSIZE_SYMBOL
 #undef RTHOST_SYMBOL
 #undef RTNET_SYMBOL
-
-#undef PHYSMEM_SYMBOL
 #endif
 
 #define rt_pad1 rt_refcnt
diff --git a/include/net-snmp/system/linux.h b/include/net-snmp/system/linux.h
index a67fa8a6a100..30922c172667 100644
--- a/include/net-snmp/system/linux.h
+++ b/include/net-snmp/system/linux.h
@@ -4,8 +4,6 @@
 
 #undef NPROC_SYMBOL
 
-#undef bsdlike
-
 /* uncomment this to read process names from /proc/X/cmdline (like <= 5.0) */
 /* #define USE_PROC_CMDLINE */
 
diff --git a/include/net-snmp/system/mingw32.h b/include/net-snmp/system/mingw32.h
index 68a3a768aa67..7469523c8c55 100644
--- a/include/net-snmp/system/mingw32.h
+++ b/include/net-snmp/system/mingw32.h
@@ -31,9 +31,6 @@
 #include <stdint.h>	/* uint32_t */
 #endif
 
-#undef bsdlike
-#undef MBSTAT_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
 #undef HAVE_GETOPT_H
 #undef HAVE_SOCKET
 #undef HAVE_SIGNAL
diff --git a/include/net-snmp/system/mips.h b/include/net-snmp/system/mips.h
index e73d8ab94526..5083d277b78f 100644
--- a/include/net-snmp/system/mips.h
+++ b/include/net-snmp/system/mips.h
@@ -1,4 +1,2 @@
 
 #define NETSNMP_DONT_USE_NLIST 1
-
-#undef bsdlike
diff --git a/include/net-snmp/system/netbsd.h b/include/net-snmp/system/netbsd.h
index f396fbf3cfc6..31f961532cd9 100644
--- a/include/net-snmp/system/netbsd.h
+++ b/include/net-snmp/system/netbsd.h
@@ -18,24 +18,19 @@
 /*
  * inp_next symbol 
  */
-#define HAVE_INPCBTABLE 1
 #undef INP_NEXT_SYMBOL
-#undef INP_PREV_SYMBOL
 
 #if __NetBSD_Version__ >= 700000001
 #define INP_FIRST_SYMBOL inpt_queue.tqh_first
 #define INP_NEXT_SYMBOL inp_queue.tqe_next
-#define INP_PREV_SYMBOL inp_queue.tqe_prev
 #else
 #define INP_FIRST_SYMBOL inpt_queue.cqh_first
 #define INP_NEXT_SYMBOL inp_queue.cqe_next
-#define INP_PREV_SYMBOL inp_queue.cqe_prev
 #endif
 
 #if __NetBSD_Version__ >= 106300000       /* NetBSD 1.6ZD */            
 #undef IFADDR_SYMBOL
 #define IFADDR_SYMBOL "in_ifaddrhead"
-#undef TOTAL_MEMORY_SYMBOL
 #endif
 
 #define UTMP_FILE _PATH_UTMP
diff --git a/include/net-snmp/system/nto-qnx6.h b/include/net-snmp/system/nto-qnx6.h
index 1965111c6248..b1c6336058b2 100644
--- a/include/net-snmp/system/nto-qnx6.h
+++ b/include/net-snmp/system/nto-qnx6.h
@@ -20,9 +20,6 @@
  */
 #undef INP_NEXT_SYMBOL
 #define INP_NEXT_SYMBOL inp_queue.cqe_next
-#undef INP_PREV_SYMBOL
-#define INP_PREV_SYMBOL inp_queue.cqe_prev
-#define HAVE_INPCBTABLE 1
 
 #undef IFADDR_SYMBOL
 #define IFADDR_SYMBOL "in_ifaddrhead"
diff --git a/include/net-snmp/system/openbsd.h b/include/net-snmp/system/openbsd.h
index 8db0eacfeb4a..cea7fbf9d1f7 100644
--- a/include/net-snmp/system/openbsd.h
+++ b/include/net-snmp/system/openbsd.h
@@ -6,7 +6,6 @@
 
 #undef MBPOOL_SYMBOL
 #undef MCLPOOL_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
 
 /* at least OpenBSD/SPARC 3.7 doesn't define this */
 #ifndef UINT32_MAX
diff --git a/include/net-snmp/system/openbsd5.h b/include/net-snmp/system/openbsd5.h
index a3bedb0cfce1..5f9f10943c0e 100644
--- a/include/net-snmp/system/openbsd5.h
+++ b/include/net-snmp/system/openbsd5.h
@@ -9,7 +9,5 @@
 #define INP_FIRST_SYMBOL inpt_queue.tqh_first
 #undef INP_NEXT_SYMBOL
 #define INP_NEXT_SYMBOL inp_queue.tqe_next
-#undef INP_PREV_SYMBOL
-#define INP_PREV_SYMBOL inp_queue.tqe_prev
 #endif
 
diff --git a/include/net-snmp/system/solaris.h b/include/net-snmp/system/solaris.h
index f02bb900ccf8..7df0057e276c 100644
--- a/include/net-snmp/system/solaris.h
+++ b/include/net-snmp/system/solaris.h
@@ -1,6 +1,5 @@
 #include "sysv.h"
 
-#undef bsdlike
 #undef IP_FORWARDING_SYMBOL
 #undef ICMPSTAT_SYMBOL
 #undef TCPSTAT_SYMBOL
@@ -14,8 +13,6 @@
 #undef IPSTAT_SYMBOL
 #undef TCP_TTL_SYMBOL
 #undef PROC_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
-#undef MBSTAT_SYMBOL
 
 #define UDP_ADDRESSES_IN_HOST_ORDER 1
 #define UDP_PORTS_IN_HOST_ORDER 1
-- 
2.16.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.