Kernel: Make the VirtualConsole index const unsigned instead of unsigned

const:
The index should not be modified in the constructor to avoid unexpected
behavior
This commit is contained in:
Florian Angermeier 2020-07-15 02:08:10 +02:00 committed by Andreas Kling
parent df58ea808e
commit 971a42a816
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ void VirtualConsole::set_graphical(bool graphical)
m_graphical = graphical;
}
VirtualConsole::VirtualConsole(unsigned index)
VirtualConsole::VirtualConsole(const unsigned index)
: TTY(4, index)
, m_index(index)
, m_terminal(*this)

View file

@ -38,7 +38,7 @@ class VirtualConsole final : public TTY
, public VT::TerminalClient {
AK_MAKE_ETERNAL
public:
VirtualConsole(unsigned index);
VirtualConsole(const unsigned index);
virtual ~VirtualConsole() override;
static void switch_to(unsigned);