File 0003-Fix-some-warnings-found-by-QNX-s-compiler.patch of Package libqt5-qtbase.18897
From 8d006727daca1b8e9b58c26ce1cd282ba8621450 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Thu, 23 Mar 2017 15:18:00 -0700
Subject: [PATCH 3/5] Fix some warnings found by QNX's compiler
-Werror is now disabled for that compiler, but it doesn't hurt to fix.
io/qstandardpaths_unix.cpp:149:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
qtestcase.cpp:2330:31: error: narrowing conversion of '(ms / 1000)' from 'int' to '_Timet {aka unsigned int}' inside { } [-Werror=narrowing]
Change-Id: Id92f4a61915b49ddaee6fffd14aea2c1e686e8f2
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
(cherry picked from commit e19fda916aa92f8890199dc4b9d56884c55d0cd8)
---
src/corelib/io/qstandardpaths_unix.cpp | 2 +-
src/testlib/qtestcase.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 03ae524297..b1988aca22 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -111,7 +111,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
}
case RuntimeLocation:
{
- const uid_t myUid = geteuid();
+ const uint myUid = uint(geteuid());
// http://standards.freedesktop.org/basedir-spec/latest/
QFileInfo fileInfo;
QString xdgRuntimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR"));
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 876c573196..6909cf2580 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -3478,7 +3478,7 @@ void QTest::qSleep(int ms)
#elif defined(Q_OS_WIN)
Sleep(uint(ms));
#else
- struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
+ struct timespec ts = { time_t(ms / 1000), (ms % 1000) * 1000 * 1000 };
nanosleep(&ts, NULL);
#endif
}
--
2.25.1