summaryrefslogtreecommitdiffstats
path: root/win/tclWinSerial.c
diff options
context:
space:
mode:
authormdejong <mdejong>2003-01-16 19:01:59 (GMT)
committermdejong <mdejong>2003-01-16 19:01:59 (GMT)
commit87b28d9c78944ebbc26e0dfc02d0b4c07bbdba68 (patch)
tree56fc5ddd5f0d9e560d44bc912f29228edfa92437 /win/tclWinSerial.c
parentd4ef1e892eaf4ac505ca0b50bbec1d3ec472161a (diff)
downloadtcl-87b28d9c78944ebbc26e0dfc02d0b4c07bbdba68.zip
tcl-87b28d9c78944ebbc26e0dfc02d0b4c07bbdba68.tar.gz
tcl-87b28d9c78944ebbc26e0dfc02d0b4c07bbdba68.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.
Diffstat (limited to 'win/tclWinSerial.c')
-rw-r--r--win/tclWinSerial.c26
1 files changed, 14 insertions, 12 deletions
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;