From 82892097240739f59b704458f3f1736714cac64a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 6 Jan 2020 20:11:23 +0200 Subject: [PATCH] Fix cast warning. --HG-- branch : release --- src/libs/qmuparser/qmuparsertest.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/qmuparser/qmuparsertest.h b/src/libs/qmuparser/qmuparsertest.h index af7e1e751..5041af96a 100644 --- a/src/libs/qmuparser/qmuparsertest.h +++ b/src/libs/qmuparser/qmuparsertest.h @@ -239,7 +239,8 @@ private: static qreal Rnd ( qreal v ) { #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) - return static_cast( ( 1 + ( v * QRandomGenerator().bounded(RAND_MAX) / ( RAND_MAX + 1.0 ) ) ) ); + return static_cast( ( 1 + ( v * QRandomGenerator().bounded(static_cast(RAND_MAX)) / + ( RAND_MAX + 1.0 ) ) ) ); #else // cppcheck-suppress qrandCalled return static_cast( ( 1 + ( v * qrand() / ( RAND_MAX + 1.0 ) ) ) ); @@ -249,7 +250,8 @@ private: static qreal RndWithString ( const char_type* ) { #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) - return static_cast( ( 1 + ( 1000.0f * QRandomGenerator().bounded(RAND_MAX) / ( RAND_MAX + 1.0 ) ) ) ); + return static_cast( ( 1 + ( 1000.0f * QRandomGenerator().bounded(static_cast(RAND_MAX)) / + ( RAND_MAX + 1.0 ) ) ) ); #else // cppcheck-suppress qrandCalled return static_cast( ( 1 + ( 1000.0f * static_cast(qrand()) / ( RAND_MAX + 1.0 ) ) ) );