1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

Userland: Replace arc4random() with get_random<u32>()

This commit is contained in:
Jean-Baptiste Boric 2021-05-14 17:27:38 +02:00 committed by Andreas Kling
parent 5a0468c21f
commit 090936e424
8 changed files with 19 additions and 12 deletions

View file

@ -6,6 +6,7 @@
#include "ChessWidget.h"
#include "PromotionDialog.h"
#include <AK/Random.h>
#include <AK/String.h>
#include <LibCore/DateTime.h>
#include <LibCore/File.h>
@ -382,7 +383,7 @@ void ChessWidget::reset()
m_playback_move_number = 0;
m_board_playback = Chess::Board();
m_board = Chess::Board();
m_side = (arc4random() % 2) ? Chess::Color::White : Chess::Color::Black;
m_side = (get_random<u32>() % 2) ? Chess::Color::White : Chess::Color::Black;
m_drag_enabled = true;
input_engine_move();
update();