diff options
| author | 2020-10-16 06:23:48 -0400 | |
|---|---|---|
| committer | 2020-10-16 06:23:51 -0400 | |
| commit | 30b1e71066b59304af452af65d73b6b8cbf76929 (patch) | |
| tree | 250b1712e0d426636a59ddb0000eaa7dabed5da5 /src | |
| parent | udp/client: Take std::function by const reference with TestCommunication() (diff) | |
| download | yuzu-30b1e71066b59304af452af65d73b6b8cbf76929.tar.gz yuzu-30b1e71066b59304af452af65d73b6b8cbf76929.tar.xz yuzu-30b1e71066b59304af452af65d73b6b8cbf76929.zip | |
udp/client: Make use of designated initializers in TestCommunication()
Same behavior, but makes the callback list nicer to look at.
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/udp/client.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index e3dd8a4be..7039d6fc3 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -337,8 +337,11 @@ void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, | |||
| 337 | const std::function<void()>& failure_callback) { | 337 | const std::function<void()>& failure_callback) { |
| 338 | std::thread([=] { | 338 | std::thread([=] { |
| 339 | Common::Event success_event; | 339 | Common::Event success_event; |
| 340 | SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {}, | 340 | SocketCallback callback{ |
| 341 | [&](Response::PadData data) { success_event.Set(); }}; | 341 | .version = [](Response::Version) {}, |
| 342 | .port_info = [](Response::PortInfo) {}, | ||
| 343 | .pad_data = [&](Response::PadData) { success_event.Set(); }, | ||
| 344 | }; | ||
| 342 | Socket socket{host, port, pad_index, client_id, std::move(callback)}; | 345 | Socket socket{host, port, pad_index, client_id, std::move(callback)}; |
| 343 | std::thread worker_thread{SocketLoop, &socket}; | 346 | std::thread worker_thread{SocketLoop, &socket}; |
| 344 | const bool result = success_event.WaitFor(std::chrono::seconds(8)); | 347 | const bool result = success_event.WaitFor(std::chrono::seconds(8)); |