summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2002-11-27 18:37:28 (GMT)
committerdavygrvy <davygrvy@pobox.com>2002-11-27 18:37:28 (GMT)
commitcbd9f68026f5cb0e3a5c745ae0e4d0171e2b0009 (patch)
treeaa358031c8a9a937ecbdbb2a54e83a886a264dcb /win
parent680bad22ac22236b7b1d5fb3deb4533dc0d17d53 (diff)
downloadtcl-cbd9f68026f5cb0e3a5c745ae0e4d0171e2b0009.zip
tcl-cbd9f68026f5cb0e3a5c745ae0e4d0171e2b0009.tar.gz
tcl-cbd9f68026f5cb0e3a5c745ae0e4d0171e2b0009.tar.bz2
* win/tclWinSock.c: Removed shutdown() from the function
table as it wasn't referenced anywhere and cleaned-up some casting that that wasn't needed.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinSock.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index a87b7de..72293ad 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinSock.c,v 1.31 2002/11/27 05:29:46 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.32 2002/11/27 18:37:28 davygrvy Exp $
*/
#include "tclWinInt.h"
@@ -67,7 +67,6 @@ static struct {
LPFN_SELECT select;
LPFN_SEND send;
LPFN_SETSOCKOPT setsockopt;
- LPFN_SHUTDOWN shutdown;
LPFN_SOCKET socket;
LPFN_WSAASYNCSELECT WSAAsyncSelect;
LPFN_WSACLEANUP WSACleanup;
@@ -267,14 +266,14 @@ InitSockets()
winSock.hModule = LoadLibraryA("wsock32.dll");
- /*
- * Initialize the function table.
- */
-
if (winSock.hModule == NULL) {
return;
}
+ /*
+ * Initialize the function table.
+ */
+
winSock.accept = (LPFN_ACCEPT)
GetProcAddress(winSock.hModule, "accept");
winSock.bind = (LPFN_BIND)
@@ -317,8 +316,6 @@ InitSockets()
GetProcAddress(winSock.hModule, "send");
winSock.setsockopt = (LPFN_SETSOCKOPT)
GetProcAddress(winSock.hModule, "setsockopt");
- winSock.shutdown = (LPFN_SHUTDOWN)
- GetProcAddress(winSock.hModule, "shutdown");
winSock.socket = (LPFN_SOCKET)
GetProcAddress(winSock.hModule, "socket");
winSock.WSAAsyncSelect = (LPFN_WSAASYNCSELECT)
@@ -1211,7 +1208,7 @@ CreateSocketAddress(sockaddrPtr, host, port)
return 0;
}
- (void) memset((char *) sockaddrPtr, '\0', sizeof(struct sockaddr_in));
+ ZeroMemory(sockaddrPtr, sizeof(SOCKADDR_IN));
sockaddrPtr->sin_family = AF_INET;
sockaddrPtr->sin_port = winSock.htons((u_short) (port & 0xFFFF));
if (host == NULL) {
@@ -1221,9 +1218,7 @@ CreateSocketAddress(sockaddrPtr, host, port)
if (addr.s_addr == INADDR_NONE) {
hostent = winSock.gethostbyname(host);
if (hostent != NULL) {
- memcpy((char *) &addr,
- (char *) hostent->h_addr_list[0],
- (size_t) hostent->h_length);
+ memcpy(&addr, hostent->h_addr, hostent->h_length);
} else {
#ifdef EHOSTUNREACH
Tcl_SetErrno(EHOSTUNREACH);