1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 06:14:58 +00:00

Libraries: Use default constructors/destructors in LibVT

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
This commit is contained in:
Lenny Maiorani 2022-03-04 13:27:47 -07:00 committed by Andreas Kling
parent a53c00f1df
commit 8b334248e4
8 changed files with 14 additions and 21 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, the SerenityOS developers.
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -16,10 +16,6 @@ EscapeSequenceParser::EscapeSequenceParser(EscapeSequenceExecutor& executor)
{
}
EscapeSequenceParser::~EscapeSequenceParser()
{
}
Vector<EscapeSequenceParser::OscParameter> EscapeSequenceParser::osc_parameters() const
{
VERIFY(m_osc_raw.size() >= m_osc_parameter_indexes.last());

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, the SerenityOS developers.
* Copyright (c) 2021-2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -17,7 +17,7 @@
namespace VT {
class EscapeSequenceExecutor {
public:
virtual ~EscapeSequenceExecutor() { }
virtual ~EscapeSequenceExecutor() = default;
using Parameters = Span<const unsigned>;
using Intermediates = Span<const u8>;
@ -37,7 +37,7 @@ public:
class EscapeSequenceParser {
public:
explicit EscapeSequenceParser(EscapeSequenceExecutor&);
~EscapeSequenceParser();
~EscapeSequenceParser() = default;
ALWAYS_INLINE void on_input(u8 byte)
{

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -13,10 +14,6 @@ Line::Line(size_t length)
set_length(length);
}
Line::~Line()
{
}
void Line::rewrap(size_t new_length, Line* next_line, CursorPosition* cursor, bool cursor_is_on_next_line)
{
size_t old_length = length();

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -21,7 +22,7 @@ class Line {
public:
explicit Line(size_t length);
~Line();
~Line() = default;
struct Cell {
u32 code_point { ' ' };

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, the SerenityOS developers.
* Copyright (c) 2020-2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -12,7 +12,7 @@ namespace VT {
class Range {
public:
Range() { }
Range() = default;
Range(const VT::Position& start, const VT::Position& end)
: m_start(start)
, m_end(end)

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Daniel Bertalan <dani@danielbertalan.dev>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -45,7 +46,7 @@ enum CursorKeysMode {
class TerminalClient {
public:
virtual ~TerminalClient() { }
virtual ~TerminalClient() = default;
virtual void beep() = 0;
virtual void set_window_title(StringView) = 0;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -149,10 +150,6 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy)
set_color_scheme(Config::read_string("Terminal", "Window", "ColorScheme", "Default"));
}
TerminalWidget::~TerminalWidget()
{
}
Gfx::IntRect TerminalWidget::glyph_rect(u16 row, u16 column)
{
int y = row * m_line_height;

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -27,7 +28,7 @@ class TerminalWidget final
C_OBJECT(TerminalWidget);
public:
virtual ~TerminalWidget() override;
virtual ~TerminalWidget() override = default;
void set_pty_master_fd(int fd);
void inject_string(StringView string)