From 86a79260ca77dddc25e6dc2023d24c070afb2831 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 25 Jun 2015 08:48:09 -0700 Subject: [PATCH] Fix change-of-sign warning with ICC strlen returns size_t, but -1 is obviously negative. qglobal.cpp(2261): warning #68: integer conversion resulted in a change of sign Change-Id: I255870833a024a36adf6ffff13eb05ce5b2b2595 Reviewed-by: Caroline Chao Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 9e19dd7f0f..0c3d309277 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2261,7 +2261,8 @@ static bool readEtcRedHatRelease(QUnixOSVersion &v) int releaseIndex = line.indexOf(keyword); v.productType = QString::fromLatin1(line.mid(0, releaseIndex)).remove(QLatin1Char(' ')); int spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword)); - v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword), spaceIndex > -1 ? spaceIndex - releaseIndex - strlen(keyword) : -1)); + v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword), + spaceIndex > -1 ? spaceIndex - releaseIndex - int(strlen(keyword)) : -1)); return true; }