summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine_unix.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-08-03 17:38:06 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-08-04 22:50:10 +0200
commit861feef2bfd879f4cb62ca67cff42314b355e03a (patch)
treee22f798ca5f6689141b5ce2f432b48db4baff7b4 /src/corelib/io/qfsfileengine_unix.cpp
parentc99849d0bc72df31ffde26c9ebffbf152cfcaeae (diff)
QFsFileEngine (Unix): replace a QPair with a proper struct
The comments in the declaration of the pair screamed "I want to be a struct with properly-named member variables", and the code that read it->first and it->second was really misleading to STL-aware readers. Fix by defining a small struct with member names taken from unmap()'s use of the pair's fields. Change-Id: Ie18852a3147f65cf14cfc5a3bb633f7b3e78f5a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfsfileengine_unix.cpp')
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 0b3e401be8..484a60fb74 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -621,7 +621,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
access, sharemode, nativeHandle(), realOffset);
if (MAP_FAILED != mapAddress) {
uchar *address = extra + static_cast<uchar*>(mapAddress);
- maps[address] = QPair<int,size_t>(extra, realSize);
+ maps[address] = {extra, realSize};
return address;
}
@@ -652,8 +652,8 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
return false;
}
- uchar *start = ptr - it->first;
- size_t len = it->second;
+ uchar *start = ptr - it->start;
+ size_t len = it->length;
if (-1 == munmap(start, len)) {
q->setError(QFile::UnspecifiedError, qt_error_string(errno));
return false;