summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--win/tclWinSerial.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ed53303..54c815c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tclWinSerial.c (SerialCheckProc): corrected time
+ calculations to be unsigned. (schroedter)
+
2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
* unix/Makefile.in: Define new dltest target that
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;
}