From 7421a0e88208a9afe0ab360a0646bf81a84d2290 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 5 Sep 2018 14:48:30 +0200 Subject: winrt platform plugin: Fix clang warnings Fixed warnings: - missing override specifier - 0 as nullptr constant - implicit change of signedness - non portable path to header file Change-Id: I6977bc561176ac7804ac01325b84c15ba849bbf2 Reviewed-by: Miguel Costa Reviewed-by: Andre de la Rocha Reviewed-by: Friedemann Kleint --- src/plugins/platforms/winrt/qwinrtfileengine.cpp | 25 ++++++++++-------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/plugins/platforms/winrt/qwinrtfileengine.cpp') diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.cpp b/src/plugins/platforms/winrt/qwinrtfileengine.cpp index 76efdf6cc8..3014b30c38 100644 --- a/src/plugins/platforms/winrt/qwinrtfileengine.cpp +++ b/src/plugins/platforms/winrt/qwinrtfileengine.cpp @@ -122,10 +122,6 @@ QWinRTFileEngineHandler::QWinRTFileEngineHandler() { } -QWinRTFileEngineHandler::~QWinRTFileEngineHandler() -{ -} - void QWinRTFileEngineHandler::registerFile(const QString &fileName, IStorageItem *file) { handlerInstance->d_func()->files.insert(QDir::cleanPath(fileName), file); @@ -168,7 +164,7 @@ static HRESULT getDestinationFolder(const QString &fileName, const QString &newF const QString newFilePath = QDir::toNativeSeparators(newFileInfo.absolutePath()); HStringReference nativeNewFilePath(reinterpret_cast(newFilePath.utf16()), - newFilePath.length()); + uint(newFilePath.length())); hr = folderFactory->GetFolderFromPathAsync(nativeNewFilePath.Get(), &op); } if (FAILED(hr)) @@ -181,10 +177,6 @@ QWinRTFileEngine::QWinRTFileEngine(const QString &fileName, IStorageItem *file) { } -QWinRTFileEngine::~QWinRTFileEngine() -{ -} - bool QWinRTFileEngine::open(QIODevice::OpenMode openMode) { Q_D(QWinRTFileEngine); @@ -278,7 +270,7 @@ bool QWinRTFileEngine::seek(qint64 pos) if (!d->stream) return false; - HRESULT hr = d->stream->Seek(pos); + HRESULT hr = d->stream->Seek(UINT64(pos)); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::PositionError, false); d->pos = pos; return SUCCEEDED(hr); @@ -311,7 +303,8 @@ bool QWinRTFileEngine::copy(const QString &newName) RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::CopyError, false); const QString destinationName = QFileInfo(newName).fileName(); - HStringReference nativeDestinationName(reinterpret_cast(destinationName.utf16()), destinationName.length()); + HStringReference nativeDestinationName(reinterpret_cast(destinationName.utf16()), + uint(destinationName.length())); ComPtr> op; hr = file->CopyOverloadDefaultOptions(destinationFolder.Get(), nativeDestinationName.Get(), &op); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::CopyError, false); @@ -332,7 +325,8 @@ bool QWinRTFileEngine::rename(const QString &newName) RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::RenameError, false); const QString destinationName = QFileInfo(newName).fileName(); - HStringReference nativeDestinationName(reinterpret_cast(destinationName.utf16()), destinationName.length()); + HStringReference nativeDestinationName(reinterpret_cast(destinationName.utf16()), + uint(destinationName.length())); ComPtr op; hr = d->file->RenameAsyncOverloadDefaultOptions(nativeDestinationName.Get(), &op); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::RenameError, false); @@ -349,7 +343,8 @@ bool QWinRTFileEngine::renameOverwrite(const QString &newName) RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::RenameError, false); const QString destinationName = QFileInfo(newName).fileName(); - HStringReference nativeDestinationName(reinterpret_cast(destinationName.utf16()), destinationName.length()); + HStringReference nativeDestinationName(reinterpret_cast(destinationName.utf16()), + uint(destinationName.length())); ComPtr op; hr = d->file->RenameAsync(nativeDestinationName.Get(), NameCollisionOption_ReplaceExisting, &op); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::RenameError, false); @@ -451,7 +446,7 @@ qint64 QWinRTFileEngine::read(char *data, qint64 maxlen) HRESULT hr = d->stream.As(&stream); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::ReadError, -1); - UINT32 length = qBound(quint64(0), quint64(maxlen), quint64(UINT_MAX)); + UINT32 length = UINT32(qBound(quint64(0), quint64(maxlen), quint64(UINT32_MAX))); ComPtr buffer; hr = d->bufferFactory->Create(length, &buffer); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::ReadError, -1); @@ -494,7 +489,7 @@ qint64 QWinRTFileEngine::write(const char *data, qint64 maxlen) HRESULT hr = d->stream.As(&stream); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::WriteError, -1); - UINT32 length = qBound(quint64(0), quint64(maxlen), quint64(UINT_MAX)); + UINT32 length = UINT32(qBound(quint64(0), quint64(maxlen), quint64(UINT_MAX))); ComPtr buffer; hr = d->bufferFactory->Create(length, &buffer); RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::WriteError, -1); -- cgit v1.2.3