mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-12-01 09:30:55 +00:00
refactor: pairing flow, pairing tests, and inline struct comments (#5602)
This commit is contained in:
1 parent
41c25716cb
commit
aa92000dc6
15 files changed
+535
-218
No files matched your search
+1
-2
@@ -1670,8 +1670,7 @@ namespace input {
|
||||
*/
|
||||
template<typename Packet>
|
||||
bool validate_fixed_input_packet(std::span<const std::uint8_t> packet, std::uint32_t declared_size) {
|
||||
constexpr auto expected_size = static_cast<std::uint32_t>(sizeof(Packet) - sizeof(std::uint32_t));
|
||||
if (declared_size != expected_size) {
|
||||
if (constexpr auto expected_size = static_cast<std::uint32_t>(sizeof(Packet) - sizeof(std::uint32_t)); declared_size != expected_size) {
|
||||
return false;
|
||||
}
|
||||
return packet.size() >= sizeof(Packet);
|
||||
|
||||
Reference in new issue
Block a user