net: remove unnecessary casts in socket operations

These methods in the Sock class wrap corresponding syscalls,
accepting void* arguments and casting to char* internally, which is
needed for Windows support and ignored on other platforms because
the syscall itself accepts void*:

Send()
Recv()
GetSockOpt()
SetSockOpt()
This commit is contained in:
Matthew Zipkin
2025-09-12 12:38:01 -04:00
parent d20f10affb
commit 67f632b6de
5 changed files with 8 additions and 16 deletions

View File

@@ -24,7 +24,7 @@ static bool SocketIsClosed(const SOCKET& s)
// wrongly pretend that the socket is not closed.
int type;
socklen_t len = sizeof(type);
return getsockopt(s, SOL_SOCKET, SO_TYPE, (sockopt_arg_type)&type, &len) == SOCKET_ERROR;
return getsockopt(s, SOL_SOCKET, SO_TYPE, reinterpret_cast<char*>(&type), &len) == SOCKET_ERROR;
}
static SOCKET CreateSocket()