From: Francois-Xavier Le Bail Date: Sun, 11 Sep 2016 19:45:26 +0000 (+0200) Subject: Declare some variables as static X-Git-Tag: tcpdump-4.9.0-bp~177 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/ca54d72376a35225cebfd3615acb707c072ae22a Declare some variables as static --- diff --git a/mib.h b/mib.h index 92c6c2c5..6c8e63c9 100644 --- a/mib.h +++ b/mib.h @@ -8,7 +8,7 @@ /* parse problem: new name "mib" for mgmt.mib(1) ignored */ /* parse problem: no parent for 0.nullSpecific(0) */ -struct obj +static struct obj _proteon_obj = { "proteon", 1, 0, NULL, NULL diff --git a/print-cfm.c b/print-cfm.c index 745492bd..7db878fe 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -75,7 +75,7 @@ struct cfm_ccm_t { * Timer Bases for the CCM Interval field. * Expressed in units of seconds. */ -const float ccm_interval_base[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600}; +static const float ccm_interval_base[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600}; #define CCM_INTERVAL_MIN_MULTIPLIER 3.25 #define CCM_INTERVAL_MAX_MULTIPLIER 3.5 diff --git a/print-fddi.c b/print-fddi.c index 300441f1..93f6ccd8 100644 --- a/print-fddi.c +++ b/print-fddi.c @@ -85,9 +85,9 @@ struct fddi_header { * Some FDDI interfaces use bit-swapped addresses. */ #if defined(ultrix) || defined(__alpha) || defined(__bsdi) || defined(__NetBSD__) || defined(__linux__) -int fddi_bitswap = 0; +static int fddi_bitswap = 0; #else -int fddi_bitswap = 1; +static int fddi_bitswap = 1; #endif /* diff --git a/print-forces.c b/print-forces.c index bc16dbb0..3cc5ca7c 100644 --- a/print-forces.c +++ b/print-forces.c @@ -288,7 +288,7 @@ static inline const struct optlv_h *get_forces_optlv_h(uint16_t opt) #define IND_CHR ' ' #define IND_PREF '\n' #define IND_SUF 0x0 -char ind_buf[IND_SIZE]; +static char ind_buf[IND_SIZE]; static inline char *indent_pr(int indent, int nlpref) { diff --git a/print-icmp6.c b/print-icmp6.c index 5b53bbca..63f336b9 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -629,7 +629,7 @@ static int icmp6_cksum(netdissect_options *ndo, const struct ip6_hdr *ip6, IPPROTO_ICMPV6); } -const struct tok rpl_mop_values[] = { +static const struct tok rpl_mop_values[] = { { RPL_DIO_NONSTORING, "nonstoring"}, { RPL_DIO_STORING, "storing"}, { RPL_DIO_NONSTORING_MULTICAST, "nonstoring-multicast"}, @@ -637,7 +637,7 @@ const struct tok rpl_mop_values[] = { { 0, NULL}, }; -const struct tok rpl_subopt_values[] = { +static const struct tok rpl_subopt_values[] = { { RPL_OPT_PAD0, "pad0"}, { RPL_OPT_PADN, "padN"}, { RPL_DIO_METRICS, "metrics"}, diff --git a/print-isakmp.c b/print-isakmp.c index 8f067035..b11e22d4 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -644,12 +644,12 @@ ikev1_print(netdissect_options *ndo, const u_char *bp2, struct isakmp *base); #define MAXINITIATORS 20 -int ninitiator = 0; +static int ninitiator = 0; union inaddr_u { struct in_addr in4; struct in6_addr in6; }; -struct { +static struct { cookie_t initiator; u_int version; union inaddr_u iaddr; diff --git a/print-nfs.c b/print-nfs.c index 77e1a1e3..a71e068d 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -54,7 +54,7 @@ static const uint32_t *parse_post_op_attr(netdissect_options *, const uint32_t * /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. */ -uint32_t nfsv3_procid[NFS_NPROCS] = { +static uint32_t nfsv3_procid[NFS_NPROCS] = { NFSPROC_NULL, NFSPROC_GETATTR, NFSPROC_SETATTR, @@ -855,10 +855,10 @@ struct xid_map_entry { #define XIDMAPSIZE 64 -struct xid_map_entry xid_map[XIDMAPSIZE]; +static struct xid_map_entry xid_map[XIDMAPSIZE]; -int xid_map_next = 0; -int xid_map_hint = 0; +static int xid_map_next = 0; +static int xid_map_hint = 0; static int xid_map_enter(netdissect_options *ndo, diff --git a/print-radius.c b/print-radius.c index ae50efd8..eb48de50 100644 --- a/print-radius.c +++ b/print-radius.c @@ -372,7 +372,8 @@ static const char *prompt[]={ "No Echo", }; -struct attrtype { const char *name; /* Attribute name */ +static struct attrtype { + const char *name; /* Attribute name */ const char **subtypes; /* Standard Values (if any) */ u_char siz_subtypes; /* Size of total standard values */ u_char first_subtype; /* First standard value is 0 or 1 */ diff --git a/print-slow.c b/print-slow.c index 1f8527e3..42154140 100644 --- a/print-slow.c +++ b/print-slow.c @@ -246,7 +246,7 @@ struct lacp_marker_tlv_terminator_t { static void slow_marker_lacp_print(netdissect_options *, register const u_char *, register u_int); static void slow_oam_print(netdissect_options *, register const u_char *, register u_int); -const struct slow_common_header_t *slow_com_header; +static const struct slow_common_header_t *slow_com_header; void slow_print(netdissect_options *ndo, diff --git a/print-smb.c b/print-smb.c index 174fd9af..dd0f1045 100644 --- a/print-smb.c +++ b/print-smb.c @@ -1310,7 +1310,7 @@ out: /* print netbeui frames */ -struct nbf_strings { +static struct nbf_strings { const char *name; const char *nonverbose; const char *verbose; diff --git a/print-snmp.c b/print-snmp.c index 83d4090e..c89d934e 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -254,7 +254,7 @@ static const char *Form[] = { * A structure for the OID tree for the compiled-in MIB. * This is stored as a general-order tree. */ -struct obj { +static struct obj { const char *desc; /* name of object */ u_char oid; /* sub-id following parent */ u_char type; /* object type (unused) */ diff --git a/print-telnet.c b/print-telnet.c index ab85e10f..2e32fce8 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -89,7 +89,7 @@ #define SYNCH 242 /* for telfunc calls */ #ifdef TELCMDS -const char *telcmds[] = { +static const char *telcmds[] = { "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0, @@ -150,7 +150,7 @@ extern char *telcmds[]; #define NTELOPTS (1+TELOPT_NEW_ENVIRON) #ifdef TELOPTS -const char *telopts[NTELOPTS+1] = { +static const char *telopts[NTELOPTS+1] = { "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP", "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",