Skip to content

Commit

Permalink
Remove some unneeded '&' when getting a pointer to a nd_ type
Browse files Browse the repository at this point in the history
Moreover:
Remove some unneeded casts.
  • Loading branch information
fxlb committed Apr 21, 2019
1 parent 1b30fb0 commit 1b081ef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion print-bootp.c
Expand Up @@ -1055,7 +1055,7 @@ rfc1048_print(netdissect_options *ndo,
nd_print_trunc(ndo);
}

#define PRINTCMUADDR(m, s) { ND_TCHECK_4(&cmu->m); \
#define PRINTCMUADDR(m, s) { ND_TCHECK_4(cmu->m); \
if (GET_IPV4_TO_NETWORK_ORDER(cmu->m) != 0) \
ND_PRINT(" %s:%s", s, ipaddr_string(ndo, cmu->m)); }

Expand Down
2 changes: 1 addition & 1 deletion print-bt.c
Expand Up @@ -60,7 +60,7 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
caplen -= BT_HDRLEN;
length -= BT_HDRLEN;
p += BT_HDRLEN;
ND_TCHECK_4(&hdr->direction);
ND_TCHECK_4(hdr->direction);
if (ndo->ndo_eflag)
ND_PRINT(", hci length %u, direction %s", length,
(GET_BE_U_4(hdr->direction)&0x1) ? "in" : "out");
Expand Down
20 changes: 10 additions & 10 deletions print-pptp.c
Expand Up @@ -546,9 +546,9 @@ pptp_sccrq_print(netdissect_options *ndo,
pptp_max_channel_print(ndo, &ptr->max_channel);
ND_TCHECK_2(ptr->firm_rev);
pptp_firm_rev_print(ndo, &ptr->firm_rev);
ND_TCHECK_SIZE(&ptr->hostname);
ND_TCHECK_SIZE(ptr->hostname);
pptp_hostname_print(ndo, &ptr->hostname[0]);
ND_TCHECK_SIZE(&ptr->vendor);
ND_TCHECK_SIZE(ptr->vendor);
pptp_vendor_print(ndo, &ptr->vendor[0]);

return;
Expand Down Expand Up @@ -577,9 +577,9 @@ pptp_sccrp_print(netdissect_options *ndo,
pptp_max_channel_print(ndo, &ptr->max_channel);
ND_TCHECK_2(ptr->firm_rev);
pptp_firm_rev_print(ndo, &ptr->firm_rev);
ND_TCHECK_SIZE(&ptr->hostname);
ND_TCHECK_SIZE(ptr->hostname);
pptp_hostname_print(ndo, &ptr->hostname[0]);
ND_TCHECK_SIZE(&ptr->vendor);
ND_TCHECK_SIZE(ptr->vendor);
pptp_vendor_print(ndo, &ptr->vendor[0]);

return;
Expand Down Expand Up @@ -705,9 +705,9 @@ pptp_ocrq_print(netdissect_options *ndo,
ND_PRINT(" PHONE_NO_LEN(%u)", GET_BE_U_2(ptr->phone_no_len));
ND_TCHECK_2(ptr->reserved1);
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
ND_TCHECK_SIZE(&ptr->phone_no);
ND_TCHECK_SIZE(ptr->phone_no);
ND_PRINT(" PHONE_NO(%.64s)", ptr->phone_no);
ND_TCHECK_SIZE(&ptr->subaddr);
ND_TCHECK_SIZE(ptr->subaddr);
pptp_subaddr_print(ndo, &ptr->subaddr[0]);

return;
Expand Down Expand Up @@ -765,11 +765,11 @@ pptp_icrq_print(netdissect_options *ndo,
ND_PRINT(" DIALED_NO_LEN(%u)", GET_BE_U_2(ptr->dialed_no_len));
ND_TCHECK_2(ptr->dialing_no_len);
ND_PRINT(" DIALING_NO_LEN(%u)", GET_BE_U_2(ptr->dialing_no_len));
ND_TCHECK_SIZE(&ptr->dialed_no);
ND_TCHECK_SIZE(ptr->dialed_no);
ND_PRINT(" DIALED_NO(%.64s)", ptr->dialed_no);
ND_TCHECK_SIZE(&ptr->dialing_no);
ND_TCHECK_SIZE(ptr->dialing_no);
ND_PRINT(" DIALING_NO(%.64s)", ptr->dialing_no);
ND_TCHECK_SIZE(&ptr->subaddr);
ND_TCHECK_SIZE(ptr->subaddr);
pptp_subaddr_print(ndo, &ptr->subaddr[0]);

return;
Expand Down Expand Up @@ -863,7 +863,7 @@ pptp_cdn_print(netdissect_options *ndo,
pptp_cause_code_print(ndo, &ptr->cause_code);
ND_TCHECK_2(ptr->reserved1);
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
ND_TCHECK_SIZE(&ptr->call_stats);
ND_TCHECK_SIZE(ptr->call_stats);
ND_PRINT(" CALL_STATS(%.128s)", ptr->call_stats);

return;
Expand Down
10 changes: 5 additions & 5 deletions print-stp.c
Expand Up @@ -113,7 +113,7 @@ stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,

ND_TCHECK_2(stp_bpdu->port_id);
ND_PRINT(", bridge-id %s.%04x, length %u",
stp_print_bridge_id(ndo, (const u_char *)&stp_bpdu->bridge_id),
stp_print_bridge_id(ndo, stp_bpdu->bridge_id),
GET_BE_U_2(stp_bpdu->port_id), length);

/* in non-verbose mode just print the bridge-id */
Expand All @@ -130,7 +130,7 @@ stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
(float) GET_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE);

ND_PRINT("\n\troot-id %s, root-pathcost %u",
stp_print_bridge_id(ndo, (const u_char *)&stp_bpdu->root_id),
stp_print_bridge_id(ndo, stp_bpdu->root_id),
GET_BE_U_4(stp_bpdu->root_path_cost));

/* Port role is only valid for 802.1w */
Expand Down Expand Up @@ -270,12 +270,12 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,

ND_TCHECK_4(stp_bpdu->root_path_cost);
ND_PRINT("CIST root-id %s, CIST ext-pathcost %u",
stp_print_bridge_id(ndo, (const u_char *)&stp_bpdu->root_id),
stp_print_bridge_id(ndo, stp_bpdu->root_id),
GET_BE_U_4(stp_bpdu->root_path_cost));

ND_TCHECK_SIZE(&stp_bpdu->bridge_id);
ND_TCHECK_SIZE(stp_bpdu->bridge_id);
ND_PRINT("\n\tCIST regional-root-id %s, ",
stp_print_bridge_id(ndo, (const u_char *)&stp_bpdu->bridge_id));
stp_print_bridge_id(ndo, stp_bpdu->bridge_id));

ND_TCHECK_2(stp_bpdu->port_id);
ND_PRINT("CIST port-id %04x,", GET_BE_U_2(stp_bpdu->port_id));
Expand Down

0 comments on commit 1b081ef

Please sign in to comment.