mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
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:
parent
c67c1b583a
commit
92f8514a85
12 changed files with 13 additions and 13 deletions
|
@ -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"));
|
||||
|
|
|
@ -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 = [&] {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue