Skip to content

Commit

Permalink
Change c-style casts to reinterpret casts
Browse files Browse the repository at this point in the history
  • Loading branch information
lnovey committed May 3, 2021
1 parent e9635c7 commit 632a2e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/spdlog/details/tcp_client-windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class tcp_client

// set TCP_NODELAY
int enable_flag = 1;
::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, (char *)&enable_flag, sizeof(enable_flag));
::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char *>(&enable_flag), sizeof(enable_flag));
}

// Send exactly n_bytes of the given data.
Expand Down
4 changes: 2 additions & 2 deletions include/spdlog/details/tcp_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ class tcp_client

// set TCP_NODELAY
int enable_flag = 1;
::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, (char *)&enable_flag, sizeof(enable_flag));
::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char *>(&enable_flag), sizeof(enable_flag));

// prevent sigpipe on systems where MSG_NOSIGNAL is not available
#if defined(SO_NOSIGPIPE) && !defined(MSG_NOSIGNAL)
::setsockopt(socket_, SOL_SOCKET, SO_NOSIGPIPE, (char *)&enable_flag, sizeof(enable_flag));
::setsockopt(socket_, SOL_SOCKET, SO_NOSIGPIPE, reinterpret_cast<char *>(&enable_flag), sizeof(enable_flag));
#endif

#if !defined(SO_NOSIGPIPE) && !defined(MSG_NOSIGNAL)
Expand Down

0 comments on commit 632a2e0

Please sign in to comment.