Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
76394f1b
Commit
76394f1b
authored
May 13, 2019
by
Minun Dragonation
Browse files
remove useless type casting
parent
f5454d50
Changes
1
Hide whitespace changes
Inline
Side-by-side
sockcompat.c
View file @
76394f1b
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment