summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-10-16 12:22:26 +0200
committerLioncash <mathew1800@gmail.com>2020-10-16 12:22:29 +0200
commit36cfb234d5f867a59f102ac2ffd71dc1c669cf46 (patch)
tree9e0e54a038cca0500c07d4583d74be1b7430c34c
parentMerge pull request #4790 from lioncash/input-common (diff)
downloadyuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.tar
yuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.tar.gz
yuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.tar.bz2
yuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.tar.lz
yuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.tar.xz
yuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.tar.zst
yuzu-36cfb234d5f867a59f102ac2ffd71dc1c669cf46.zip
-rw-r--r--src/input_common/udp/client.cpp6
-rw-r--r--src/input_common/udp/client.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp
index bb109562c..e3dd8a4be 100644
--- a/src/input_common/udp/client.cpp
+++ b/src/input_common/udp/client.cpp
@@ -333,15 +333,15 @@ const std::array<Common::SPSCQueue<UDPPadStatus>, 4>& Client::GetPadQueue() cons
}
void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id,
- std::function<void()> success_callback,
- std::function<void()> failure_callback) {
+ const std::function<void()>& success_callback,
+ const std::function<void()>& failure_callback) {
std::thread([=] {
Common::Event success_event;
SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {},
[&](Response::PadData data) { success_event.Set(); }};
Socket socket{host, port, pad_index, client_id, std::move(callback)};
std::thread worker_thread{SocketLoop, &socket};
- bool result = success_event.WaitFor(std::chrono::seconds(8));
+ const bool result = success_event.WaitFor(std::chrono::seconds(8));
socket.Stop();
worker_thread.join();
if (result) {
diff --git a/src/input_common/udp/client.h b/src/input_common/udp/client.h
index 2491a03a2..747e0c0a2 100644
--- a/src/input_common/udp/client.h
+++ b/src/input_common/udp/client.h
@@ -150,7 +150,7 @@ private:
};
void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id,
- std::function<void()> success_callback,
- std::function<void()> failure_callback);
+ const std::function<void()>& success_callback,
+ const std::function<void()>& failure_callback);
} // namespace InputCommon::CemuhookUDP