Selaa lähdekoodia

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.
Sam Atkins 3 vuotta sitten
vanhempi
commit
92f8514a85

+ 1 - 1
Userland/Services/AudioServer/main.cpp

@@ -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"));

+ 1 - 1
Userland/Services/Clipboard/main.cpp

@@ -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 = [&] {

+ 1 - 1
Userland/Services/ConfigServer/main.cpp

@@ -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();

+ 1 - 1
Userland/Services/FileSystemAccessServer/main.cpp

@@ -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();
 }

+ 1 - 1
Userland/Services/InspectorServer/main.cpp

@@ -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());

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

+ 1 - 1
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<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);

+ 1 - 1
Userland/Services/NotificationServer/main.cpp

@@ -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"));

+ 1 - 1
Userland/Services/RequestServer/main.cpp

@@ -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.

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

+ 1 - 1
Userland/Services/WebSocket/main.cpp

@@ -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();
 }

+ 2 - 2
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<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) {