summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-08-12 15:47:20 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-08-12 15:47:20 (GMT)
commit161b13957be6938d14b413a3a7278044aa8e13c2 (patch)
treee970a18adeba91930f206d5a80584b274e169017 /generic
parent9d7f28ff98c500bef295ea58d08d09809a44644d (diff)
parent1626150ac74e5e33b084944dc3ff76e4fe1dcf92 (diff)
downloadtcl-161b13957be6938d14b413a3a7278044aa8e13c2.zip
tcl-161b13957be6938d14b413a3a7278044aa8e13c2.tar.gz
tcl-161b13957be6938d14b413a3a7278044aa8e13c2.tar.bz2
merge trunk
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c12
1 files 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);