summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinun Dragonation <minun@mewmew.cn>2019-05-13 23:20:05 +0800
committerMinun Dragonation <minun@mewmew.cn>2019-05-13 23:20:05 +0800
commit76394f1be87359c88b13fc327f86da9e949ce3e3 (patch)
tree7ab9a60e3bb9e1d280a1b8239276e8afbf386d91
parentf5454d509f9eafef35714c4e5e23af066e80f4f6 (diff)
remove useless type casting
-rw-r--r--sockcompat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sockcompat.c b/sockcompat.c
index c3b6f66..4cc2f41 100644
--- a/sockcompat.c
+++ b/sockcompat.c
@@ -192,7 +192,7 @@ int win32_getsockopt(SOCKET sockfd, int level, int optname, void *optval, sockle
int ret = 0;
if ((level == SOL_SOCKET) && ((optname == SO_RCVTIMEO) || (optname == SO_SNDTIMEO))) {
if (*optlen >= sizeof (struct timeval)) {
- struct timeval *tv = (struct timeval *)optval;
+ struct timeval *tv = optval;
DWORD timeout = 0;
socklen_t dwlen = 0;
ret = getsockopt(sockfd, level, optname, (char *)&timeout, &dwlen);
@@ -212,7 +212,7 @@ int win32_getsockopt(SOCKET sockfd, int level, int optname, void *optval, sockle
int win32_setsockopt(SOCKET sockfd, int level, int optname, const void *optval, socklen_t optlen) {
int ret = 0;
if ((level == SOL_SOCKET) && ((optname == SO_RCVTIMEO) || (optname == SO_SNDTIMEO))) {
- struct timeval *tv = (struct timeval *)optval;
+ struct timeval *tv = optval;
DWORD timeout = tv->tv_sec * 1000 + tv->tv_usec / 1000;
ret = setsockopt(sockfd, level, optname, (const char*)&timeout, sizeof(DWORD));
} else {