summaryrefslogtreecommitdiffstats
path: root/tcpip/ttylinkd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2017-08-01 03:07:11 +0200
committerRalf Baechle <ralf@linux-mips.org>2017-08-03 04:21:23 +0200
commit3ee1ebc7eebcbde2c47c4a92d9a400b172f32d91 (patch)
treeeac81848fb4e5327e5892cb33fd3493ebeaff4d1 /tcpip/ttylinkd.c
parent4ae678eaf8a48d548308a57e23df38c7afca8a0e (diff)
treewide: Remove useless casts from memcpy pointer arguments.
This is using the following semantic patch: @memcpy1@ type T; expression A, B, C; @@ - memcpy((T *)A, B, C) + memcpy(A, B, C) @memcpy2@ type T; expression A, B, C; @@ - memcpy(A, (T *)B, C) + memcpy(A, B, C) Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'tcpip/ttylinkd.c')
-rw-r--r--tcpip/ttylinkd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tcpip/ttylinkd.c b/tcpip/ttylinkd.c
index 200cfdd..3020977 100644
--- a/tcpip/ttylinkd.c
+++ b/tcpip/ttylinkd.c
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
exit(1);
}
}
- memcpy((char*)&rem_addr, rhe->h_addr, rhe->h_length);
+ memcpy(&rem_addr, rhe->h_addr, rhe->h_length);
/* Get our local address */
phe = gethostbyname(hostname);
@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
syslog(LOG_DAEMON | LOG_CRIT, "main(): gethostbyname failed.");
exit(1);
}
- memcpy((char*)&my_addr, phe->h_addr, phe->h_length);
+ memcpy(&my_addr, phe->h_addr, phe->h_length);
/* Create local data socket */
memset((char*)&msg_sa, 0, sizeof(msg_sa));
@@ -271,7 +271,7 @@ int main(int argc, char *argv[])
msg_sa.sa_family = AF_INET;
msg_sin = (struct sockaddr_in*)&msg_sa;
msg_sin->sin_port = htons(0);
- memcpy((char*)&(msg_sin->sin_addr), phe->h_addr, phe->h_length);
+ memcpy(&(msg_sin->sin_addr), phe->h_addr, phe->h_length);
skt = socket(PF_INET, SOCK_STREAM, 0);
if (skt < 0)
@@ -297,7 +297,7 @@ int main(int argc, char *argv[])
memset((char*)&ctl_sin, 0, sizeof(ctl_sin));
ctl_sin.sin_family = AF_INET;
- memcpy((char*)&ctl_sin.sin_addr, phe->h_addr, phe->h_length);
+ memcpy(&ctl_sin.sin_addr, phe->h_addr, phe->h_length);
ctl_sin.sin_port = htons(0);
ctl_skt = socket(PF_INET, SOCK_DGRAM, 0);
@@ -344,7 +344,7 @@ int main(int argc, char *argv[])
/* The person not there? Send an announce and wake him up */
msg.type = ANNOUNCE;
- memcpy((char*)&(msg.addr), (char*)&msg_sa, sizeof(struct osockaddr));
+ memcpy(&(msg.addr), &msg_sa, sizeof(struct osockaddr));
msg.addr.sa_family = htons(AF_INET);
msg.id_num = -1;
i = send_control(ctl_skt, rem_addr, msg, &resp);