diff options
author | andreask <andreask> | 2014-08-06 18:20:56 (GMT) |
---|---|---|
committer | andreask <andreask> | 2014-08-06 18:20:56 (GMT) |
commit | 582c164dc34e3ea0ca7eaa231b6d996f92c54b7e (patch) | |
tree | c694207f6ee37f2414578816b4baa9c0106cea9f /generic/tclIO.c | |
parent | 87724ab09f84dbc2c891b4b23a0ab287a1d3b724 (diff) | |
download | tcl-582c164dc34e3ea0ca7eaa231b6d996f92c54b7e.zip tcl-582c164dc34e3ea0ca7eaa231b6d996f92c54b7e.tar.gz tcl-582c164dc34e3ea0ca7eaa231b6d996f92c54b7e.tar.bz2 |
Fixed type conversion warnings which break a Win32 debug build (MSVC).
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 12 |
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); |