Userland: Cast unused BackgroundAction::construct() results to void

User code does not need to keep this alive, so casting to void is safe.
But maybe a bit weird.
This commit is contained in:
Sam Atkins 2021-12-02 11:47:21 +00:00 committed by Andreas Kling
parent 92f8514a85
commit d2024f04bd
7 changed files with 7 additions and 7 deletions

View file

@ -163,7 +163,7 @@ void FileProvider::build_filesystem_cache()
m_building_cache = true;
m_work_queue.enqueue("/");
Threading::BackgroundAction<int>::construct(
(void)Threading::BackgroundAction<int>::construct(
[this](auto&) {
String slash = "/";
auto timer = Core::ElapsedTimer::start_new();

View file

@ -30,7 +30,7 @@ bool MonitorWidget::set_wallpaper(String path)
if (!is_different_to_current_wallpaper_path(path))
return false;
Threading::BackgroundAction<ErrorOr<NonnullRefPtr<Gfx::Bitmap>>>::construct(
(void)Threading::BackgroundAction<ErrorOr<NonnullRefPtr<Gfx::Bitmap>>>::construct(
[path](auto&) -> ErrorOr<NonnullRefPtr<Gfx::Bitmap>> {
if (path.is_empty())
return Error::from_errno(ENOENT);

View file

@ -113,7 +113,7 @@ private:
void ThreadStackWidget::refresh()
{
Threading::BackgroundAction<Vector<Symbolication::Symbol>>::construct(
(void)Threading::BackgroundAction<Vector<Symbolication::Symbol>>::construct(
[pid = m_pid, tid = m_tid](auto&) {
return Symbolication::symbolicate_thread(pid, tid, Symbolication::IncludeSourcePosition::No);
},

View file

@ -37,7 +37,7 @@ ErrorOr<int> mode_server()
TRY(Core::System::pledge("stdio unix recvfd rpath"));
auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
IPC::new_client_connection<LanguageServers::Cpp::ClientConnection>(move(socket), 1);
(void)IPC::new_client_connection<LanguageServers::Cpp::ClientConnection>(move(socket), 1);
TRY(Core::System::pledge("stdio recvfd rpath"));
TRY(Core::System::unveil("/usr/include", "r"));

View file

@ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
TRY(Core::System::pledge("stdio unix rpath recvfd"));
auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
IPC::new_client_connection<LanguageServers::Shell::ClientConnection>(move(socket), 1);
(void)IPC::new_client_connection<LanguageServers::Shell::ClientConnection>(move(socket), 1);
TRY(Core::System::pledge("stdio rpath recvfd"));
TRY(Core::System::unveil("/etc/passwd", "r"));

View file

@ -649,7 +649,7 @@ bool FileSystemModel::fetch_thumbnail_for(Node const& node)
auto weak_this = make_weak_ptr();
Threading::BackgroundAction<ErrorOr<NonnullRefPtr<Gfx::Bitmap>>>::construct(
(void)Threading::BackgroundAction<ErrorOr<NonnullRefPtr<Gfx::Bitmap>>>::construct(
[path](auto&) {
return render_thumbnail(path);
},

View file

@ -807,7 +807,7 @@ bool Compositor::set_wallpaper_mode(const String& mode)
bool Compositor::set_wallpaper(const String& path, Function<void(bool)>&& callback)
{
Threading::BackgroundAction<ErrorOr<NonnullRefPtr<Gfx::Bitmap>>>::construct(
(void)Threading::BackgroundAction<ErrorOr<NonnullRefPtr<Gfx::Bitmap>>>::construct(
[path](auto&) {
return Gfx::Bitmap::try_load_from_file(path);
},