diff options
author | Liang Qi <liang.qi@qt.io> | 2019-07-05 15:37:50 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-07-05 15:37:50 +0200 |
commit | deee7b7eced5b240e3161d655319dbaaf2f8965c (patch) | |
tree | 4ad6db0e97482c24f02f111cbfeec224535feb73 /src/corelib/global/qrandom.h | |
parent | bcd4b14026094d0077ad1069054676cc6da96251 (diff) | |
parent | 6ad08b9cad4efefc72e64deaa0b720a3aab0fa54 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
.qmake.conf
qmake/generators/makefile.cpp
Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
Diffstat (limited to 'src/corelib/global/qrandom.h')
-rw-r--r-- | src/corelib/global/qrandom.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h index 2f72528266..445b520c76 100644 --- a/src/corelib/global/qrandom.h +++ b/src/corelib/global/qrandom.h @@ -122,14 +122,16 @@ public: return quint32(value); } - int bounded(int highest) + quint32 bounded(quint32 lowest, quint32 highest) { - return int(bounded(quint32(highest))); + Q_ASSERT(highest > lowest); + return bounded(highest - lowest) + lowest; } - quint32 bounded(quint32 lowest, quint32 highest) + int bounded(int highest) { - return bounded(highest - lowest) + lowest; + Q_ASSERT(highest > 0); + return int(bounded(0U, quint32(highest))); } int bounded(int lowest, int highest) |