diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-02-28 14:42:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-28 18:09:12 +0100 |
commit | 860a3bbce342067069d4c7d2e4396a667ff324fe (patch) | |
tree | 8110f5d9a7293a4371205ffffd7c8717b8a29471 /Kernel/Net | |
parent | 2dea887e8fe43438cd5005820515fc21a1e4521c (diff) | |
download | serenity-860a3bbce342067069d4c7d2e4396a667ff324fe.zip |
Kernel: Use default con/de-structors
This may seem like a no-op change, however it shrinks down the Kernel by a bit:
.text -432
.unmap_after_init -60
.data -480
.debug_info -673
.debug_aranges 8
.debug_ranges -232
.debug_line -558
.debug_str -308
.debug_frame -40
With '= default', the compiler can do more inlining, hence the savings.
I intentionally omitted some opportunities for '= default', because they
would increase the Kernel size.
Diffstat (limited to 'Kernel/Net')
-rw-r--r-- | Kernel/Net/EthernetFrameHeader.h | 4 | ||||
-rw-r--r-- | Kernel/Net/ICMP.h | 4 | ||||
-rw-r--r-- | Kernel/Net/Socket.h | 2 | ||||
-rw-r--r-- | Kernel/Net/UDP.h | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/Kernel/Net/EthernetFrameHeader.h b/Kernel/Net/EthernetFrameHeader.h index 2fb8611f6f..6ce72978c0 100644 --- a/Kernel/Net/EthernetFrameHeader.h +++ b/Kernel/Net/EthernetFrameHeader.h @@ -33,8 +33,8 @@ class [[gnu::packed]] EthernetFrameHeader { public: - EthernetFrameHeader() { } - ~EthernetFrameHeader() { } + EthernetFrameHeader() = default; + ~EthernetFrameHeader() = default; MACAddress destination() const { return m_destination; } void set_destination(const MACAddress& address) { m_destination = address; } diff --git a/Kernel/Net/ICMP.h b/Kernel/Net/ICMP.h index bd598bd23d..a1de0c43c2 100644 --- a/Kernel/Net/ICMP.h +++ b/Kernel/Net/ICMP.h @@ -38,8 +38,8 @@ struct ICMPType { class [[gnu::packed]] ICMPHeader { public: - ICMPHeader() { } - ~ICMPHeader() { } + ICMPHeader() = default; + ~ICMPHeader() = default; u8 type() const { return m_type; } void set_type(u8 b) { m_type = b; } diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h index a4dfaa6d78..e0a53a6f99 100644 --- a/Kernel/Net/Socket.h +++ b/Kernel/Net/Socket.h @@ -180,7 +180,7 @@ private: template<typename SocketType> class SocketHandle { public: - SocketHandle() { } + SocketHandle() = default; SocketHandle(NonnullRefPtr<SocketType>&& socket) : m_socket(move(socket)) diff --git a/Kernel/Net/UDP.h b/Kernel/Net/UDP.h index abf1a6d40f..effe9a603b 100644 --- a/Kernel/Net/UDP.h +++ b/Kernel/Net/UDP.h @@ -32,8 +32,8 @@ namespace Kernel { class [[gnu::packed]] UDPPacket { public: - UDPPacket() { } - ~UDPPacket() { } + UDPPacket() = default; + ~UDPPacket() = default; u16 source_port() const { return m_source_port; } void set_source_port(u16 port) { m_source_port = port; } |