From af9d1662d9618c099b1a0d606a8f14dfd1e86b06 Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Fri, 12 Nov 1999 11:16:52 +0000 Subject: [PATCH] Committing in . VMS patch Adding some expicit type casts Modified Files: wxWindows/src/unix/gsocket.c git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/gsocket.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index 004f6c38dd..12f7eb5845 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -14,12 +14,19 @@ #include #include #include -#ifdef vms +#ifdef __VMS__ +#define SOCK_LEN_TYP (unsigned int*) #include +struct sockaddr_un { + u_char sun_len; /* sockaddr len including null */ + u_char sun_family; /* AF_UNIX */ + char sun_path[108]; /* path name (gag) */ +}; #else #include -#endif #include +#define SOCK_LEN_TYP (int*) +#endif #include #include #include @@ -218,7 +225,7 @@ GAddress *GSocket_GetLocal(GSocket *socket) size = sizeof(addr); - if (getsockname(socket->m_fd, &addr, &size) < 0) { + if (getsockname(socket->m_fd, &addr, SOCK_LEN_TYP &size) < 0) { socket->m_error = GSOCK_IOERR; return NULL; } @@ -799,7 +806,8 @@ int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size) fromlen = sizeof(from); MASK_SIGNAL(); - ret = recvfrom(socket->m_fd, buffer, size, 0, &from, &fromlen); + ret = recvfrom(socket->m_fd, buffer, size, 0, &from, + SOCK_LEN_TYP &fromlen); UNMASK_SIGNAL(); if (ret == -1) @@ -901,7 +909,8 @@ void _GSocket_Detected_Write(GSocket *socket) socket->m_establishing = FALSE; len = sizeof(error); - getsockopt(socket->m_fd, SOL_SOCKET, SO_ERROR, (void*) &error, &len); + getsockopt(socket->m_fd, SOL_SOCKET, SO_ERROR, (void*) &error, + SOCK_LEN_TYP &len); if (error) {