From 378d2bd3a8f9f3f3b48a705e7b3f59e52fa20df5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 11 Mar 2000 00:47:00 +0000 Subject: [PATCH] some warnings fixed in the sockets code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/socket.cpp | 2 +- src/msw/gsocket.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index a38097d124..89ac01b97d 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -653,7 +653,7 @@ bool wxSocketBase::_Wait(long seconds, { m_connected = FALSE; m_establishing = FALSE; - return (flags & GSOCK_LOST_FLAG); + return (flags & GSOCK_LOST_FLAG) != 0; } // Wait more? diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c index db3fe41504..b43d45bc6a 100644 --- a/src/msw/gsocket.c +++ b/src/msw/gsocket.c @@ -37,7 +37,6 @@ #endif /* __GSOCKET_STANDALONE__ */ - #include #include #include @@ -51,6 +50,11 @@ #define SOCKLEN_T int #endif +#ifdef _MSC_VER + /* using FD_SET results in this warning */ + #pragma warning(disable:4127) /* conditional expression is constant */ +#endif /* Visual C++ */ + #define CLASSNAME "_GSocket_Internal_Window_Class" #define WINDOWNAME "_GSocket_Internal_Window_Name" @@ -397,7 +401,7 @@ GSocketError GSocket_SetServer(GSocket *sck) if ((bind(sck->m_fd, sck->m_local->m_addr, sck->m_local->m_len) != 0) || (getsockname(sck->m_fd, sck->m_local->m_addr, - &sck->m_local->m_len) != 0) || + (SOCKLEN_T *)&sck->m_local->m_len) != 0) || (listen(sck->m_fd, 5) != 0)) { closesocket(sck->m_fd); @@ -668,7 +672,7 @@ GSocketError GSocket_SetNonOriented(GSocket *sck) if ((bind(sck->m_fd, sck->m_local->m_addr, sck->m_local->m_len) != 0) || (getsockname(sck->m_fd, sck->m_local->m_addr, - &sck->m_local->m_len) != 0)) + (SOCKLEN_T *)&sck->m_local->m_len) != 0)) { closesocket(sck->m_fd); sck->m_fd = INVALID_SOCKET; @@ -1446,6 +1450,10 @@ unsigned short GAddress_INET_GetPort(GAddress *address) * ------------------------------------------------------------------------- */ +#ifdef _MSC_VER + #pragma warning(disable:4100) /* unreferenced formal parameter */ +#endif /* Visual C++ */ + GSocketError _GAddress_Init_UNIX(GAddress *address) { assert (address != NULL); -- 2.45.2