D26201: Port away from KRandom
Parker Coates <[email protected]>
| Newsgroups | gmane.comp.kde.devel.games |
|---|---|
| Message-ID | <[email protected]> |
coates added inline comments. INLINE COMMENTS > mainwindow.cpp:411 > + const auto seed = QRandomGenerator::global()->generate(); > + const int signed_seed = (int)(seed & (~(((quint32)1) << 31))); > + startNew(signed_seed); Personally, I think the following would be more readable, but at minimum a comment explaining the bit fiddling would be appropriate. const int gameNumber = int(QRandomGenerator::global()->bounded(quint32(0), quint32(INT_MAX) + 1)); startNew(gameNumber); REPOSITORY R410 KPatience REVISION DETAIL https://phabricator.kde.org/D26201 To: nicolasfella, #kde_games, shlomif Cc: coates, shlomif, kde-games-devel