mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Fix warning: implicit conversion from 'int' to 'float'
changes value from 2147483647 to 2147483648 /* The largest number rand will return (same as INT_MAX). */ #define RAND_MAX 2147483647 (static_cast<float>(quint32) / int * 8) why cast an int to a float to then divide by an int? just divide the int by an int.
This commit is contained in:
@@ -113,7 +113,7 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
|
||||
#pragma message("@TODO remove code for QT 5.10 or later")
|
||||
#endif
|
||||
quint32 value = QRandomGenerator::global()->generate();
|
||||
QThread::sleep( 8 + static_cast <unsigned long>( static_cast <float>( value ) / RAND_MAX * 10 ) );
|
||||
QThread::sleep(8 + static_cast<unsigned long>(value / RAND_MAX * 10));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user