From: Francois-Xavier Le Bail Date: Fri, 26 Jan 2018 14:15:58 +0000 (+0100) Subject: Remove function specifier 'inline' in printers X-Git-Tag: tcpdump-4.99-bp~1348 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/944e93fa4c29c4e5cdecd858ead5a37430a418af Remove function specifier 'inline' in printers It was mostly used with large functions. Moreover: Put some function definition names at the beginning of line. Fix a space. --- diff --git a/addrtoname.c b/addrtoname.c index 499a6648..ac79c0f2 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -406,7 +406,7 @@ static const char hex[16] = { /* Find the hash node that corresponds the ether address 'ep' */ -static inline struct enamemem * +static struct enamemem * lookup_emem(netdissect_options *ndo, const u_char *ep) { u_int i, j, k; @@ -439,7 +439,7 @@ lookup_emem(netdissect_options *ndo, const u_char *ep) * with length 'nlen' */ -static inline struct bsnamemem * +static struct bsnamemem * lookup_bytestring(netdissect_options *ndo, const u_char *bs, const unsigned int nlen) { @@ -487,7 +487,7 @@ lookup_bytestring(netdissect_options *ndo, const u_char *bs, /* Find the hash node that corresponds the NSAP 'nsap' */ -static inline struct enamemem * +static struct enamemem * lookup_nsap(netdissect_options *ndo, const u_char *nsap, u_int nsap_length) { @@ -532,7 +532,7 @@ lookup_nsap(netdissect_options *ndo, const u_char *nsap, /* Find the hash node that corresponds the protoid 'pi'. */ -static inline struct protoidmem * +static struct protoidmem * lookup_protoid(netdissect_options *ndo, const u_char *pi) { u_int i, j; diff --git a/print-ap1394.c b/print-ap1394.c index 6ad592e5..d39f27f7 100644 --- a/print-ap1394.c +++ b/print-ap1394.c @@ -55,7 +55,7 @@ fwaddr_string(netdissect_options *ndo, const u_char *addr) return (linkaddr_string(ndo, addr, LINKADDR_IEEE1394, FIREWIRE_EUI64_LEN)); } -static inline void +static void ap1394_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { const struct firewire_header *fp; diff --git a/print-arcnet.c b/print-arcnet.c index 1b465106..469361ef 100644 --- a/print-arcnet.c +++ b/print-arcnet.c @@ -118,7 +118,7 @@ static const struct tok arctypemap[] = { { 0, 0 } }; -static inline void +static void arcnet_print(netdissect_options *ndo, const u_char *bp, u_int length, int phds, u_int flag, u_int seqid) { diff --git a/print-cip.c b/print-cip.c index debdc3f6..a8538867 100644 --- a/print-cip.c +++ b/print-cip.c @@ -41,7 +41,7 @@ static const unsigned char rfcllc[] = { 0x00, 0x00 }; -static inline void +static void cip_print(netdissect_options *ndo, u_int length) { /* diff --git a/print-dccp.c b/print-dccp.c index 7c092a8a..b36f1072 100644 --- a/print-dccp.c +++ b/print-dccp.c @@ -191,7 +191,8 @@ static const char *dccp_feature_nums[] = { "check data checksum", }; -static inline u_int dccp_csum_coverage(const struct dccp_hdr* dh, u_int len) +static u_int +dccp_csum_coverage(const struct dccp_hdr* dh, u_int len) { u_int cov; @@ -237,7 +238,8 @@ static uint64_t dccp_seqno(const u_char *bp) return seqno; } -static inline unsigned int dccp_basic_hdr_len(const struct dccp_hdr *dh) +static unsigned int +dccp_basic_hdr_len(const struct dccp_hdr *dh) { return DCCPH_X(dh) ? sizeof(struct dccp_hdr_ext) : sizeof(struct dccp_hdr); } diff --git a/print-ether.c b/print-ether.c index 73947a05..e09f2ac9 100644 --- a/print-ether.c +++ b/print-ether.c @@ -104,7 +104,7 @@ const struct tok ethertype_values[] = { { 0, NULL} }; -static inline void +static void ether_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { diff --git a/print-fddi.c b/print-fddi.c index a174d088..f87c00f7 100644 --- a/print-fddi.c +++ b/print-fddi.c @@ -158,7 +158,7 @@ static const u_char fddi_bit_swap[] = { /* * Print FDDI frame-control bits */ -static inline void +static void print_fddi_fc(netdissect_options *ndo, u_char fc) { switch (fc) { @@ -226,7 +226,7 @@ print_fddi_fc(netdissect_options *ndo, u_char fc) } /* Extract src, dst addresses */ -static inline void +static void extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst) { int i; @@ -250,7 +250,7 @@ extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst) /* * Print the FDDI MAC header */ -static inline void +static void fddi_hdr_print(netdissect_options *ndo, const struct fddi_header *fddip, u_int length, const u_char *fsrc, const u_char *fdst) @@ -267,7 +267,7 @@ fddi_hdr_print(netdissect_options *ndo, length); } -static inline void +static void fddi_smt_print(netdissect_options *ndo, const u_char *p _U_, u_int length _U_) { ND_PRINT(""); diff --git a/print-forces.c b/print-forces.c index 726c2f83..6835522a 100644 --- a/print-forces.c +++ b/print-forces.c @@ -86,7 +86,8 @@ enum { }; #define TOM_MAX_IND (_TOM_RSV_MAX - 1) -static inline int tom_valid(uint8_t tom) +static int +tom_valid(uint8_t tom) { if (tom > 0) { if (tom >= 0x7 && tom <= 0xe) @@ -100,7 +101,8 @@ static inline int tom_valid(uint8_t tom) return 0; } -static inline const char *ForCES_node(uint32_t node) +static const char * +ForCES_node(uint32_t node) { if (node <= 0x3FFFFFFF) return "FE"; @@ -276,7 +278,8 @@ static const struct optlv_h OPTLV_msg[F_OP_MAX + 1] = { /* F_OP_RTRCOMP */ {ZERO_TTLV, 0, " RTRCOMP", NULL}, }; -static inline const struct optlv_h *get_forces_optlv_h(uint16_t opt) +static const struct optlv_h * +get_forces_optlv_h(uint16_t opt) { if (opt > F_OP_MAX || opt == F_OP_RSV) return &OPTLV_msg[F_OP_RSV]; @@ -290,7 +293,8 @@ static inline const struct optlv_h *get_forces_optlv_h(uint16_t opt) #define IND_SUF 0x0 static char ind_buf[IND_SIZE]; -static inline char *indent_pr(int indent, int nlpref) +static char * +indent_pr(int indent, int nlpref) { int i = 0; char *r = ind_buf; @@ -311,7 +315,8 @@ static inline char *indent_pr(int indent, int nlpref) return r; } -static inline int op_valid(uint16_t op, uint16_t mask) +static int +op_valid(uint16_t op, uint16_t mask) { if (op == 0) return 0; @@ -357,7 +362,8 @@ static const struct tok ForCES_TLV[] = { }; #define TLV_HLN 4 -static inline int ttlv_valid(uint16_t ttlv) +static int +ttlv_valid(uint16_t ttlv) { if (ttlv > 0) { if (ttlv == 1 || ttlv == 0x1000) @@ -408,7 +414,8 @@ static const struct tok ForCES_TLV_err[] = { {0, NULL} }; -static inline u_int tlv_valid(u_int tlvl, u_int rlen) +static u_int +tlv_valid(u_int tlvl, u_int rlen) { if (rlen < TLV_HDRL) return INVALID_RLEN; @@ -422,7 +429,8 @@ static inline u_int tlv_valid(u_int tlvl, u_int rlen) return 0; } -static inline int ilv_valid(const struct forces_ilv *ilv, u_int rlen) +static int +ilv_valid(const struct forces_ilv *ilv, u_int rlen) { if (rlen < ILV_HDRL) return INVALID_RLEN; @@ -478,7 +486,8 @@ static const struct tom_h ForCES_msg[TOM_MAX_IND + 1] = { {TOM_QUERYREP, TTLV_T2, CFG_QYR, "Query Response", lfbselect_print}, }; -static inline const struct tom_h *get_forces_tom(uint8_t tom) +static const struct tom_h * +get_forces_tom(uint8_t tom) { int i; for (i = TOM_RSV_I; i <= TOM_MAX_IND; i++) { @@ -509,14 +518,15 @@ enum { }; #define PD_MAX_IND (_TOM_RSV_MAX - 1) -static inline int pd_valid(uint16_t pd) +static int +pd_valid(uint16_t pd) { if (pd >= F_TLV_PDAT && pd <= F_TLV_REST) return 1; return 0; } -static inline void +static void chk_op_type(netdissect_options *ndo, uint16_t type, uint16_t msk, uint16_t omsk) { @@ -564,7 +574,8 @@ static const struct pdata_ops ForCES_pdata[PD_MAX_IND + 1] = { {F_TLV_PDAT, 0, 0, "Inner PATH-DATA TLV", recpdoptlv_print}, }; -static inline const struct pdata_ops *get_forces_pd(uint16_t pd) +static const struct pdata_ops * +get_forces_pd(uint16_t pd) { int i; for (i = PD_RSV_I + 1; i <= PD_MAX_IND; i++) { diff --git a/print-hncp.c b/print-hncp.c index 0433faeb..0dee297f 100644 --- a/print-hncp.c +++ b/print-hncp.c @@ -145,7 +145,7 @@ static const struct tok dh6opt_str[] = { /* * Is an IPv6 address an IPv4-mapped address? */ -static inline int +static int is_ipv4_mapped_address(const u_char *addr) { /* The value of the prefix */ diff --git a/print-ipfc.c b/print-ipfc.c index 8205c978..6c751380 100644 --- a/print-ipfc.c +++ b/print-ipfc.c @@ -42,7 +42,7 @@ struct ipfc_header { #define IPFC_HDRLEN 16 /* Extract src, dst addresses */ -static inline void +static void extract_ipfc_addrs(const struct ipfc_header *ipfcp, char *ipfcsrc, char *ipfcdst) { @@ -57,7 +57,7 @@ extract_ipfc_addrs(const struct ipfc_header *ipfcp, char *ipfcsrc, /* * Print the Network_Header */ -static inline void +static void ipfc_hdr_print(netdissect_options *ndo, const struct ipfc_header *ipfcp _U_, u_int length, const u_char *ipfcsrc, diff --git a/print-ipnet.c b/print-ipnet.c index fa26d29b..9777909b 100644 --- a/print-ipnet.c +++ b/print-ipnet.c @@ -33,7 +33,7 @@ static const struct tok ipnet_values[] = { { 0, NULL } }; -static inline void +static void ipnet_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { const ipnet_hdr_t *hdr; diff --git a/print-lisp.c b/print-lisp.c index 420ca111..01e3fa01 100644 --- a/print-lisp.c +++ b/print-lisp.c @@ -222,8 +222,8 @@ typedef struct map_register_loc { #define MAP_REGISTER_LOC_LEN sizeof(lisp_map_register_loc) -static inline uint8_t extract_lisp_type(uint8_t); -static inline uint8_t is_xtr_data_present(uint8_t , uint8_t); +static uint8_t extract_lisp_type(uint8_t); +static uint8_t is_xtr_data_present(uint8_t, uint8_t); static void lisp_hdr_flag(netdissect_options *, const lisp_map_register_hdr *); static void action_flag(netdissect_options *, uint8_t); static void loc_hdr_flag(netdissect_options *, uint16_t); @@ -393,12 +393,14 @@ invalid: return; } -static inline uint8_t extract_lisp_type(uint8_t lisp_hdr_flags) +static uint8_t +extract_lisp_type(uint8_t lisp_hdr_flags) { return (lisp_hdr_flags) >> TYPE_INDEX; } -static inline uint8_t is_xtr_data_present(uint8_t type, uint8_t lisp_hdr_flags) +static uint8_t +is_xtr_data_present(uint8_t type, uint8_t lisp_hdr_flags) { uint8_t xtr_present = 0; diff --git a/print-nflog.c b/print-nflog.c index b93fc8c5..d8328ec8 100644 --- a/print-nflog.c +++ b/print-nflog.c @@ -46,7 +46,7 @@ static const struct tok nflog_values[] = { { 0, NULL } }; -static inline void +static void nflog_hdr_print(netdissect_options *ndo, const nflog_hdr_t *hdr, u_int length) { ND_PRINT("version %d, resource ID %d", hdr->nflog_version, ntohs(hdr->nflog_rid)); diff --git a/print-null.c b/print-null.c index b859c831..874521e2 100644 --- a/print-null.c +++ b/print-null.c @@ -52,7 +52,7 @@ #define SWAPLONG(y) \ ((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff)) -static inline void +static void null_hdr_print(netdissect_options *ndo, u_int family, u_int length) { if (!ndo->ndo_qflag) { diff --git a/print-pktap.c b/print-pktap.c index 83f238fa..3f28ccb0 100644 --- a/print-pktap.c +++ b/print-pktap.c @@ -67,7 +67,7 @@ typedef struct pktap_header { #define PKT_REC_NONE 0 /* nothing follows the header */ #define PKT_REC_PACKET 1 /* a packet follows the header */ -static inline void +static void pktap_header_print(netdissect_options *ndo, const u_char *bp, u_int length) { const pktap_header_t *hdr; diff --git a/print-ppi.c b/print-ppi.c index c4505c47..09cac11e 100644 --- a/print-ppi.c +++ b/print-ppi.c @@ -26,7 +26,7 @@ typedef struct ppi_header { #ifdef DLT_PPI -static inline void +static void ppi_header_print(netdissect_options *ndo, const u_char *bp, u_int length) { const ppi_header_t *hdr; diff --git a/print-sctp.c b/print-sctp.c index 5130196d..bee474d8 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -434,7 +434,8 @@ static const struct tok PayloadProto_idents[] = { }; -static inline int isForCES_port(u_short Port) +static int +isForCES_port(u_short Port) { if (Port == CHAN_HP) return 1; diff --git a/print-sll.c b/print-sll.c index 1a2ba181..24dc2d46 100644 --- a/print-sll.c +++ b/print-sll.c @@ -129,7 +129,7 @@ static const struct tok sll_pkttype_values[] = { { 0, NULL} }; -static inline void +static void sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length) { u_short ether_type; diff --git a/print-symantec.c b/print-symantec.c index 5edb0b4e..4fd834e1 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -37,7 +37,7 @@ struct symantec_header { nd_byte stuff2[36]; }; -static inline void +static void symantec_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { const struct symantec_header *sp; diff --git a/print-token.c b/print-token.c index 78485a3f..fa7f07f4 100644 --- a/print-token.c +++ b/print-token.c @@ -92,7 +92,7 @@ struct token_header { static const char tstr[] = "[|token-ring]"; /* Extract src, dst addresses */ -static inline void +static void extract_token_addrs(const struct token_header *trp, char *fsrc, char *fdst) { memcpy(fdst, (const char *)trp->token_dhost, 6); @@ -102,7 +102,7 @@ extract_token_addrs(const struct token_header *trp, char *fsrc, char *fdst) /* * Print the TR MAC header */ -static inline void +static void token_hdr_print(netdissect_options *ndo, const struct token_header *trp, u_int length, const u_char *fsrc, const u_char *fdst)