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.
This commit is contained in:
Sam Atkins 2021-12-02 11:17:35 +00:00 committed by Andreas Kling
parent c67c1b583a
commit 92f8514a85
Notes: sideshowbarker 2024-07-17 23:09:26 +09:00
12 changed files with 13 additions and 13 deletions

View file

@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
server->on_accept = [&](NonnullRefPtr<Core::LocalSocket> client_socket) {
static int s_next_client_id = 0;
int client_id = ++s_next_client_id;
IPC::new_client_connection<AudioServer::ClientConnection>(move(client_socket), client_id, *mixer);
(void)IPC::new_client_connection<AudioServer::ClientConnection>(move(client_socket), client_id, *mixer);
};
TRY(Core::System::pledge("stdio recvfd thread accept cpath rpath wpath"));

View file

@ -25,7 +25,7 @@ ErrorOr<int> 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<Clipboard::ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<Clipboard::ClientConnection>(move(client_socket), client_id);
};
Clipboard::Storage::the().on_content_change = [&] {

View file

@ -24,7 +24,7 @@ ErrorOr<int> 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<ConfigServer::ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<ConfigServer::ClientConnection>(move(client_socket), client_id);
};
return event_loop.exec();

View file

@ -19,6 +19,6 @@ ErrorOr<int> 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<FileSystemAccessServer::ClientConnection>(move(socket), 1);
(void)IPC::new_client_connection<FileSystemAccessServer::ClientConnection>(move(socket), 1);
return app->exec();
}

View file

@ -24,7 +24,7 @@ ErrorOr<int> 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<InspectorServer::ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<InspectorServer::ClientConnection>(move(client_socket), client_id);
};
auto inspectables_server = TRY(Core::LocalServer::try_create());

View file

@ -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<LaunchServer::ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<LaunchServer::ClientConnection>(move(client_socket), client_id);
};
return event_loop.exec();

View file

@ -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<ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<ClientConnection>(move(client_socket), client_id);
};
bool ok = m_local_server->take_over_from_system_server();
VERIFY(ok);

View file

@ -23,7 +23,7 @@ ErrorOr<int> 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<NotificationServer::ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<NotificationServer::ClientConnection>(move(client_socket), client_id);
};
TRY(Core::System::unveil("/res", "r"));

View file

@ -37,7 +37,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
[[maybe_unused]] auto https = make<RequestServer::HttpsProtocol>();
auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
IPC::new_client_connection<RequestServer::ClientConnection>(move(socket), 1);
(void)IPC::new_client_connection<RequestServer::ClientConnection>(move(socket), 1);
auto result = event_loop.exec();
// FIXME: We exit instead of returning, so that protocol destructors don't get called.

View file

@ -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<SQLServer::ClientConnection>(client_socket, client_id);
(void)IPC::new_client_connection<SQLServer::ClientConnection>(client_socket, client_id);
};
return event_loop.exec();

View file

@ -26,6 +26,6 @@ ErrorOr<int> 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<WebSocket::ClientConnection>(move(socket), 1);
(void)IPC::new_client_connection<WebSocket::ClientConnection>(move(socket), 1);
return event_loop.exec();
}

View file

@ -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<ClientConnection>(move(client_socket), client_id);
(void)IPC::new_client_connection<ClientConnection>(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<WMClientConnection>(move(client_socket), wm_id);
(void)IPC::new_client_connection<WMClientConnection>(move(client_socket), wm_id);
};
if (m_keyboard_fd >= 0) {