From 9e00fcde7a13bb561aebaa5e84c94297089f0c7f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 14 Jul 2009 14:13:58 +0200 Subject: micro optimization in qfsfileengine_win.cpp Use the LARGE_INTEGER union properly and don't do unnessecary bit shifting. Reviewed-by: mauricek --- src/corelib/io/qfsfileengine_win.cpp | 6 ++---- 1 file 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, ¤tFilePos, 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, ¤tFilePos, FILE_BEGIN) == 0) { thatQ->setError(QFile::UnspecifiedError, qt_error_string()); return false; -- cgit v0.12