summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-07-14 12:13:58 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-07-14 12:18:24 (GMT)
commit9e00fcde7a13bb561aebaa5e84c94297089f0c7f (patch)
tree7437a22f9dce69c0dba8d17cfd23c2baa010931a /src
parentec823a0414ea1bb00fd52b0922ad50e4061fe660 (diff)
downloadQt-9e00fcde7a13bb561aebaa5e84c94297089f0c7f.zip
Qt-9e00fcde7a13bb561aebaa5e84c94297089f0c7f.tar.gz
Qt-9e00fcde7a13bb561aebaa5e84c94297089f0c7f.tar.bz2
micro optimization in qfsfileengine_win.cpp
Use the LARGE_INTEGER union properly and don't do unnessecary bit shifting. Reviewed-by: mauricek
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index ee49853..618566a 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -608,8 +608,7 @@ qint64 QFSFileEnginePrivate::nativePos() const
// This approach supports large files.
LARGE_INTEGER currentFilePos;
LARGE_INTEGER offset;
- offset.LowPart = 0;
- offset.HighPart = 0;
+ offset.QuadPart = 0;
if (!ptrSetFilePointerEx(fileHandle, offset, &currentFilePos, FILE_CURRENT)) {
thatQ->setError(QFile::UnspecifiedError, qt_error_string());
return 0;
@@ -652,8 +651,7 @@ bool QFSFileEnginePrivate::nativeSeek(qint64 pos)
// This approach supports large files.
LARGE_INTEGER currentFilePos;
LARGE_INTEGER offset;
- offset.LowPart = (unsigned int)(quint64(pos) & Q_UINT64_C(0xffffffff));
- offset.HighPart = (unsigned int)((quint64(pos) >> 32) & Q_UINT64_C(0xffffffff));
+ offset.QuadPart = pos;
if (ptrSetFilePointerEx(fileHandle, offset, &currentFilePos, FILE_BEGIN) == 0) {
thatQ->setError(QFile::UnspecifiedError, qt_error_string());
return false;