From 632a2e08945f898d466c28368194c82d62367792 Mon Sep 17 00:00:00 2001 From: Luke Novey Date: Mon, 3 May 2021 12:33:58 -0400 Subject: [PATCH] Change c-style casts to reinterpret casts --- include/spdlog/details/tcp_client-windows.h | 2 +- include/spdlog/details/tcp_client.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/tcp_client-windows.h b/include/spdlog/details/tcp_client-windows.h index 7ee72927b..95c0d22e8 100644 --- a/include/spdlog/details/tcp_client-windows.h +++ b/include/spdlog/details/tcp_client-windows.h @@ -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(&enable_flag), sizeof(enable_flag)); } // Send exactly n_bytes of the given data. diff --git a/include/spdlog/details/tcp_client.h b/include/spdlog/details/tcp_client.h index 9f3bb99e0..622e99498 100644 --- a/include/spdlog/details/tcp_client.h +++ b/include/spdlog/details/tcp_client.h @@ -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(&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(&enable_flag), sizeof(enable_flag)); #endif #if !defined(SO_NOSIGPIPE) && !defined(MSG_NOSIGNAL)