]> git.saurik.com Git - wxWidgets.git/commitdiff
some warnings fixed in the sockets code
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 11 Mar 2000 00:47:00 +0000 (00:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 11 Mar 2000 00:47:00 +0000 (00:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/socket.cpp
src/msw/gsocket.c

index a38097d124f7d72a05c00f99fa744295e25fa0c2..89ac01b97d58cfafbfeec60345a28a0c99de206e 100644 (file)
@@ -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?
index db3fe4150411aedf78e5132a07052757a55f065e..b43d45bc6a20ad357ae8b81e9542647c83de6d80 100644 (file)
@@ -37,7 +37,6 @@
 
 #endif /* __GSOCKET_STANDALONE__ */
 
-
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
 #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);