4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-14 11:29:33 +00:00

Migrate from qrand() to std::rand()

qrand() is deprecated since Qt 5.15.
This commit is contained in:
Tobias Junghans 2021-05-10 09:31:45 +02:00 committed by Albert Astals Cid
parent effbe387a0
commit 9443ba76ba
2 changed files with 4 additions and 4 deletions
plugins/qca-ossl
src

@ -6576,10 +6576,10 @@ public:
// seed the RNG if it's not seeded yet
if (RAND_status() == 0) {
qsrand(time(nullptr));
std::srand(time(nullptr));
char buf[128];
for (char &n : buf)
n = qrand();
n = std::rand();
RAND_seed(buf, 128);
}

@ -107,7 +107,7 @@ public:
{
SecureArray buf(size);
for (int n = 0; n < (int)buf.size(); ++n)
buf[n] = (char)qrand();
buf[n] = (char)std::rand();
return buf;
}
};
@ -1253,7 +1253,7 @@ public:
uint t = now.toSecsSinceEpoch();
if (now.time().msec() > 0)
t /= now.time().msec();
qsrand(t);
std::srand(t);
}
int version() const override