]> granicus.if.org Git - strace/commitdiff
Use char * for pointer arithmetics
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 22 Jan 2018 12:24:40 +0000 (13:24 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 23 Jan 2018 23:17:02 +0000 (23:17 +0000)
* 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.

13 files changed:
netlink_inet_diag.c
netlink_netlink_diag.c
netlink_packet_diag.c
netlink_unix_diag.c
rtnl_addr.c
rtnl_addrlabel.c
rtnl_dcb.c
rtnl_link.c
rtnl_mdb.c
rtnl_neigh.c
rtnl_route.c
rtnl_rule.c
rtnl_tc.c

index afe48f8da5ee93dcfc56aeffed4616bf946486e9..68fef82083499c90da66cacc1c2eb0b0a83a1b34 100644 (file)
@@ -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);
index 65d419572c47f417151994b192c5634dfdb50106..aedf316ae96f27b2b33e2b22533944cdd69c0de6 100644 (file)
@@ -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,
index 8a69d4ccfd986c3c77556aef3833a6a0baf3669c..21147be4b8c450316982ad333484aaa213a8a2dc 100644 (file)
@@ -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);
index 254a659fbcf5fdc14a14e25e84e29a5f7f7ae159..535c9f15a02f681e50b4e4396e5c0f0a897f5881 100644 (file)
@@ -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<<TCP_???");
@@ -153,7 +153,7 @@ DECL_NETLINK_DIAG_DECODER(decode_unix_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, udiag_type,
                                         socktypes, "SOCK_???");
                        PRINT_FIELD_XVAL(", ", msg, udiag_state,
index a05cfbed974cbf4093dac7782691262bf3570e38..5c3822167d8947cd55b13437223d6704945290e5 100644 (file)
@@ -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_???");
index 7fc48751f208b8f9f75a67de4f6dad57af1c01b7..9a8164c8071d2dcb903468955452e39d59e57504 100644 (file)
@@ -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);
index 0724dcb947a9543062996dd335aa16a271d663c8..d2a6326589efc13f89adba5d4659d2c5807eca40 100644 (file)
@@ -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;
index 46d78b6c908b0a642adbf5fcaad2183e2e1fefc8..ef067b9e3be2b9bc4973fc0796855e83403d2084 100644 (file)
@@ -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);
index 30c3473e7e36115f2e88617b0b77d358f50e570c..4757c3d30552f3b81d40c1d32d54b4cd13eabd5d 100644 (file)
@@ -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;
                }
index 0eaadc593abedfb02b55f4e019d28d7f142d23fe..ae9fc0a7778906da75f3372505aa5cad43fd8ddd 100644 (file)
@@ -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,
index 102b8057cf23ae9368667f8fe17ba4e2be331a8a..e0ad01d913b8dac2995477767d8ce039ce3067a0 100644 (file)
@@ -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,
index bd955ea6e0cfd32ba967f5599d33e7efaefbd7cc..94846148d7b41b6213aba31b292a674127aaf505 100644 (file)
@@ -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=");
index e1bda7546a845cb4f931d1b2b90a731d3bf6855f..d3e94604f0635513524ed0232422fae5c4a21490 100644 (file)
--- 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);