From 1b32842190bca544934896869543ba718d86a14d Mon Sep 17 00:00:00 2001 From: andreask Date: Wed, 6 Aug 2014 18:20:56 +0000 Subject: Fixed type conversion warnings which break a Win32 debug build (MSVC). --- generic/tclIO.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index c142917..66c0be6 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -9048,7 +9048,8 @@ MBWrite( ChannelState *outStatePtr = csPtr->writePtr->state; ChannelBuffer *bufPtr = inStatePtr->inQueueHead; ChannelBuffer *tail = NULL; - int code, inBytes = 0; + int code; + Tcl_WideInt inBytes = 0; /* Count up number of bytes waiting in the input queue */ while (bufPtr) { @@ -9063,7 +9064,14 @@ MBWrite( if (bufPtr) { /* Split the overflowing buffer in two */ - int extra = inBytes - csPtr->toRead; + int extra = (int) (inBytes - csPtr->toRead); + /* Note that going with int for extra assumes that inBytes is not too + * much over toRead to require a wide itself. If that gets violated + * then the calculations involving extra must be made wide too. + * + * Noted with Win32/MSVC debug build treating the warning (possible of + * data in int64 to int conversion) as error. + */ bufPtr = AllocChannelBuffer(extra); -- cgit v0.12 From 14959b85abb4ba74717fcef5bac22d502690e66b Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 12 Aug 2014 15:28:09 +0000 Subject: Accommodate the "udp" package, and any other Tcl package that expects a [read] on a channel @ EOF to attempt another pass through the channel drivers instead of immediately returning an empty string. Correcting this misbehavior appears too disruptive in a patch release to a long stable branch. --- generic/tclIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index ed40e0d..afffeb8 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -5209,7 +5209,7 @@ DoReadChars( } /* Must clear the BLOCKED flag here since we check before reading */ - ResetFlag(statePtr, CHANNEL_BLOCKED); + ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF); for (copied = 0; (unsigned) toRead > 0; ) { copiedNow = -1; if (statePtr->inQueueHead != NULL) { -- cgit v0.12