diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2021-07-01 10:55:13 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-03 01:56:31 +0430 |
commit | 42d197cde74f1c6ab70164beb4f1963a127b416b (patch) | |
tree | c7d5762bf8dff43df9e7f3169dbadf23cf9f0ec6 /Kernel | |
parent | 3c6bdb8a6196d16fb90072ee9226cfa35eaf4470 (diff) | |
download | serenity-42d197cde74f1c6ab70164beb4f1963a127b416b.zip |
Kernel: Fix miscellaneous warnings when building with Clang
These small changes fix the remaining warnings that come up during
kernel compilation with Clang. These specific fixes were for benign
things: unused lambda captures and braces around scalar initializers.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Devices/HID/PS2KeyboardDevice.cpp | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/FileDescription.cpp | 2 | ||||
-rw-r--r-- | Kernel/Graphics/IntelNativeGraphicsAdapter.cpp | 2 | ||||
-rw-r--r-- | Kernel/TTY/TTY.cpp | 3 |
4 files changed, 4 insertions, 5 deletions
diff --git a/Kernel/Devices/HID/PS2KeyboardDevice.cpp b/Kernel/Devices/HID/PS2KeyboardDevice.cpp index 75e4145f04..636cfae76c 100644 --- a/Kernel/Devices/HID/PS2KeyboardDevice.cpp +++ b/Kernel/Devices/HID/PS2KeyboardDevice.cpp @@ -69,7 +69,7 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte) break; default: if ((m_modifiers & Mod_Alt) != 0 && ch >= 2 && ch <= ConsoleManagement::s_max_virtual_consoles + 1) { - g_io_work->queue([this, ch]() { + g_io_work->queue([ch]() { ConsoleManagement::the().switch_to(ch - 0x02); }); } diff --git a/Kernel/FileSystem/FileDescription.cpp b/Kernel/FileSystem/FileDescription.cpp index c8794b34c7..ad767c0be0 100644 --- a/Kernel/FileSystem/FileDescription.cpp +++ b/Kernel/FileSystem/FileDescription.cpp @@ -237,7 +237,7 @@ KResultOr<size_t> FileDescription::get_dir_entries(UserOrKernelBuffer& output_bu return true; }; - KResult result = VFS::the().traverse_directory_inode(*m_inode, [&flush_stream_to_output_buffer, &error, &remaining, &output_buffer, &stream, this](auto& entry) { + KResult result = VFS::the().traverse_directory_inode(*m_inode, [&flush_stream_to_output_buffer, &stream, this](auto& entry) { size_t serialized_size = sizeof(ino_t) + sizeof(u8) + sizeof(size_t) + sizeof(char) * entry.name.length(); if (serialized_size > stream.remaining()) { if (!flush_stream_to_output_buffer()) { diff --git a/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp b/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp index a84f67921b..af6b932865 100644 --- a/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp +++ b/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp @@ -26,7 +26,7 @@ static constexpr IntelNativeGraphicsAdapter::PLLMaxSettings G35Limits { }; static constexpr u16 supported_models[] { - { 0x29c2 }, // Intel G35 Adapter + 0x29c2, // Intel G35 Adapter }; static bool is_supported_model(u16 device_id) diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp index cda47ccfc2..96b3d7d869 100644 --- a/Kernel/TTY/TTY.cpp +++ b/Kernel/TTY/TTY.cpp @@ -48,7 +48,6 @@ KResultOr<size_t> TTY::read(FileDescription&, u64, UserOrKernelBuffer& buffer, s [[maybe_unused]] auto rc = Process::current()->send_signal(SIGTTIN, nullptr); return EINTR; } - if (m_input_buffer.size() < static_cast<size_t>(size)) size = m_input_buffer.size(); @@ -93,7 +92,7 @@ KResultOr<size_t> TTY::write(FileDescription&, u64, const UserOrKernelBuffer& bu u8 modified_data[num_chars * 2]; size_t modified_data_size = 0; for (size_t i = 0; i < buffer_bytes; ++i) { - process_output(data[i], [this, &modified_data, &modified_data_size](u8 out_ch) { + process_output(data[i], [&modified_data, &modified_data_size](u8 out_ch) { modified_data[modified_data_size++] = out_ch; }); } |