diff options
| author | 2021-09-24 08:02:11 -0400 | |
|---|---|---|
| committer | 2021-09-24 08:02:11 -0400 | |
| commit | c8512839d78249a441a354a4072779c982fd4305 (patch) | |
| tree | 7fa0f1fa088cc3c96903381967542317b5f914d7 /src/common | |
| parent | Merge pull request #7043 from astrelsky/cmake (diff) | |
| parent | core/profile_select: Avoid uninitialized read in SelectProfile() (diff) | |
| download | yuzu-c8512839d78249a441a354a4072779c982fd4305.tar.gz yuzu-c8512839d78249a441a354a4072779c982fd4305.tar.xz yuzu-c8512839d78249a441a354a4072779c982fd4305.zip | |
Merge pull request #7069 from lioncash/uuid
common/uuid: Add validity checking functions to interface
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/uuid.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h index 2353179d8..8ea01f8da 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h | |||
| @@ -58,6 +58,13 @@ struct UUID { | |||
| 58 | uuid = INVALID_UUID; | 58 | uuid = INVALID_UUID; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | [[nodiscard]] constexpr bool IsInvalid() const { | ||
| 62 | return uuid == INVALID_UUID; | ||
| 63 | } | ||
| 64 | [[nodiscard]] constexpr bool IsValid() const { | ||
| 65 | return !IsInvalid(); | ||
| 66 | } | ||
| 67 | |||
| 61 | // TODO(ogniK): Properly generate a Nintendo ID | 68 | // TODO(ogniK): Properly generate a Nintendo ID |
| 62 | [[nodiscard]] constexpr u64 GetNintendoID() const { | 69 | [[nodiscard]] constexpr u64 GetNintendoID() const { |
| 63 | return uuid[0]; | 70 | return uuid[0]; |