From 92f8514a854233b9b533096006641d57a91d099a Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 2 Dec 2021 11:17:35 +0000 Subject: [PATCH] Services: Cast unused IPC::new_client_connection() results to void These ones all manage their storage internally, whereas the WebContent and ImageDecoder ones require the caller to manage their lifetime. This distinction is not obvious to the user without looking through the code, so an API that makes this clearer would be nice. --- Userland/Services/AudioServer/main.cpp | 2 +- Userland/Services/Clipboard/main.cpp | 2 +- Userland/Services/ConfigServer/main.cpp | 2 +- Userland/Services/FileSystemAccessServer/main.cpp | 2 +- Userland/Services/InspectorServer/main.cpp | 2 +- Userland/Services/LaunchServer/main.cpp | 2 +- Userland/Services/LookupServer/LookupServer.cpp | 2 +- Userland/Services/NotificationServer/main.cpp | 2 +- Userland/Services/RequestServer/main.cpp | 2 +- Userland/Services/SQLServer/main.cpp | 2 +- Userland/Services/WebSocket/main.cpp | 2 +- Userland/Services/WindowServer/EventLoop.cpp | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Userland/Services/AudioServer/main.cpp b/Userland/Services/AudioServer/main.cpp index e3a89fb5ce..72593f9d97 100644 --- a/Userland/Services/AudioServer/main.cpp +++ b/Userland/Services/AudioServer/main.cpp @@ -29,7 +29,7 @@ ErrorOr serenity_main(Main::Arguments) server->on_accept = [&](NonnullRefPtr client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id, *mixer); + (void)IPC::new_client_connection(move(client_socket), client_id, *mixer); }; TRY(Core::System::pledge("stdio recvfd thread accept cpath rpath wpath")); diff --git a/Userland/Services/Clipboard/main.cpp b/Userland/Services/Clipboard/main.cpp index 1d97ca9b1e..5e95d376b0 100644 --- a/Userland/Services/Clipboard/main.cpp +++ b/Userland/Services/Clipboard/main.cpp @@ -25,7 +25,7 @@ ErrorOr serenity_main(Main::Arguments) server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; Clipboard::Storage::the().on_content_change = [&] { diff --git a/Userland/Services/ConfigServer/main.cpp b/Userland/Services/ConfigServer/main.cpp index 3c4609e004..65bbab3ae1 100644 --- a/Userland/Services/ConfigServer/main.cpp +++ b/Userland/Services/ConfigServer/main.cpp @@ -24,7 +24,7 @@ ErrorOr serenity_main(Main::Arguments) server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; return event_loop.exec(); diff --git a/Userland/Services/FileSystemAccessServer/main.cpp b/Userland/Services/FileSystemAccessServer/main.cpp index 68ea1730ef..9136fc0fc2 100644 --- a/Userland/Services/FileSystemAccessServer/main.cpp +++ b/Userland/Services/FileSystemAccessServer/main.cpp @@ -19,6 +19,6 @@ ErrorOr serenity_main(Main::Arguments) app->set_quit_when_last_window_deleted(false); auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server()); - IPC::new_client_connection(move(socket), 1); + (void)IPC::new_client_connection(move(socket), 1); return app->exec(); } diff --git a/Userland/Services/InspectorServer/main.cpp b/Userland/Services/InspectorServer/main.cpp index 9ed33c1b03..79d7f0fe60 100644 --- a/Userland/Services/InspectorServer/main.cpp +++ b/Userland/Services/InspectorServer/main.cpp @@ -24,7 +24,7 @@ ErrorOr serenity_main(Main::Arguments) server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; auto inspectables_server = TRY(Core::LocalServer::try_create()); diff --git a/Userland/Services/LaunchServer/main.cpp b/Userland/Services/LaunchServer/main.cpp index 7d25a4ee3e..23afe66cf5 100644 --- a/Userland/Services/LaunchServer/main.cpp +++ b/Userland/Services/LaunchServer/main.cpp @@ -32,7 +32,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; return event_loop.exec(); diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp index 3147e2c362..8d5f02163a 100644 --- a/Userland/Services/LookupServer/LookupServer.cpp +++ b/Userland/Services/LookupServer/LookupServer.cpp @@ -76,7 +76,7 @@ LookupServer::LookupServer() m_local_server->on_accept = [](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; bool ok = m_local_server->take_over_from_system_server(); VERIFY(ok); diff --git a/Userland/Services/NotificationServer/main.cpp b/Userland/Services/NotificationServer/main.cpp index 5980d95192..7a3182166e 100644 --- a/Userland/Services/NotificationServer/main.cpp +++ b/Userland/Services/NotificationServer/main.cpp @@ -23,7 +23,7 @@ ErrorOr serenity_main(Main::Arguments arguments) server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; TRY(Core::System::unveil("/res", "r")); diff --git a/Userland/Services/RequestServer/main.cpp b/Userland/Services/RequestServer/main.cpp index 02c0474ddd..a97f26bc9b 100644 --- a/Userland/Services/RequestServer/main.cpp +++ b/Userland/Services/RequestServer/main.cpp @@ -37,7 +37,7 @@ ErrorOr serenity_main(Main::Arguments) [[maybe_unused]] auto https = make(); auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server()); - IPC::new_client_connection(move(socket), 1); + (void)IPC::new_client_connection(move(socket), 1); auto result = event_loop.exec(); // FIXME: We exit instead of returning, so that protocol destructors don't get called. diff --git a/Userland/Services/SQLServer/main.cpp b/Userland/Services/SQLServer/main.cpp index 353e2ceab7..df3b03a287 100644 --- a/Userland/Services/SQLServer/main.cpp +++ b/Userland/Services/SQLServer/main.cpp @@ -40,7 +40,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(client_socket, client_id); + (void)IPC::new_client_connection(client_socket, client_id); }; return event_loop.exec(); diff --git a/Userland/Services/WebSocket/main.cpp b/Userland/Services/WebSocket/main.cpp index c65eada58a..9c29622fc2 100644 --- a/Userland/Services/WebSocket/main.cpp +++ b/Userland/Services/WebSocket/main.cpp @@ -26,6 +26,6 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::unveil(nullptr, nullptr)); auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server()); - IPC::new_client_connection(move(socket), 1); + (void)IPC::new_client_connection(move(socket), 1); return event_loop.exec(); } diff --git a/Userland/Services/WindowServer/EventLoop.cpp b/Userland/Services/WindowServer/EventLoop.cpp index 1986695963..7f9c21c63d 100644 --- a/Userland/Services/WindowServer/EventLoop.cpp +++ b/Userland/Services/WindowServer/EventLoop.cpp @@ -33,13 +33,13 @@ EventLoop::EventLoop() m_window_server->on_accept = [&](auto client_socket) { static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(move(client_socket), client_id); + (void)IPC::new_client_connection(move(client_socket), client_id); }; m_wm_server->on_accept = [&](auto client_socket) { static int s_next_wm_id = 0; int wm_id = ++s_next_wm_id; - IPC::new_client_connection(move(client_socket), wm_id); + (void)IPC::new_client_connection(move(client_socket), wm_id); }; if (m_keyboard_fd >= 0) {