summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@noemail.net>2003-12-13 02:07:05 (GMT)
committerdavygrvy <davygrvy@noemail.net>2003-12-13 02:07:05 (GMT)
commit0c8e286ccda910643426e5933244de086185d6d1 (patch)
treed93c7e8878483c4ca41366894edd2cccb78678d2
parentb534db2dcbce0e10439d1c38d445693cd4515861 (diff)
downloadtcl-0c8e286ccda910643426e5933244de086185d6d1.zip
tcl-0c8e286ccda910643426e5933244de086185d6d1.tar.gz
tcl-0c8e286ccda910643426e5933244de086185d6d1.tar.bz2
Win32's SetFilePointer() takes LONGs not DWORDs. Redid local vars
to avoid all casting except where truly required. FossilOrigin-Name: 8ee1137fac535671486639958170fe10b91339a4
-rw-r--r--win/tclWinChan.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index c6640f1..adfbaf7 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinChan.c,v 1.30 2003/01/26 05:59:38 mdejong Exp $
+ * RCS: @(#) $Id: tclWinChan.c,v 1.31 2003/12/13 02:07:05 davygrvy Exp $
*/
#include "tclWinInt.h"
@@ -445,8 +445,8 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
{
FileInfo *infoPtr = (FileInfo *) instanceData;
DWORD moveMethod;
- DWORD newPos, newPosHigh;
- DWORD oldPos, oldPosHigh;
+ LONG newPos, newPosHigh;
+ LONG oldPos, oldPosHigh;
*errorCodePtr = 0;
if (mode == SEEK_SET) {
@@ -460,8 +460,8 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
/*
* Save our current place in case we need to roll-back the seek.
*/
- oldPosHigh = (DWORD)0;
- oldPos = SetFilePointer(infoPtr->handle, (LONG)0, &oldPosHigh,
+ oldPosHigh = 0;
+ oldPos = SetFilePointer(infoPtr->handle, 0, &oldPosHigh,
FILE_CURRENT);
if (oldPos == INVALID_SET_FILE_POINTER) {
DWORD winError = GetLastError();
@@ -472,8 +472,8 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
}
}
- newPosHigh = (DWORD)(offset < 0 ? -1 : 0);
- newPos = SetFilePointer(infoPtr->handle, (LONG) offset, &newPosHigh,
+ newPosHigh = (offset < 0 ? -1 : 0);
+ newPos = SetFilePointer(infoPtr->handle, offset, &newPosHigh,
moveMethod);
if (newPos == INVALID_SET_FILE_POINTER) {
DWORD winError = GetLastError();
@@ -489,7 +489,7 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
*/
if (newPosHigh != 0) {
*errorCodePtr = EOVERFLOW;
- SetFilePointer(infoPtr->handle, (LONG)oldPos, &oldPosHigh, FILE_BEGIN);
+ SetFilePointer(infoPtr->handle, oldPos, &oldPosHigh, FILE_BEGIN);
return -1;
}
return (int) newPos;
@@ -522,7 +522,7 @@ FileWideSeekProc(instanceData, offset, mode, errorCodePtr)
{
FileInfo *infoPtr = (FileInfo *) instanceData;
DWORD moveMethod;
- DWORD newPos, newPosHigh;
+ LONG newPos, newPosHigh;
*errorCodePtr = 0;
if (mode == SEEK_SET) {
@@ -533,8 +533,8 @@ FileWideSeekProc(instanceData, offset, mode, errorCodePtr)
moveMethod = FILE_END;
}
- newPosHigh = (DWORD)(offset >> 32);
- newPos = SetFilePointer(infoPtr->handle, (LONG) offset, &newPosHigh,
+ newPosHigh = (LONG)(offset >> 32);
+ newPos = SetFilePointer(infoPtr->handle, Tcl_WideAsLong(offset), &newPosHigh,
moveMethod);
if (newPos == INVALID_SET_FILE_POINTER) {
DWORD winError = GetLastError();