diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinConsole.c | 4 | ||||
-rw-r--r-- | win/tclWinDde.c | 3 | ||||
-rw-r--r-- | win/tclWinFile.c | 25 | ||||
-rw-r--r-- | win/tclWinPipe.c | 9 | ||||
-rw-r--r-- | win/tclWinSerial.c | 4 | ||||
-rw-r--r-- | win/tclWinSock.c | 4 |
6 files changed, 12 insertions, 37 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 1912433..a6207fe 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -1140,7 +1140,7 @@ ConsoleReaderThread( { ConsoleInfo *infoPtr = (ConsoleInfo *)arg; HANDLE *handle = infoPtr->handle; - DWORD count, waitResult; + DWORD waitResult; HANDLE wEvents[2]; /* The first event takes precedence. */ @@ -1163,8 +1163,6 @@ ConsoleReaderThread( break; } - count = 0; - /* * Look for data on the console, but first ignore any events that are * not KEY_EVENTs. diff --git a/win/tclWinDde.c b/win/tclWinDde.c index 6523357..71b03a9 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -139,14 +139,11 @@ int Dde_Init( Tcl_Interp *interp) { - ThreadSpecificData *tsdPtr; - if (!Tcl_InitStubs(interp, "8.1", 0)) { return TCL_ERROR; } Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, NULL, NULL); - tsdPtr = TCL_TSD_INIT(&dataKey); Tcl_CreateExitHandler(DdeExitProc, NULL); return Tcl_PkgProvide(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION); } diff --git a/win/tclWinFile.c b/win/tclWinFile.c index df1c25b..f0f3bb0 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -252,9 +252,7 @@ WinLink( * It is a file. */ - if (CreateHardLink == NULL) { - Tcl_SetErrno(ENOTDIR); - } else if (linkAction & TCL_CREATE_HARD_LINK) { + if (linkAction & TCL_CREATE_HARD_LINK) { if (CreateHardLink(linkSourcePath, linkTargetPath, NULL)) { /* * Success! @@ -925,24 +923,16 @@ TclpMatchInDirectory( int len; DWORD attr; + WIN32_FILE_ATTRIBUTE_DATA data; const char *str = Tcl_GetStringFromObj(norm,&len); native = Tcl_FSGetNativePath(pathPtr); - if (GetFileAttributesEx == NULL) { - attr = GetFileAttributes(native); - if (attr == INVALID_FILE_ATTRIBUTES) { - return TCL_OK; - } - } else { - WIN32_FILE_ATTRIBUTE_DATA data; - - if (GetFileAttributesEx(native, - GetFileExInfoStandard, &data) != TRUE) { - return TCL_OK; - } - attr = data.dwFileAttributes; + if (GetFileAttributesEx(native, + GetFileExInfoStandard, &data) != TRUE) { + return TCL_OK; } + attr = data.dwFileAttributes; if (NativeMatchType(WinIsDrive(str,len), attr, native, types)) { Tcl_ListObjAppendElement(interp, resultPtr, pathPtr); @@ -1023,8 +1013,7 @@ TclpMatchInDirectory( } native = Tcl_WinUtfToTChar(dirName, -1, &ds); - if (FindFirstFileEx == NULL || (types == NULL) - || (types->type != TCL_GLOB_TYPE_DIR)) { + if ((types == NULL) || (types->type != TCL_GLOB_TYPE_DIR)) { handle = FindFirstFile(native, &data); } else { /* diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 10b6ab2..f1b18df 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -320,7 +320,6 @@ PipeSetupProc( PipeInfo *infoPtr; Tcl_Time blockTime = { 0, 0 }; int block = 1; - WinFile *filePtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!(flags & TCL_FILE_EVENTS)) { @@ -334,13 +333,11 @@ PipeSetupProc( for (infoPtr = tsdPtr->firstPipePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->watchMask & TCL_WRITABLE) { - filePtr = (WinFile*) infoPtr->writeFile; if (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT) { block = 0; } } if (infoPtr->watchMask & TCL_READABLE) { - filePtr = (WinFile*) infoPtr->readFile; if (WaitForRead(infoPtr, 0) >= 0) { block = 0; } @@ -375,7 +372,6 @@ PipeCheckProc( { PipeInfo *infoPtr; PipeEvent *evPtr; - WinFile *filePtr; int needEvent; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); @@ -398,13 +394,11 @@ PipeCheckProc( */ needEvent = 0; - filePtr = (WinFile*) infoPtr->writeFile; if ((infoPtr->watchMask & TCL_WRITABLE) && (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT)) { needEvent = 1; } - filePtr = (WinFile*) infoPtr->readFile; if ((infoPtr->watchMask & TCL_READABLE) && (WaitForRead(infoPtr, 0) >= 0)) { needEvent = 1; @@ -2239,7 +2233,6 @@ PipeEventProc( { PipeEvent *pipeEvPtr = (PipeEvent *)evPtr; PipeInfo *infoPtr; - WinFile *filePtr; int mask; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); @@ -2276,14 +2269,12 @@ PipeEventProc( * detected EOF. */ - filePtr = (WinFile*) ((PipeInfo*)infoPtr)->writeFile; mask = 0; if ((infoPtr->watchMask & TCL_WRITABLE) && (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT)) { mask = TCL_WRITABLE; } - filePtr = (WinFile*) ((PipeInfo*)infoPtr)->readFile; if ((infoPtr->watchMask & TCL_READABLE) && (WaitForRead(infoPtr,0) >= 0)) { if (infoPtr->readFlags & PIPE_EOF) { mask = TCL_READABLE; diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 503358b..0941d4a 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1433,9 +1433,7 @@ TclWinSerialReopen( const TCHAR *name, DWORD access) { - ThreadSpecificData *tsdPtr; - - tsdPtr = SerialInit(); + SerialInit(); /* * Multithreaded I/O needs the overlapped flag set otherwise diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 4134420..0c1a270 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1964,8 +1964,10 @@ TcpSetOptionProc( const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { +#ifdef TCL_FEATURE_KEEPALIVE_NAGLE SocketInfo *infoPtr = instanceData; SOCKET sock; +#endif /*TCL_FEATURE_KEEPALIVE_NAGLE*/ /* * Check that WinSock is initialized; do not call it if not, to prevent @@ -1980,9 +1982,9 @@ TcpSetOptionProc( return TCL_ERROR; } +#ifdef TCL_FEATURE_KEEPALIVE_NAGLE sock = infoPtr->sockets->fd; -#ifdef TCL_FEATURE_KEEPALIVE_NAGLE if (!strcasecmp(optionName, "-keepalive")) { BOOL val = FALSE; int boolVar, rtn; |