X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29d83fc1e5d41ef6adb7984127ce5dc013b09815..2d956b58023a4955313a1c1531bc70a0deb0b831:/src/os2/gsocket.c diff --git a/src/os2/gsocket.c b/src/os2/gsocket.c index d3078a272d..242e3f4038 100644 --- a/src/os2/gsocket.c +++ b/src/os2/gsocket.c @@ -28,7 +28,7 @@ #define BSD_SELECT /* use Berkley Sockets select */ #include -#include +#include #ifdef __EMX__ #include @@ -42,10 +42,11 @@ #else -#include -#include +#include + +#include #include -#include +#include #include #include @@ -53,7 +54,7 @@ #if defined(__VISAGECPP__) && __IBMCPP__ < 400 -#include +#include #include #include #include @@ -63,9 +64,9 @@ #else -#include -#include -#include +#include +#include +#include #ifdef __EMX__ #define soclose(a) close(a) @@ -80,7 +81,6 @@ int _System soclose(int); #endif #endif -#include #include #if (defined(__VISAGECPP__) && __IBMCPP__ < 400) || defined(__EMX__) # ifdef min @@ -90,6 +90,7 @@ int _System soclose(int); #endif #include #include +#include #include @@ -418,7 +419,7 @@ GSocketError GSocket_SetServer(GSocket *sck) return GSOCK_IOERR; } - ioctl(sck->m_fd, FIONBIO, &arg); + ioctl(sck->m_fd, FIONBIO, (char*)&arg, sizeof(arg)); _GSocket_Enable_Events(sck); /* Bind to the local address, @@ -524,7 +525,7 @@ GSocket *GSocket_WaitConnection(GSocket *socket) return NULL; } - ioctl(connection->m_fd, FIONBIO, &arg); + ioctl(connection->m_fd, FIONBIO, (char*)&arg, sizeof(arg)); _GSocket_Enable_Events(connection); return connection; @@ -593,14 +594,14 @@ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) return GSOCK_IOERR; } - ioctl(sck->m_fd, FIONBIO, &arg); + ioctl(sck->m_fd, FIONBIO, (char*)&arg, sizeof(arg)); _GSocket_Enable_Events(sck); /* Connect it to the peer address, with a timeout (see below) */ ret = connect(sck->m_fd, sck->m_peer->m_addr, sck->m_peer->m_len); printf("connect on %d to %X (%d) returned %d, errno = %d\n", - sck->m_fd, sck->m_peer->m_addr, sck->m_peer->m_len, ret, errno); + sck->m_fd, sck->m_peer->m_addr, sck->m_peer->m_len, ret, errno); if (ret == -1) { err = errno; @@ -701,7 +702,7 @@ GSocketError GSocket_SetNonOriented(GSocket *sck) return GSOCK_IOERR; } - ioctl(sck->m_fd, FIONBIO, &arg); + ioctl(sck->m_fd, FIONBIO, (char*)&arg, sizeof(arg)); _GSocket_Enable_Events(sck); /* Bind to the local address, @@ -1006,7 +1007,7 @@ void GSocket_SetCallback(GSocket *socket, GSocketEventFlags flags, if ((flags & (1 << count)) != 0) { printf("Setting callback no %d for socket at %X to address %X,data %X\n", - count, socket, callback, cdata); + count, socket, callback, cdata); socket->m_cbacks[count] = callback; socket->m_data[count] = cdata; } @@ -1028,7 +1029,7 @@ void GSocket_UnsetCallback(GSocket *socket, GSocketEventFlags flags) if ((flags & (1 << count)) != 0) { printf("Removing callback no %d for socket at %X", - count, socket); + count, socket); socket->m_cbacks[count] = NULL; socket->m_data[count] = NULL; } @@ -1197,7 +1198,7 @@ int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size) ret = send(socket->m_fd, buffer, size, 0); UNMASK_SIGNAL(); #else - ret = send(socket->m_fd, buffer, size, 0); + ret = send(socket->m_fd, (char *)buffer, size, 0); #endif return ret; } @@ -1226,7 +1227,7 @@ int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size) ret = sendto(socket->m_fd, buffer, size, 0, addr, len); UNMASK_SIGNAL(); #else - ret = sendto(socket->m_fd, buffer, size, 0, addr, len); + ret = sendto(socket->m_fd, (char *)buffer, size, 0, addr, len); #endif /* Frees memory allocated from _GAddress_translate_to */ @@ -1490,7 +1491,7 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) { #elif defined(HAVE_INET_ADDR) addr->s_addr = inet_addr(hostname); - if ( (addr->s_addr == -1 ) + if ( addr->s_addr == -1 ) { #else /* Use gethostbyname by default */