minor improvements

This commit is contained in:
Max-Wilhelm Bruker 2009-04-08 21:49:16 +02:00
parent a429a4a004
commit 792a400a3d
30 changed files with 1022 additions and 829 deletions

View file

@ -1,18 +0,0 @@
#include "testrandom.h"
#include <QThread>
void TestRandom::init()
{
if (initialized)
return;
int seed = QDateTime::currentDateTime().toTime_t();
qDebug(QString("%1: qsrand(%2)").arg(thread()->metaObject()->className()).arg(seed).toLatin1());
qsrand(seed);
initialized = true;
}
unsigned int TestRandom::getNumber(unsigned int min, unsigned int max)
{
int r = qrand();
return min + (unsigned int) (((double) (max + 1 - min)) * r / (RAND_MAX + 1.0));
}