]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove some unneeded '&' when getting a pointer to a nd_ type
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 21 Apr 2019 18:21:06 +0000 (20:21 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 21 Apr 2019 18:21:06 +0000 (20:21 +0200)
Moreover:
Remove some unneeded casts.

print-bootp.c
print-bt.c
print-pptp.c
print-stp.c

index 89bd59bee7d6c0f8987c205c4e6252ce84be86ac..95d5d73b294a5def19c6c12d8c3a6509298fe3ab 100644 (file)
@@ -1055,7 +1055,7 @@ trunc:
        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)); }
 
index 77aebe4262f10c8c01c9c96e7aec9943bddff2f3..9b0859f9f7a7ab6ff40f6333189852185bb3bc75 100644 (file)
@@ -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");
index b2adc1d95250c7d059fad3e048e01e837eb224ad..d6992de46d1fad18b24df06a5ad2b657da139ce2 100644 (file)
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
index b22c5375f17108cd317589a1c2b5fa9f1cc8d871..54eb70bc3a74a42094e45f7b95a07a36d3ebeb10 100644 (file)
@@ -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 */
@@ -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 */
@@ -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));