From bfe9bd808dd76b2776cb93b9bd058908af414857 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 6 Jan 2020 20:11:23 +0200 Subject: [PATCH] Fix cast warning. (grafted from f7b7f00f0f117582449259e974fc53182df958cb) --HG-- branch : develop --- 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 ) ) ) );