summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-02-26 10:34:11 -0700
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-03-10 18:04:26 -0800
commit271d82e23f315a0e0be13938f8a633cc257f85e2 (patch)
tree7c7b6b2a5f729121a53c86e0303bee1632cd8eea
parent8f20c3334b0fb36d099f2d7c60190e55956ace47 (diff)
downloadserenity-271d82e23f315a0e0be13938f8a633cc257f85e2.zip
Libraries: Use default constructors/destructors in LibELF
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."
-rw-r--r--Userland/Libraries/LibELF/DynamicObject.h3
-rw-r--r--Userland/Libraries/LibELF/Image.cpp5
-rw-r--r--Userland/Libraries/LibELF/Image.h3
3 files changed, 5 insertions, 6 deletions
diff --git a/Userland/Libraries/LibELF/DynamicObject.h b/Userland/Libraries/LibELF/DynamicObject.h
index 24fb27d785..19c277977c 100644
--- a/Userland/Libraries/LibELF/DynamicObject.h
+++ b/Userland/Libraries/LibELF/DynamicObject.h
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2019-2020, Andrew Kaster <akaster@serenityos.org>
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
+ * Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -107,7 +108,7 @@ public:
, m_name(name)
{
}
- ~Section() { }
+ ~Section() = default;
StringView name() const { return m_name; }
unsigned offset() const { return m_section_offset; }
diff --git a/Userland/Libraries/LibELF/Image.cpp b/Userland/Libraries/LibELF/Image.cpp
index 77e09277b7..e8e9a6f568 100644
--- a/Userland/Libraries/LibELF/Image.cpp
+++ b/Userland/Libraries/LibELF/Image.cpp
@@ -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
*/
@@ -30,10 +31,6 @@ Image::Image(const u8* buffer, size_t size, bool verbose_logging)
{
}
-Image::~Image()
-{
-}
-
StringView Image::section_index_to_string(unsigned index) const
{
VERIFY(m_valid);
diff --git a/Userland/Libraries/LibELF/Image.h b/Userland/Libraries/LibELF/Image.h
index f005a20f41..7811463cc5 100644
--- a/Userland/Libraries/LibELF/Image.h
+++ b/Userland/Libraries/LibELF/Image.h
@@ -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
*/
@@ -22,7 +23,7 @@ public:
explicit Image(ReadonlyBytes, bool verbose_logging = true);
explicit Image(const u8*, size_t, bool verbose_logging = true);
- ~Image();
+ ~Image() = default;
void dump() const;
bool is_valid() const { return m_valid; }
bool parse();