diff options
author | hobbs <hobbs@noemail.net> | 2001-12-19 19:34:17 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2001-12-19 19:34:17 (GMT) |
commit | a9065644a9656f12f59aad6cc92836ac3960d761 (patch) | |
tree | 69c88e0ca3e9c6fd9c3218bb7f4485f215a648b4 /win/tclWinSerial.c | |
parent | a9fe799d22d79280b6a9761005eaea22e2e3ebe7 (diff) | |
download | tcl-a9065644a9656f12f59aad6cc92836ac3960d761.zip tcl-a9065644a9656f12f59aad6cc92836ac3960d761.tar.gz tcl-a9065644a9656f12f59aad6cc92836ac3960d761.tar.bz2 |
* win/tclWinSerial.c (SerialCheckProc): corrected time
calculations to be unsigned. (schroedter)
FossilOrigin-Name: e18bb1c91fd598e1ac8cb656e17a90abb9aef9cc
Diffstat (limited to 'win/tclWinSerial.c')
-rw-r--r-- | win/tclWinSerial.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index ba4e3da..d980df4 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.15 2001/12/17 22:55:51 andreas_kupries Exp $ + * RCS: @(#) $Id: tclWinSerial.c,v 1.16 2001/12/19 19:34:18 hobbs Exp $ */ #include "tclWinInt.h" @@ -79,7 +79,7 @@ typedef struct SerialInfo { int readable; /* flag that the channel is readable */ int writable; /* flag that the channel is writable */ int blockTime; /* max. blocktime in msec */ - int lastEventTime; /* Time in milliseconds since last readable event */ + unsigned int lastEventTime; /* Time in milliseconds since last readable event */ /* Next readable event only after blockTime */ DWORD error; /* pending error code returned by * ClearCommError() */ @@ -350,7 +350,7 @@ SerialBlockTime( *---------------------------------------------------------------------- */ -static int +static unsigned int SerialGetMilliseconds( void) { @@ -442,7 +442,7 @@ SerialCheckProc( int needEvent; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); COMSTAT cStat; - int time; + unsigned int time; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -493,7 +493,8 @@ SerialCheckProc( (infoPtr->error & SERIAL_READ_ERRORS) ) { infoPtr->readable = 1; time = SerialGetMilliseconds(); - if ( (time - infoPtr->lastEventTime) >= infoPtr->blockTime) { + if ((unsigned int) (time - infoPtr->lastEventTime) + >= (unsigned int) infoPtr->blockTime) { needEvent = 1; infoPtr->lastEventTime = time; } |