diff options
author | mdejong <mdejong@noemail.net> | 2003-01-16 19:01:58 (GMT) |
---|---|---|
committer | mdejong <mdejong@noemail.net> | 2003-01-16 19:01:58 (GMT) |
commit | 3c27c898a370a972f428790856e6eb1ca661e402 (patch) | |
tree | 56fc5ddd5f0d9e560d44bc912f29228edfa92437 /win | |
parent | bfad72422be11a4d95a4f6d3ec898ed46c21aa65 (diff) | |
download | tcl-3c27c898a370a972f428790856e6eb1ca661e402.zip tcl-3c27c898a370a972f428790856e6eb1ca661e402.tar.gz tcl-3c27c898a370a972f428790856e6eb1ca661e402.tar.bz2 |
* win/tclWin32Dll.c (squelch_warnings): Squelch
compiler warnings from SEH ASM code.
* win/tclWinChan.c (squelch_warnings): Squelch
compiler warnings from SEH ASM code.
* win/tclWinDde.c: Add casts to avoid compiler
warnings. Pass pointer to DWORD instead of int
to avoid compiler warnings.
* win/tclWinFCmd.c (squelch_warnings): Add casts
and fixup decls to avoid compiler warnings.
Squelch compiler warnings from SEH ASM code.
* win/tclWinFile.c: Add casts and fixup decls
to avoid compiler warnings. Remove unused variable.
* win/tclWinNotify.c: Declare as DWORD instead
of int to avoid compiler warning.
* win/tclWinReg.c: Add casts to avoid compiler
warning. Fix assignment in if expression bug.
* win/tclWinSerial.c: Add casts to avoid compiler
warnings. Remove unused variable.
* win/tclWinSock.c: Add casts and fixup decls
to avoid compiler warnings.
FossilOrigin-Name: bba93619da24b912054d7ebe92d24a0e64bf7ef7
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWin32Dll.c | 17 | ||||
-rw-r--r-- | win/tclWinChan.c | 17 | ||||
-rw-r--r-- | win/tclWinDde.c | 38 | ||||
-rw-r--r-- | win/tclWinFCmd.c | 24 | ||||
-rw-r--r-- | win/tclWinFile.c | 13 | ||||
-rw-r--r-- | win/tclWinNotify.c | 4 | ||||
-rw-r--r-- | win/tclWinReg.c | 10 | ||||
-rw-r--r-- | win/tclWinSerial.c | 26 | ||||
-rw-r--r-- | win/tclWinSock.c | 38 |
9 files changed, 121 insertions, 66 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 038cf83..ac9e8cd 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWin32Dll.c,v 1.19 2003/01/09 10:38:34 vincentdarley Exp $ + * RCS: @(#) $Id: tclWin32Dll.c,v 1.20 2003/01/16 19:01:59 mdejong Exp $ */ #include "tclWinInt.h" @@ -613,3 +613,18 @@ Tcl_WinTCharToUtf(string, len, dsPtr) return Tcl_ExternalToUtfDString(tclWinTCharEncoding, (CONST char *) string, len, dsPtr); } + +#ifdef HAVE_NO_SEH +/* + * This method exists only to stop the compiler from emitting + * warnings about variables and methods accessed only from asm. + */ +static void squelch_warnings() +{ + void *ptr; + ptr = _except_checkstackspace_handler; + ESP = 0; + EBP = 0; + squelch_warnings(); +} +#endif /* HAVE_NO_SEH */ diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 3799ee5..9ba2f64 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.27 2003/01/14 02:06:11 mdejong Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.28 2003/01/16 19:01:59 mdejong Exp $ */ #include "tclWinInt.h" @@ -1314,3 +1314,18 @@ TclWinFlushDirtyChannels () } } } + +#ifdef HAVE_NO_SEH +/* + * This method exists only to stop the compiler from emitting + * warnings about variables and methods accessed only from asm. + */ +static void squelch_warnings() +{ + void *ptr; + ptr = _except_makefilechannel_handler; + ESP = 0; + EBP = 0; + squelch_warnings(); +} +#endif /* HAVE_NO_SEH */ diff --git a/win/tclWinDde.c b/win/tclWinDde.c index 80e3070..22d17f2 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinDde.c,v 1.8 2002/01/18 14:07:40 dgp Exp $ + * RCS: @(#) $Id: tclWinDde.c,v 1.9 2003/01/16 19:01:59 mdejong Exp $ */ #include "tclPort.h" @@ -451,6 +451,7 @@ DdeServerProc ( { Tcl_DString dString; int len; + DWORD dlen; char *utilString; Tcl_Obj *ddeObjectPtr; HDDEDATA ddeReturn = NULL; @@ -470,7 +471,7 @@ DdeServerProc ( Tcl_DStringInit(&dString); Tcl_DStringSetLength(&dString, len); utilString = Tcl_DStringValue(&dString); - DdeQueryString(ddeInstance, ddeTopic, utilString, len + 1, + DdeQueryString(ddeInstance, ddeTopic, utilString, (DWORD) len + 1, CP_WINANSI); for (riPtr = tsdPtr->interpListPtr; riPtr != NULL; @@ -497,7 +498,7 @@ DdeServerProc ( Tcl_DStringInit(&dString); Tcl_DStringSetLength(&dString, len); utilString = Tcl_DStringValue(&dString); - DdeQueryString(ddeInstance, ddeTopic, utilString, len + 1, + DdeQueryString(ddeInstance, ddeTopic, utilString, (DWORD) len + 1, CP_WINANSI); for (riPtr = tsdPtr->interpListPtr; riPtr != NULL; riPtr = riPtr->nextPtr) { @@ -568,12 +569,12 @@ DdeServerProc ( Tcl_DStringSetLength(&dString, len); utilString = Tcl_DStringValue(&dString); DdeQueryString(ddeInstance, ddeItem, utilString, - len + 1, CP_WINANSI); + (DWORD) len + 1, CP_WINANSI); if (stricmp(utilString, "$TCLEVAL$EXECUTE$RESULT") == 0) { returnString = Tcl_GetStringFromObj(convPtr->returnPackagePtr, &len); ddeReturn = DdeCreateDataHandle(ddeInstance, - returnString, len+1, 0, ddeItem, CF_TEXT, + returnString, (DWORD) len+1, 0, ddeItem, CF_TEXT, 0); } else { Tcl_Obj *variableObjPtr = Tcl_GetVar2Ex( @@ -583,7 +584,8 @@ DdeServerProc ( returnString = Tcl_GetStringFromObj(variableObjPtr, &len); ddeReturn = DdeCreateDataHandle(ddeInstance, - returnString, len+1, 0, ddeItem, CF_TEXT, 0); + returnString, (DWORD) len+1, 0, ddeItem, + CF_TEXT, 0); } else { ddeReturn = NULL; } @@ -614,7 +616,8 @@ DdeServerProc ( return (HDDEDATA) DDE_FNOTPROCESSED; } - utilString = (char *) DdeAccessData(hData, &len); + utilString = (char *) DdeAccessData(hData, &dlen); + len = dlen; ddeObjectPtr = Tcl_NewStringObj(utilString, -1); Tcl_IncrRefCount(ddeObjectPtr); DdeUnaccessData(hData); @@ -664,7 +667,8 @@ DdeServerProc ( numItems = i; ddeReturn = DdeCreateDataHandle(ddeInstance, NULL, (numItems + 1) * sizeof(HSZPAIR), 0, 0, 0, 0); - returnPtr = (HSZPAIR *) DdeAccessData(ddeReturn, &len); + returnPtr = (HSZPAIR *) DdeAccessData(ddeReturn, &dlen); + len = dlen; for (i = 0, riPtr = tsdPtr->interpListPtr; i < numItems; i++, riPtr = riPtr->nextPtr) { returnPtr[i].hszSvc = DdeCreateStringHandle( @@ -1030,7 +1034,7 @@ Tcl_DdeObjCmd( } ddeData = DdeCreateDataHandle(ddeInstance, dataString, - dataLength+1, 0, 0, CF_TEXT, 0); + (DWORD) dataLength+1, 0, 0, CF_TEXT, 0); if (ddeData != NULL) { if (async) { DdeClientTransaction((LPBYTE) ddeData, 0xFFFFFFFF, hConv, 0, @@ -1077,7 +1081,9 @@ Tcl_DdeObjCmd( SetDdeError(interp); result = TCL_ERROR; } else { - dataString = DdeAccessData(ddeData, &dataLength); + DWORD tmp; + dataString = DdeAccessData(ddeData, &tmp); + dataLength = tmp; if (binary) { returnObjPtr = Tcl_NewByteArrayObj(dataString, dataLength); @@ -1116,7 +1122,7 @@ Tcl_DdeObjCmd( ddeItem = DdeCreateStringHandle(ddeInstance, itemString, CP_WINANSI); if (ddeItem != NULL) { - ddeData = DdeClientTransaction(dataString,length+1, + ddeData = DdeClientTransaction(dataString, (DWORD) length+1, hConv, ddeItem, CF_TEXT, XTYP_POKE, 5000, NULL); if (ddeData == NULL) { SetDdeError(interp); @@ -1154,7 +1160,7 @@ Tcl_DdeObjCmd( Tcl_DStringSetLength(&dString, length); name = Tcl_DStringValue(&dString); DdeQueryString(ddeInstance, convInfo.hszSvcPartner, - name, length + 1, CP_WINANSI); + name, (DWORD) length + 1, CP_WINANSI); Tcl_ListObjAppendElement(interp, elementObjPtr, Tcl_NewStringObj(name, length)); length = DdeQueryString(ddeInstance, convInfo.hszTopic, @@ -1162,7 +1168,7 @@ Tcl_DdeObjCmd( Tcl_DStringSetLength(&dString, length); name = Tcl_DStringValue(&dString); DdeQueryString(ddeInstance, convInfo.hszTopic, name, - length + 1, CP_WINANSI); + (DWORD) length + 1, CP_WINANSI); Tcl_ListObjAppendElement(interp, elementObjPtr, Tcl_NewStringObj(name, length)); Tcl_ListObjAppendElement(interp, convListObjPtr, @@ -1257,7 +1263,7 @@ Tcl_DdeObjCmd( objPtr = Tcl_ConcatObj(objc, objv); string = Tcl_GetStringFromObj(objPtr, &length); ddeItemData = DdeCreateDataHandle(ddeInstance, string, - length+1, 0, 0, CF_TEXT, 0); + (DWORD) length+1, 0, 0, CF_TEXT, 0); if (async) { ddeData = DdeClientTransaction((LPBYTE) ddeItemData, @@ -1300,8 +1306,8 @@ Tcl_DdeObjCmd( length = DdeGetData(ddeData, NULL, 0, 0); Tcl_SetObjLength(resultPtr, length); string = Tcl_GetString(resultPtr); - DdeGetData(ddeData, string, length, 0); - Tcl_SetObjLength(resultPtr, strlen(string)); + DdeGetData(ddeData, string, (DWORD) length, 0); + Tcl_SetObjLength(resultPtr, (int) strlen(string)); if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr) != TCL_OK) { diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 0387aeb..f1d5dfe 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFCmd.c,v 1.31 2002/07/15 09:53:21 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFCmd.c,v 1.32 2003/01/16 19:01:59 mdejong Exp $ */ #include "tclWinInt.h" @@ -251,7 +251,7 @@ DoRenameFile( decode: if (srcAttr & FILE_ATTRIBUTE_DIRECTORY) { TCHAR *nativeSrcRest, *nativeDstRest; - char **srcArgv, **dstArgv; + CONST char **srcArgv, **dstArgv; int size, srcArgc, dstArgc; WCHAR nativeSrcPath[MAX_PATH]; WCHAR nativeDstPath[MAX_PATH]; @@ -576,7 +576,7 @@ DoCopyFile( } if (dstAttr & FILE_ATTRIBUTE_READONLY) { (*tclWinProcs->setFileAttributesProc)(nativeDst, - dstAttr & ~FILE_ATTRIBUTE_READONLY); + dstAttr & ~((DWORD)FILE_ATTRIBUTE_READONLY)); if ((*tclWinProcs->copyFileProc)(nativeSrc, nativeDst, 0) != FALSE) { return TCL_OK; } @@ -682,7 +682,7 @@ DoDeleteFile( Tcl_SetErrno(EISDIR); } else if (attr & FILE_ATTRIBUTE_READONLY) { int res = (*tclWinProcs->setFileAttributesProc)(nativePath, - attr & ~FILE_ATTRIBUTE_READONLY); + attr & ~((DWORD)FILE_ATTRIBUTE_READONLY)); if ((res != 0) && ((*tclWinProcs->deleteFileProc)(nativePath) != FALSE)) { return TCL_OK; @@ -1834,3 +1834,19 @@ TclpObjListVolumes(void) Tcl_IncrRefCount(resultPtr); return resultPtr; } + +#ifdef HAVE_NO_SEH +/* + * This method exists only to stop the compiler from emitting + * warnings about variables and methods accessed only from asm. + */ +static void squelch_warnings() +{ + void *ptr; + ptr = _except_dorenamefile_handler; + ptr = _except_docopyfile_handler; + ESP = 0; + EBP = 0; + squelch_warnings(); +} +#endif /* HAVE_NO_SEH */ diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 0023433..f14a558 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.40 2003/01/09 10:38:35 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.41 2003/01/16 19:01:59 mdejong Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -393,7 +393,7 @@ TclWinSymLinkDelete(LinkOriginal, linkOnly) DUMMY_REPARSE_BUFFER dummy; REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER*)&dummy; HANDLE hFile; - int returnedLength; + DWORD returnedLength; memset(reparseBuffer, 0, sizeof(DUMMY_REPARSE_BUFFER)); reparseBuffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; hFile = (*tclWinProcs->createFileProc)(LinkOriginal, GENERIC_WRITE, 0, @@ -506,7 +506,7 @@ NativeReadReparse(LinkDirectory, buffer) REPARSE_DATA_BUFFER* buffer; /* Pointer to buffer. Cannot be NULL */ { HANDLE hFile; - int returnedLength; + DWORD returnedLength; hFile = (*tclWinProcs->createFileProc)(LinkDirectory, GENERIC_READ, 0, NULL, OPEN_EXISTING, @@ -550,7 +550,7 @@ NativeWriteReparse(LinkDirectory, buffer) REPARSE_DATA_BUFFER* buffer; { HANDLE hFile; - int returnedLength; + DWORD returnedLength; /* Create the directory - it must not already exist */ if ((*tclWinProcs->createDirectoryProc)(LinkDirectory, NULL) == 0) { @@ -568,7 +568,7 @@ NativeWriteReparse(LinkDirectory, buffer) } /* Set the link */ if (!DeviceIoControl(hFile, FSCTL_SET_REPARSE_POINT, buffer, - buffer->ReparseDataLength + (DWORD) buffer->ReparseDataLength + REPARSE_MOUNTPOINT_HEADER_SIZE, NULL, 0, &returnedLength, NULL)) { /* Error setting junction */ @@ -2011,7 +2011,6 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) * links are not possible. Both of these assumptions * appear to be true of these operating systems. */ - Tcl_Obj *temp = NULL; int isDrive = 1; Tcl_DString ds; @@ -2171,7 +2170,7 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) Tcl_DStringAppend(&dsNorm,(CONST char*)L"/", sizeof(WCHAR)); Tcl_DStringAppend(&dsNorm,(TCHAR*)nativeName, - wcslen(nativeName)*sizeof(WCHAR)); + (int) (wcslen(nativeName)*sizeof(WCHAR))); } } Tcl_DStringFree(&ds); diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index 5df1e8d..b7bb17d 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinNotify.c,v 1.10 2001/12/14 10:32:47 dkf Exp $ + * RCS: @(#) $Id: tclWinNotify.c,v 1.11 2003/01/16 19:02:00 mdejong Exp $ */ #include "tclWinInt.h" @@ -533,7 +533,7 @@ Tcl_Sleep(ms) Tcl_Time now; /* Current wall clock time */ Tcl_Time desired; /* Desired wakeup time */ - int sleepTime = ms; /* Time to sleep */ + DWORD sleepTime = ms; /* Time to sleep */ Tcl_GetTime( &now ); desired.sec = now.sec + ( ms / 1000 ); diff --git a/win/tclWinReg.c b/win/tclWinReg.c index cf7ff0f..ee453c7 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinReg.c,v 1.19 2002/11/02 22:07:06 davygrvy Exp $ + * RCS: @(#) $Id: tclWinReg.c,v 1.20 2003/01/16 19:02:00 mdejong Exp $ */ #include <tclPort.h> @@ -1341,7 +1341,7 @@ BroadcastValue( if (objc > 3) { str = Tcl_GetStringFromObj(objv[3], &len); - if ((len < 2) || (*str != '-') || strncmp(str, "-timeout", len)) { + if ((len < 2) || (*str != '-') || strncmp(str, "-timeout", (size_t) len)) { Tcl_WrongNumArgs(interp, 2, objv, "keyName ?-timeout millisecs?"); return TCL_ERROR; } @@ -1351,7 +1351,7 @@ BroadcastValue( } str = Tcl_GetStringFromObj(objv[2], &len); - if (len = 0) { + if (len == 0) { str = NULL; } @@ -1362,8 +1362,8 @@ BroadcastValue( (WPARAM) 0, (LPARAM) str, SMTO_ABORTIFHUNG, timeout, &sendResult); objPtr = Tcl_NewObj(); - Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewIntObj(result)); - Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewIntObj(sendResult)); + Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewIntObj((int) result)); + Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewIntObj((int) sendResult)); Tcl_SetObjResult(interp, objPtr); return TCL_OK; diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index e6781ae..582947a 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -11,7 +11,7 @@ * * Serial functionality implemented by Rolf.Schroedter@dlr.de * - * RCS: @(#) $Id: tclWinSerial.c,v 1.23 2002/11/26 22:35:20 davygrvy Exp $ + * RCS: @(#) $Id: tclWinSerial.c,v 1.24 2003/01/16 19:02:00 mdejong Exp $ */ #include "tclWinInt.h" @@ -963,7 +963,7 @@ SerialOutputProc( int *errorCode) /* Where to store error code. */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; - int bytesWritten, timeout; + DWORD bytesWritten, timeout; *errorCode = 0; @@ -1028,9 +1028,9 @@ SerialOutputProc( ckfree(infoPtr->writeBuf); } infoPtr->writeBufLen = toWrite; - infoPtr->writeBuf = ckalloc(toWrite); + infoPtr->writeBuf = ckalloc((unsigned int) toWrite); } - memcpy(infoPtr->writeBuf, buf, toWrite); + memcpy(infoPtr->writeBuf, buf, (size_t) toWrite); infoPtr->toWrite = toWrite; ResetEvent(infoPtr->evWritable); SetEvent(infoPtr->evStartWriter); @@ -1272,7 +1272,6 @@ SerialWriterThread(LPVOID arg) { SerialInfo *infoPtr = (SerialInfo *)arg; - HANDLE *handle = infoPtr->handle; DWORD bytesWritten, toWrite, waitResult; char *buf; OVERLAPPED myWrite; /* have an own OVERLAPPED in this thread */ @@ -1521,7 +1520,7 @@ SerialErrorStr(error, dsPtr) if( (error & CE_PTO) != 0) { /* PTO used to signal WRITE-TIMEOUT */ Tcl_DStringAppendElement(dsPtr, "TIMEOUT"); } - if( (error & ~(SERIAL_READ_ERRORS | SERIAL_WRITE_ERRORS)) != 0) { + if( (error & ~((DWORD) (SERIAL_READ_ERRORS | SERIAL_WRITE_ERRORS))) != 0) { char buf[TCL_INTEGER_SPACE + 1]; wsprintfA(buf, "%d", error); Tcl_DStringAppendElement(dsPtr, buf); @@ -1581,7 +1580,7 @@ SerialSetOptionProc(instanceData, interp, optionName, value) Tcl_DString ds; CONST TCHAR *native; int argc; - char **argv; + CONST char **argv; infoPtr = (SerialInfo *) instanceData; @@ -1749,7 +1748,8 @@ SerialSetOptionProc(instanceData, interp, optionName, value) return TCL_ERROR; } if (strnicmp(argv[0], "DTR", strlen(argv[0])) == 0) { - if (! EscapeCommFunction(infoPtr->handle, flag ? SETDTR : CLRDTR)) { + if (! EscapeCommFunction(infoPtr->handle, flag ? + (DWORD) SETDTR : (DWORD) CLRDTR)) { if (interp) { Tcl_AppendResult(interp, "can't set DTR signal", (char *) NULL); @@ -1757,7 +1757,8 @@ SerialSetOptionProc(instanceData, interp, optionName, value) return TCL_ERROR; } } else if (strnicmp(argv[0], "RTS", strlen(argv[0])) == 0) { - if (! EscapeCommFunction(infoPtr->handle, flag ? SETRTS : CLRRTS)) { + if (! EscapeCommFunction(infoPtr->handle, flag ? + (DWORD) SETRTS : (DWORD) CLRRTS)) { if (interp) { Tcl_AppendResult(interp, "can't set RTS signal", (char *) NULL); @@ -1765,7 +1766,8 @@ SerialSetOptionProc(instanceData, interp, optionName, value) return TCL_ERROR; } } else if (strnicmp(argv[0], "BREAK", strlen(argv[0])) == 0) { - if (! EscapeCommFunction(infoPtr->handle, flag ? SETBREAK : CLRBREAK)) { + if (! EscapeCommFunction(infoPtr->handle, flag ? + (DWORD) SETBREAK : (DWORD) CLRBREAK)) { if (interp) { Tcl_AppendResult(interp, "can't set BREAK signal", (char *) NULL); @@ -1795,7 +1797,7 @@ SerialSetOptionProc(instanceData, interp, optionName, value) /* * -sysbuffer 4096 or -sysbuffer {64536 4096} */ - size_t inSize = -1, outSize = -1; + size_t inSize = (size_t) -1, outSize = (size_t) -1; if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; @@ -2048,7 +2050,7 @@ SerialGetOptionProc(instanceData, interp, optionName, dsPtr) if ((len > 1) && (strncmp(optionName, "-queue", len) == 0)) { char buf[TCL_INTEGER_SPACE + 1]; COMSTAT cStat; - int error; + DWORD error; int inBuffered, outBuffered, count; valid = 1; diff --git a/win/tclWinSock.c b/win/tclWinSock.c index ddd5aec..b92109b 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.35 2003/01/13 01:27:51 mdejong Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.36 2003/01/16 19:02:00 mdejong Exp $ */ #include "tclWinInt.h" @@ -315,7 +315,7 @@ InitSockets() { DWORD id; WSADATA wsaData; - int err; + DWORD err; ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); @@ -985,7 +985,7 @@ TcpCloseProc(instanceData, interp) */ if (winSock.closesocket(infoPtr->socket) == SOCKET_ERROR) { - TclWinConvertWSAError(winSock.WSAGetLastError()); + TclWinConvertWSAError((DWORD) winSock.WSAGetLastError()); errorCode = Tcl_GetErrno(); } } @@ -1124,7 +1124,7 @@ CreateSocket(interp, port, host, server, myaddr, myport, async) * Set kernel space buffering */ - TclSockMinimumBuffers(sock, TCP_BUFFER_SIZE); + TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE); if (server) { /* @@ -1184,7 +1184,7 @@ CreateSocket(interp, port, host, server, myaddr, myport, async) */ if (async) { - if (winSock.ioctlsocket(sock, FIONBIO, &flag) == SOCKET_ERROR) { + if (winSock.ioctlsocket(sock, (long) FIONBIO, &flag) == SOCKET_ERROR) { goto error; } } @@ -1195,7 +1195,7 @@ CreateSocket(interp, port, host, server, myaddr, myport, async) if (winSock.connect(sock, (SOCKADDR *) &sockaddr, sizeof(SOCKADDR_IN)) == SOCKET_ERROR) { - TclWinConvertWSAError(winSock.WSAGetLastError()); + TclWinConvertWSAError((DWORD) winSock.WSAGetLastError()); if (Tcl_GetErrno() != EWOULDBLOCK) { goto error; } @@ -1230,14 +1230,14 @@ CreateSocket(interp, port, host, server, myaddr, myport, async) * automatically places the socket into non-blocking mode. */ - winSock.ioctlsocket(sock, FIONBIO, &flag); + winSock.ioctlsocket(sock, (long) FIONBIO, &flag); SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); return infoPtr; error: - TclWinConvertWSAError(winSock.WSAGetLastError()); + TclWinConvertWSAError((DWORD) winSock.WSAGetLastError()); if (interp != NULL) { Tcl_AppendResult(interp, "couldn't open socket: ", Tcl_PosixError(interp), (char *) NULL); @@ -1296,7 +1296,7 @@ CreateSocketAddress(sockaddrPtr, host, port) if (addr.s_addr == INADDR_NONE) { hostent = winSock.gethostbyname(host); if (hostent != NULL) { - memcpy(&addr, hostent->h_addr, hostent->h_length); + memcpy(&addr, hostent->h_addr, (size_t) hostent->h_length); } else { #ifdef EHOSTUNREACH Tcl_SetErrno(EHOSTUNREACH); @@ -1485,7 +1485,7 @@ Tcl_MakeTcpClientChannel(sock) * Set kernel space buffering and non-blocking. */ - TclSockMinimumBuffers((SOCKET) sock, TCP_BUFFER_SIZE); + TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE); infoPtr = NewSocketInfo((SOCKET) sock); @@ -1698,7 +1698,7 @@ TcpInputProc(instanceData, buf, toRead, errorCodePtr) { SocketInfo *infoPtr = (SocketInfo *) instanceData; int bytesRead; - int error; + DWORD error; ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); @@ -1825,7 +1825,7 @@ TcpOutputProc(instanceData, buf, toWrite, errorCodePtr) { SocketInfo *infoPtr = (SocketInfo *) instanceData; int bytesWritten; - int error; + DWORD error; ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); @@ -1935,8 +1935,9 @@ TcpSetOptionProc ( { SocketInfo *infoPtr; SOCKET sock; +/* BOOL val = FALSE; -/* int boolVar, rtn; + int boolVar, rtn; */ /* * Check that WinSock is initialized; do not call it if not, to @@ -2060,7 +2061,8 @@ TcpGetOptionProc(instanceData, interp, optionName, dsPtr) if ((len > 1) && (optionName[1] == 'e') && (strncmp(optionName, "-error", len) == 0)) { int optlen; - int err, ret; + DWORD err; + int ret; optlen = sizeof(int); ret = TclWinGetSockOpt(sock, SOL_SOCKET, SO_ERROR, @@ -2115,7 +2117,7 @@ TcpGetOptionProc(instanceData, interp, optionName, dsPtr) * no peer). {copied from unix/tclUnixChan.c} */ if (len) { - TclWinConvertWSAError(winSock.WSAGetLastError()); + TclWinConvertWSAError((DWORD) winSock.WSAGetLastError()); if (interp) { Tcl_AppendResult(interp, "can't get peername: ", Tcl_PosixError(interp), @@ -2159,7 +2161,7 @@ TcpGetOptionProc(instanceData, interp, optionName, dsPtr) } } else { if (interp) { - TclWinConvertWSAError(winSock.WSAGetLastError()); + TclWinConvertWSAError((DWORD) winSock.WSAGetLastError()); Tcl_AppendResult(interp, "can't get sockname: ", Tcl_PosixError(interp), (char *) NULL); @@ -2451,7 +2453,7 @@ SocketProc(hwnd, message, wParam, lParam) */ if (error != ERROR_SUCCESS) { - TclWinConvertWSAError(error); + TclWinConvertWSAError((DWORD) error); infoPtr->lastError = Tcl_GetErrno(); } @@ -2459,7 +2461,7 @@ SocketProc(hwnd, message, wParam, lParam) if(infoPtr->flags & SOCKET_ASYNC_CONNECT) { infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); if (error != ERROR_SUCCESS) { - TclWinConvertWSAError(error); + TclWinConvertWSAError((DWORD) error); infoPtr->lastError = Tcl_GetErrno(); } infoPtr->readyEvents |= FD_WRITE; |