Fix cast warning.
--HG-- branch : release
This commit is contained in:
parent
7af7adceab
commit
8289209724
|
@ -239,7 +239,8 @@ private:
|
||||||
static qreal Rnd ( qreal v )
|
static qreal Rnd ( qreal v )
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||||
return static_cast<qreal>( ( 1 + ( v * QRandomGenerator().bounded(RAND_MAX) / ( RAND_MAX + 1.0 ) ) ) );
|
return static_cast<qreal>( ( 1 + ( v * QRandomGenerator().bounded(static_cast<qreal>(RAND_MAX)) /
|
||||||
|
( RAND_MAX + 1.0 ) ) ) );
|
||||||
#else
|
#else
|
||||||
// cppcheck-suppress qrandCalled
|
// cppcheck-suppress qrandCalled
|
||||||
return static_cast<qreal>( ( 1 + ( v * qrand() / ( RAND_MAX + 1.0 ) ) ) );
|
return static_cast<qreal>( ( 1 + ( v * qrand() / ( RAND_MAX + 1.0 ) ) ) );
|
||||||
|
@ -249,7 +250,8 @@ private:
|
||||||
static qreal RndWithString ( const char_type* )
|
static qreal RndWithString ( const char_type* )
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||||
return static_cast<qreal>( ( 1 + ( 1000.0f * QRandomGenerator().bounded(RAND_MAX) / ( RAND_MAX + 1.0 ) ) ) );
|
return static_cast<qreal>( ( 1 + ( 1000.0f * QRandomGenerator().bounded(static_cast<qreal>(RAND_MAX)) /
|
||||||
|
( RAND_MAX + 1.0 ) ) ) );
|
||||||
#else
|
#else
|
||||||
// cppcheck-suppress qrandCalled
|
// cppcheck-suppress qrandCalled
|
||||||
return static_cast<qreal>( ( 1 + ( 1000.0f * static_cast<qreal>(qrand()) / ( RAND_MAX + 1.0 ) ) ) );
|
return static_cast<qreal>( ( 1 + ( 1000.0f * static_cast<qreal>(qrand()) / ( RAND_MAX + 1.0 ) ) ) );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user