mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
clang-tidy: google-readability-casting (NFC)
This commit is contained in:
@@ -190,7 +190,7 @@ std::unique_ptr<NetworkStream> TCPAcceptor::accept() {
|
||||
socklen_t len = sizeof(address);
|
||||
#endif
|
||||
std::memset(&address, 0, sizeof(address));
|
||||
int sd = ::accept(m_lsd, (struct sockaddr*)&address, &len);
|
||||
int sd = ::accept(m_lsd, reinterpret_cast<struct sockaddr*>(&address), &len);
|
||||
if (sd < 0) {
|
||||
if (!m_shutdown) {
|
||||
WPI_ERROR(m_logger, "accept() on port "
|
||||
|
||||
@@ -108,7 +108,8 @@ std::unique_ptr<NetworkStream> TCPConnector::connect(const char* server,
|
||||
WPI_ERROR(logger, "could not create socket");
|
||||
return nullptr;
|
||||
}
|
||||
if (::connect(sd, (struct sockaddr*)&address, sizeof(address)) != 0) {
|
||||
if (::connect(sd, reinterpret_cast<struct sockaddr*>(&address),
|
||||
sizeof(address)) != 0) {
|
||||
WPI_ERROR(logger, "connect() to " << server << " port " << port
|
||||
<< " failed: " << SocketStrerror());
|
||||
#ifdef _WIN32
|
||||
@@ -152,8 +153,8 @@ std::unique_ptr<NetworkStream> TCPConnector::connect(const char* server,
|
||||
#endif
|
||||
|
||||
// Connect with time limit
|
||||
if ((result = ::connect(sd, (struct sockaddr*)&address, sizeof(address))) <
|
||||
0) {
|
||||
if ((result = ::connect(sd, reinterpret_cast<struct sockaddr*>(&address),
|
||||
sizeof(address))) < 0) {
|
||||
int my_errno = SocketErrno();
|
||||
#ifdef _WIN32
|
||||
if (my_errno == WSAEWOULDBLOCK || my_errno == WSAEINPROGRESS) {
|
||||
|
||||
Reference in New Issue
Block a user