diff options
| author | 2022-02-10 21:52:13 -0700 | |
|---|---|---|
| committer | 2022-02-10 21:52:13 -0700 | |
| commit | ca9da569ce8d5ce8106ff69afce484d9516570a8 (patch) | |
| tree | db8f98fcfcd3d3d77f77c52b3be696c073f90f6e /src/input_common/input_engine.h | |
| parent | Merge pull request #7861 from german77/user_features (diff) | |
| parent | common: uuid: Use sizeof(u64) instead of 8 in Hash() (diff) | |
| download | yuzu-ca9da569ce8d5ce8106ff69afce484d9516570a8.tar.gz yuzu-ca9da569ce8d5ce8106ff69afce484d9516570a8.tar.xz yuzu-ca9da569ce8d5ce8106ff69afce484d9516570a8.zip | |
Merge pull request #7852 from Morph1984/new-uuid
common: Revise and fix the UUID implementation
Diffstat (limited to 'src/input_common/input_engine.h')
| -rw-r--r-- | src/input_common/input_engine.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index fe2faee5a..c6c027aef 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | // Pad Identifier of data source | 17 | // Pad Identifier of data source |
| 18 | struct PadIdentifier { | 18 | struct PadIdentifier { |
| 19 | Common::UUID guid{Common::INVALID_UUID}; | 19 | Common::UUID guid{}; |
| 20 | std::size_t port{}; | 20 | std::size_t port{}; |
| 21 | std::size_t pad{}; | 21 | std::size_t pad{}; |
| 22 | 22 | ||
| @@ -59,7 +59,7 @@ namespace std { | |||
| 59 | template <> | 59 | template <> |
| 60 | struct hash<PadIdentifier> { | 60 | struct hash<PadIdentifier> { |
| 61 | size_t operator()(const PadIdentifier& pad_id) const noexcept { | 61 | size_t operator()(const PadIdentifier& pad_id) const noexcept { |
| 62 | u64 hash_value = pad_id.guid.uuid[1] ^ pad_id.guid.uuid[0]; | 62 | u64 hash_value = pad_id.guid.Hash(); |
| 63 | hash_value ^= (static_cast<u64>(pad_id.port) << 32); | 63 | hash_value ^= (static_cast<u64>(pad_id.port) << 32); |
| 64 | hash_value ^= static_cast<u64>(pad_id.pad); | 64 | hash_value ^= static_cast<u64>(pad_id.pad); |
| 65 | return static_cast<size_t>(hash_value); | 65 | return static_cast<size_t>(hash_value); |