From 6afbdaef25af2139adfd0efccee243fd01bd926c Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sun, 14 Sep 2014 20:16:41 +0100 Subject: [PATCH] Add explicit narrowing cast for C++11 support This reflects the existing behaviour but in C++11 the implicit cast is no longer allowed. --- thirdparty/kdsingleapplicationguard/kdtoolsglobal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thirdparty/kdsingleapplicationguard/kdtoolsglobal.cpp b/thirdparty/kdsingleapplicationguard/kdtoolsglobal.cpp index b057614d7..e40ac48c6 100644 --- a/thirdparty/kdsingleapplicationguard/kdtoolsglobal.cpp +++ b/thirdparty/kdsingleapplicationguard/kdtoolsglobal.cpp @@ -21,12 +21,12 @@ namespace { static Version kdParseQtVersion( const char * const version ) { if ( !version || qstrlen( version ) < 5 || version[1] != '.' || version[3] != '.' || ( version[5] != 0 && version[5] != '.' && version[5] != '-' ) ) return Version(); // parse error - const Version result = { { version[0] - '0', version[2] - '0', version[4] - '0' } }; + const Version result = { { static_cast(version[0] - '0'), static_cast(version[2] - '0'), static_cast(version[4] - '0') } }; return result; } bool _kdCheckQtVersion_impl( int major, int minor, int patchlevel ) { static const Version actual = kdParseQtVersion( qVersion() ); // do this only once each run... - const Version requested = { { major, minor, patchlevel } }; + const Version requested = { { static_cast( major ), static_cast( minor ), static_cast( patchlevel ) } }; return actual >= requested; }