diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-14 15:04:18 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-06-07 17:19:16 +0200 |
commit | b4ead572501179244aa036e7a590fa7536929f2b (patch) | |
tree | f1e706b221e78e294b3169965c005df768730203 /src/corelib/io/qfsfileengine.cpp | |
parent | 327bfdb671e0e263c6fb027133a54985a65194c4 (diff) |
Move away from using 0 as a pointer constant
Cleans up most of corelib to use nullptr or default enums
where appropriate.
Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfsfileengine.cpp')
-rw-r--r-- | src/corelib/io/qfsfileengine.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 387990ed79..0db27f3e25 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -127,7 +127,7 @@ void QFSFileEnginePrivate::init() is_link = 0; openMode = QIODevice::NotOpen; fd = -1; - fh = 0; + fh = nullptr; lastIOCommand = IOFlushCommand; lastFlushFailed = false; closeFileHandle = false; @@ -240,7 +240,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode) d->openMode = openMode; d->lastFlushFailed = false; d->tried_stat = 0; - d->fh = 0; + d->fh = nullptr; d->fd = -1; return d->nativeOpen(openMode); @@ -299,7 +299,7 @@ bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh) QSystemError::stdString()); this->openMode = QIODevice::NotOpen; - this->fh = 0; + this->fh = nullptr; return false; } @@ -328,7 +328,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd, QFile::FileHandle d->lastFlushFailed = false; d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle); d->fileEntry.clear(); - d->fh = 0; + d->fh = nullptr; d->fd = -1; d->tried_stat = 0; @@ -344,7 +344,7 @@ bool QFSFileEnginePrivate::openFd(QIODevice::OpenMode openMode, int fd) { Q_Q(QFSFileEngine); this->fd = fd; - fh = 0; + fh = nullptr; // Seek to the end when in Append mode. if (openMode & QFile::Append) { @@ -405,7 +405,7 @@ bool QFSFileEnginePrivate::closeFdFh() // We must reset these guys regardless; calling close again after a // failed close causes crashes on some systems. - fh = 0; + fh = nullptr; fd = -1; closed = (ret == 0); } @@ -822,7 +822,7 @@ QAbstractFileEngine::Iterator *QFSFileEngine::beginEntryList(QDir::Filters filte */ QAbstractFileEngine::Iterator *QFSFileEngine::endEntryList() { - return 0; + return nullptr; } #endif // QT_NO_FILESYSTEMITERATOR @@ -870,7 +870,7 @@ bool QFSFileEngine::extension(Extension extension, const ExtensionOption *option const MapExtensionOption *options = (const MapExtensionOption*)(option); MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output); returnValue->address = d->map(options->offset, options->size, options->flags); - return (returnValue->address != 0); + return (returnValue->address != nullptr); } if (extension == UnMapExtension) { const UnMapExtensionOption *options = (const UnMapExtensionOption*)option; |