From 45cecdf9436fbfb7776f8ac610b280311d497ad7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 16 Apr 2012 14:19:13 +0000 Subject: [PATCH] Fix type mismatch in wxLogTrace() call in wxSocket. Cast socket handle to a 32 bit value as we use it with "%d" (or "%u" now as it makes more sense) format specifier to avoid problems with type mismatches under Win64. Closes #14204. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/socket.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 33690a3322..0d619a77c2 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -1814,7 +1814,11 @@ wxSocketServer::wxSocketServer(const wxSockAddress& addr, return; } - wxLogTrace( wxTRACE_Socket, wxT("wxSocketServer on fd %d"), m_impl->m_fd ); + // Notice that we need a cast as SOCKET is 64 bit under Win64 and that the + // cast is safe because a SOCKET is a handle and so limited to 32 (or, + // actually, even 24) bit values anyhow. + wxLogTrace( wxTRACE_Socket, wxT("wxSocketServer on fd %u"), + static_cast(m_impl->m_fd) ); } // -------------------------------------------------------------------------- -- 2.45.2