1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:27:44 +00:00

Everywhere: Remove some redundant inline keywords

Functions defined inside class bodies (including static functions)
are implicitly inline, no need to type it out.
This commit is contained in:
Nico Weber 2023-01-04 12:19:27 -05:00 committed by Linus Groh
parent 5fa8068580
commit 0a3cc10bb6
7 changed files with 39 additions and 39 deletions

View file

@ -14,7 +14,7 @@ namespace Kernel {
class PerformanceManager { class PerformanceManager {
public: public:
inline static void add_process_created_event(Process& process) static void add_process_created_event(Process& process)
{ {
if (g_profiling_all_threads) { if (g_profiling_all_threads) {
VERIFY(g_global_perf_events); VERIFY(g_global_perf_events);
@ -22,14 +22,14 @@ public:
} }
} }
inline static void add_process_exec_event(Process& process) static void add_process_exec_event(Process& process)
{ {
if (auto* event_buffer = process.current_perf_events_buffer()) { if (auto* event_buffer = process.current_perf_events_buffer()) {
(void)event_buffer->add_process(process, ProcessEventType::Exec); (void)event_buffer->add_process(process, ProcessEventType::Exec);
} }
} }
inline static void add_process_exit_event(Process& process) static void add_process_exit_event(Process& process)
{ {
if (g_profiling_all_threads) { if (g_profiling_all_threads) {
VERIFY(g_global_perf_events); VERIFY(g_global_perf_events);
@ -38,7 +38,7 @@ public:
} }
} }
inline static void add_thread_created_event(Thread& thread) static void add_thread_created_event(Thread& thread)
{ {
if (thread.is_profiling_suppressed()) if (thread.is_profiling_suppressed())
return; return;
@ -47,7 +47,7 @@ public:
} }
} }
inline static void add_thread_exit_event(Thread& thread) static void add_thread_exit_event(Thread& thread)
{ {
// As an exception this doesn't check whether profiling is suppressed for // As an exception this doesn't check whether profiling is suppressed for
// the thread so we can record the thread_exit event anyway. // the thread so we can record the thread_exit event anyway.
@ -56,7 +56,7 @@ public:
} }
} }
inline static void add_cpu_sample_event(Thread& current_thread, RegisterState const& regs, u32 lost_time) static void add_cpu_sample_event(Thread& current_thread, RegisterState const& regs, u32 lost_time)
{ {
if (current_thread.is_profiling_suppressed()) if (current_thread.is_profiling_suppressed())
return; return;
@ -66,21 +66,21 @@ public:
} }
} }
inline static void add_mmap_perf_event(Process& current_process, Memory::Region const& region) static void add_mmap_perf_event(Process& current_process, Memory::Region const& region)
{ {
if (auto* event_buffer = current_process.current_perf_events_buffer()) { if (auto* event_buffer = current_process.current_perf_events_buffer()) {
[[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_MMAP, region.vaddr().get(), region.size(), region.name()); [[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_MMAP, region.vaddr().get(), region.size(), region.name());
} }
} }
inline static void add_unmap_perf_event(Process& current_process, Memory::VirtualRange const& region) static void add_unmap_perf_event(Process& current_process, Memory::VirtualRange const& region)
{ {
if (auto* event_buffer = current_process.current_perf_events_buffer()) { if (auto* event_buffer = current_process.current_perf_events_buffer()) {
[[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_MUNMAP, region.base().get(), region.size(), {}); [[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_MUNMAP, region.base().get(), region.size(), {});
} }
} }
inline static void add_context_switch_perf_event(Thread& current_thread, Thread& next_thread) static void add_context_switch_perf_event(Thread& current_thread, Thread& next_thread)
{ {
if (current_thread.is_profiling_suppressed()) if (current_thread.is_profiling_suppressed())
return; return;
@ -89,7 +89,7 @@ public:
} }
} }
inline static void add_kmalloc_perf_event(Thread& current_thread, size_t size, FlatPtr ptr) static void add_kmalloc_perf_event(Thread& current_thread, size_t size, FlatPtr ptr)
{ {
if (current_thread.is_profiling_suppressed()) if (current_thread.is_profiling_suppressed())
return; return;
@ -98,7 +98,7 @@ public:
} }
} }
inline static void add_kfree_perf_event(Thread& current_thread, size_t size, FlatPtr ptr) static void add_kfree_perf_event(Thread& current_thread, size_t size, FlatPtr ptr)
{ {
if (current_thread.is_profiling_suppressed()) if (current_thread.is_profiling_suppressed())
return; return;
@ -107,7 +107,7 @@ public:
} }
} }
inline static void add_page_fault_event(Thread& thread, RegisterState const& regs) static void add_page_fault_event(Thread& thread, RegisterState const& regs)
{ {
if (thread.is_profiling_suppressed()) if (thread.is_profiling_suppressed())
return; return;
@ -117,7 +117,7 @@ public:
} }
} }
inline static void add_syscall_event(Thread& thread, RegisterState const& regs) static void add_syscall_event(Thread& thread, RegisterState const& regs)
{ {
if (thread.is_profiling_suppressed()) if (thread.is_profiling_suppressed())
return; return;
@ -127,7 +127,7 @@ public:
} }
} }
inline static void add_read_event(Thread& thread, int fd, size_t size, OpenFileDescription const& file_description, u64 start_timestamp, ErrorOr<FlatPtr> result) static void add_read_event(Thread& thread, int fd, size_t size, OpenFileDescription const& file_description, u64 start_timestamp, ErrorOr<FlatPtr> result)
{ {
if (thread.is_profiling_suppressed()) if (thread.is_profiling_suppressed())
return; return;
@ -161,7 +161,7 @@ public:
[[maybe_unused]] auto rc = event_buffer->append(PERF_EVENT_READ, fd, size, {}, &thread, filepath_string_index, start_timestamp, result); // wrong arguments [[maybe_unused]] auto rc = event_buffer->append(PERF_EVENT_READ, fd, size, {}, &thread, filepath_string_index, start_timestamp, result); // wrong arguments
} }
inline static void timer_tick(RegisterState const& regs) static void timer_tick(RegisterState const& regs)
{ {
static Time last_wakeup; static Time last_wakeup;
auto now = kgettimeofday(); auto now = kgettimeofday();

View file

@ -162,14 +162,14 @@ public:
public: public:
class ProcessProcFSTraits; class ProcessProcFSTraits;
inline static Process& current() static Process& current()
{ {
auto* current_thread = Processor::current_thread(); auto* current_thread = Processor::current_thread();
VERIFY(current_thread); VERIFY(current_thread);
return current_thread->process(); return current_thread->process();
} }
inline static bool has_current() static bool has_current()
{ {
return Processor::current_thread() != nullptr; return Processor::current_thread() != nullptr;
} }

View file

@ -62,7 +62,7 @@ class Thread
friend struct ThreadReadyQueue; friend struct ThreadReadyQueue;
public: public:
inline static Thread* current() static Thread* current()
{ {
return Processor::current_thread(); return Processor::current_thread();
} }

View file

@ -63,16 +63,16 @@ public:
} }
#endif #endif
inline static DigestType hash(u8 const* data, size_t length) static DigestType hash(u8 const* data, size_t length)
{ {
MD5 md5; MD5 md5;
md5.update(data, length); md5.update(data, length);
return md5.digest(); return md5.digest();
} }
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); } static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); } static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
inline virtual void reset() override virtual void reset() override
{ {
m_A = MD5Constants::init_A; m_A = MD5Constants::init_A;
m_B = MD5Constants::init_B; m_B = MD5Constants::init_B;

View file

@ -42,15 +42,15 @@ public:
virtual DigestType digest() override; virtual DigestType digest() override;
virtual DigestType peek() override; virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length) static DigestType hash(u8 const* data, size_t length)
{ {
SHA1 sha; SHA1 sha;
sha.update(data, length); sha.update(data, length);
return sha.digest(); return sha.digest();
} }
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); } static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); } static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL #ifndef KERNEL
virtual DeprecatedString class_name() const override virtual DeprecatedString class_name() const override
@ -59,7 +59,7 @@ public:
} }
#endif #endif
inline virtual void reset() override virtual void reset() override
{ {
m_data_length = 0; m_data_length = 0;
m_bit_length = 0; m_bit_length = 0;

View file

@ -90,15 +90,15 @@ public:
virtual DigestType digest() override; virtual DigestType digest() override;
virtual DigestType peek() override; virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length) static DigestType hash(u8 const* data, size_t length)
{ {
SHA256 sha; SHA256 sha;
sha.update(data, length); sha.update(data, length);
return sha.digest(); return sha.digest();
} }
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); } static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); } static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL #ifndef KERNEL
virtual DeprecatedString class_name() const override virtual DeprecatedString class_name() const override
@ -107,7 +107,7 @@ public:
} }
#endif #endif
inline virtual void reset() override virtual void reset() override
{ {
m_data_length = 0; m_data_length = 0;
m_bit_length = 0; m_bit_length = 0;
@ -142,15 +142,15 @@ public:
virtual DigestType digest() override; virtual DigestType digest() override;
virtual DigestType peek() override; virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length) static DigestType hash(u8 const* data, size_t length)
{ {
SHA384 sha; SHA384 sha;
sha.update(data, length); sha.update(data, length);
return sha.digest(); return sha.digest();
} }
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); } static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); } static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL #ifndef KERNEL
virtual DeprecatedString class_name() const override virtual DeprecatedString class_name() const override
@ -159,7 +159,7 @@ public:
} }
#endif #endif
inline virtual void reset() override virtual void reset() override
{ {
m_data_length = 0; m_data_length = 0;
m_bit_length = 0; m_bit_length = 0;
@ -194,15 +194,15 @@ public:
virtual DigestType digest() override; virtual DigestType digest() override;
virtual DigestType peek() override; virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length) static DigestType hash(u8 const* data, size_t length)
{ {
SHA512 sha; SHA512 sha;
sha.update(data, length); sha.update(data, length);
return sha.digest(); return sha.digest();
} }
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); } static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); } static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL #ifndef KERNEL
virtual DeprecatedString class_name() const override virtual DeprecatedString class_name() const override
@ -211,7 +211,7 @@ public:
} }
#endif #endif
inline virtual void reset() override virtual void reset() override
{ {
m_data_length = 0; m_data_length = 0;
m_bit_length = 0; m_bit_length = 0;

View file

@ -120,7 +120,7 @@ struct PositionValue {
Bottom Bottom
}; };
inline static PositionValue center() static PositionValue center()
{ {
return PositionValue { HorizontalPreset::Center, VerticalPreset::Center }; return PositionValue { HorizontalPreset::Center, VerticalPreset::Center };
} }