From: Eugene Syromyatnikov Date: Mon, 22 Jan 2018 12:24:40 +0000 (+0100) Subject: Use char * for pointer arithmetics X-Git-Tag: v4.21~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0327446ae5aa6b858a09d68e3498fd21abc2e7eb;p=strace Use char * for pointer arithmetics * netlink_inet_diag.c (decode_inet_diag_req_compat, decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char * instead of void *. * netlink_netlink_diag.c (decode_netlink_diag_req, decode_netlink_diag_msg): Likewise. * netlink_packet_diag.c (decode_packet_diag_req, decode_packet_diag_msg): Likewise. * netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg): Likewise. * rtnl_addr.c (decode_ifaddrmsg): Likewise. * rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise. * rtnl_dcb.c (decode_dcbmsg): Likewise. * rtnl_link.c (decode_ifinfomsg): Likewise. * rtnl_mdb.c (decode_br_port_msg): Likewise. * rtnl_neigh.c (decode_ndmsg): Likewise. * rtnl_route.c (decode_rtmsg): Likewise. * rtnl_rule.c (decode_fib_rule_hdr): Likewise. * rtnl_tc.c (decode_tcmsg): Likewise. --- diff --git a/netlink_inet_diag.c b/netlink_inet_diag.c index afe48f8d..68fef820 100644 --- a/netlink_inet_diag.c +++ b/netlink_inet_diag.c @@ -202,7 +202,7 @@ decode_inet_diag_req_compat(struct tcb *const tcp, if (len >= sizeof(req)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(req) - offset, - (void *) &req + offset)) { + (char *) &req + offset)) { PRINT_FIELD_U("", req, idiag_src_len); PRINT_FIELD_U(", ", req, idiag_dst_len); PRINT_FIELD_FLAGS(", ", req, idiag_ext, @@ -245,7 +245,7 @@ decode_inet_diag_req_v2(struct tcb *const tcp, if (len >= sizeof(req)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(req) - offset, - (void *) &req + offset)) { + (char *) &req + offset)) { PRINT_FIELD_XVAL("", req, sdiag_protocol, inet_protocols, "IPPROTO_???"); PRINT_FIELD_FLAGS(", ", req, idiag_ext, @@ -401,7 +401,7 @@ DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg) if (len >= sizeof(msg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(msg) - offset, - (void *) &msg + offset)) { + (char *) &msg + offset)) { PRINT_FIELD_XVAL("", msg, idiag_state, tcp_states, "TCP_???"); PRINT_FIELD_U(", ", msg, idiag_timer); diff --git a/netlink_netlink_diag.c b/netlink_netlink_diag.c index 65d41957..aedf316a 100644 --- a/netlink_netlink_diag.c +++ b/netlink_netlink_diag.c @@ -51,7 +51,7 @@ DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_req) if (len >= sizeof(req)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(req) - offset, - (void *) &req + offset)) { + (char *) &req + offset)) { if (NDIAG_PROTO_ALL == req.sdiag_protocol) tprintf("%s=%s", "sdiag_protocol", "NDIAG_PROTO_ALL"); @@ -162,7 +162,7 @@ DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg) if (len >= sizeof(msg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(msg) - offset, - (void *) &msg + offset)) { + (char *) &msg + offset)) { PRINT_FIELD_XVAL("", msg, ndiag_type, socktypes, "SOCK_???"); PRINT_FIELD_XVAL(", ", msg, ndiag_protocol, diff --git a/netlink_packet_diag.c b/netlink_packet_diag.c index 8a69d4cc..21147be4 100644 --- a/netlink_packet_diag.c +++ b/netlink_packet_diag.c @@ -51,7 +51,7 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req) if (len >= sizeof(req)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(req) - offset, - (void *) &req + offset)) { + (char *) &req + offset)) { PRINT_FIELD_XVAL("", req, sdiag_protocol, ethernet_protocols, "ETH_P_???"); PRINT_FIELD_U(", ", req, pdiag_ino); @@ -187,7 +187,7 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg) if (len >= sizeof(msg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(msg) - offset, - (void *) &msg + offset)) { + (char *) &msg + offset)) { PRINT_FIELD_XVAL("", msg, pdiag_type, socktypes, "SOCK_???"); PRINT_FIELD_U(", ", msg, pdiag_num); diff --git a/netlink_unix_diag.c b/netlink_unix_diag.c index 254a659f..535c9f15 100644 --- a/netlink_unix_diag.c +++ b/netlink_unix_diag.c @@ -49,7 +49,7 @@ DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req) if (len >= sizeof(req)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(req) - offset, - (void *) &req + offset)) { + (char *) &req + offset)) { PRINT_FIELD_U("", req, sdiag_protocol); PRINT_FIELD_FLAGS(", ", req, udiag_states, tcp_state_flags, "1<= sizeof(msg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(msg) - offset, - (void *) &msg + offset)) { + (char *) &msg + offset)) { PRINT_FIELD_XVAL("", msg, udiag_type, socktypes, "SOCK_???"); PRINT_FIELD_XVAL(", ", msg, udiag_state, diff --git a/rtnl_addr.c b/rtnl_addr.c index a05cfbed..5c382216 100644 --- a/rtnl_addr.c +++ b/rtnl_addr.c @@ -115,7 +115,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg) if (len >= sizeof(ifaddr)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(ifaddr) - offset, - (void *) &ifaddr + offset)) { + (char *) &ifaddr + offset)) { PRINT_FIELD_U("", ifaddr, ifa_prefixlen); PRINT_FIELD_FLAGS(", ", ifaddr, ifa_flags, ifaddrflags, "IFA_F_???"); diff --git a/rtnl_addrlabel.c b/rtnl_addrlabel.c index 7fc48751..9a8164c8 100644 --- a/rtnl_addrlabel.c +++ b/rtnl_addrlabel.c @@ -70,7 +70,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg) if (len >= sizeof(ifal)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(ifal) - offset, - (void *) &ifal + offset)) { + (char *) &ifal + offset)) { PRINT_FIELD_U("", ifal, ifal_prefixlen); PRINT_FIELD_U(", ", ifal, ifal_flags); PRINT_FIELD_IFINDEX(", ", ifal, ifal_index); diff --git a/rtnl_dcb.c b/rtnl_dcb.c index 0724dcb9..d2a63265 100644 --- a/rtnl_dcb.c +++ b/rtnl_dcb.c @@ -53,7 +53,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_dcbmsg) if (len >= sizeof(dcb)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(dcb) - offset, - (void *) &dcb + offset)) { + (char *) &dcb + offset)) { PRINT_FIELD_XVAL("", dcb, cmd, dcb_commands, "DCB_CMD_???"); decode_nla = true; diff --git a/rtnl_link.c b/rtnl_link.c index 46d78b6c..ef067b9e 100644 --- a/rtnl_link.c +++ b/rtnl_link.c @@ -434,7 +434,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg) if (len >= sizeof(ifinfo)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(ifinfo) - offset, - (void *) &ifinfo + offset)) { + (char *) &ifinfo + offset)) { PRINT_FIELD_XVAL("", ifinfo, ifi_type, arp_hardware_types, "ARPHRD_???"); PRINT_FIELD_IFINDEX(", ", ifinfo, ifi_index); diff --git a/rtnl_mdb.c b/rtnl_mdb.c index 30c3473e..4757c3d3 100644 --- a/rtnl_mdb.c +++ b/rtnl_mdb.c @@ -215,7 +215,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg) if (len >= sizeof(bpm)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(bpm) - offset, - (void *) &bpm + offset)) { + (char *) &bpm + offset)) { PRINT_FIELD_IFINDEX("", bpm, ifindex); decode_nla = true; } diff --git a/rtnl_neigh.c b/rtnl_neigh.c index 0eaadc59..ae9fc0a7 100644 --- a/rtnl_neigh.c +++ b/rtnl_neigh.c @@ -102,7 +102,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_ndmsg) if (len >= sizeof(ndmsg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(ndmsg) - offset, - (void *) &ndmsg + offset)) { + (char *) &ndmsg + offset)) { PRINT_FIELD_IFINDEX("", ndmsg, ndm_ifindex); PRINT_FIELD_FLAGS(", ", ndmsg, ndm_state, neighbor_cache_entry_states, diff --git a/rtnl_route.c b/rtnl_route.c index 102b8057..e0ad01d9 100644 --- a/rtnl_route.c +++ b/rtnl_route.c @@ -283,7 +283,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_rtmsg) if (len >= sizeof(rtmsg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(rtmsg) - offset, - (void *) &rtmsg + offset)) { + (char *) &rtmsg + offset)) { PRINT_FIELD_U("", rtmsg, rtm_dst_len); PRINT_FIELD_U(", ", rtmsg, rtm_src_len); PRINT_FIELD_FLAGS(", ", rtmsg, rtm_tos, diff --git a/rtnl_rule.c b/rtnl_rule.c index bd955ea6..94846148 100644 --- a/rtnl_rule.c +++ b/rtnl_rule.c @@ -116,7 +116,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr) if (len >= sizeof(msg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(msg) - offset, - (void *) &msg + offset)) { + (char *) &msg + offset)) { tprintf("dst_len=%u, src_len=%u", msg.rtm_dst_len, msg.rtm_src_len); tprints(", tos="); diff --git a/rtnl_tc.c b/rtnl_tc.c index e1bda754..d3e94604 100644 --- a/rtnl_tc.c +++ b/rtnl_tc.c @@ -308,7 +308,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_tcmsg) if (len >= sizeof(tcmsg)) { if (!umoven_or_printaddr(tcp, addr + offset, sizeof(tcmsg) - offset, - (void *) &tcmsg + offset)) { + (char *) &tcmsg + offset)) { PRINT_FIELD_IFINDEX("", tcmsg, tcm_ifindex); PRINT_FIELD_U(", ", tcmsg, tcm_handle); PRINT_FIELD_U(", ", tcmsg, tcm_parent);