diff options
| author | 2018-04-20 10:27:17 -0400 | |
|---|---|---|
| committer | 2018-04-20 10:27:17 -0400 | |
| commit | 87f89ac82dae33f7ce4cd6a3b5e492510e8cf961 (patch) | |
| tree | a1e11a7832f370b63a7c64ed3a409a5266fc47d3 /src | |
| parent | Merge pull request #368 from lioncash/dynarmic (diff) | |
| parent | common_types: Convert typedefs to using aliases (diff) | |
| download | yuzu-87f89ac82dae33f7ce4cd6a3b5e492510e8cf961.tar.gz yuzu-87f89ac82dae33f7ce4cd6a3b5e492510e8cf961.tar.xz yuzu-87f89ac82dae33f7ce4cd6a3b5e492510e8cf961.zip | |
Merge pull request #361 from lioncash/common
common_types: Minor changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/common_types.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/common/common_types.h b/src/common/common_types.h index 844d34965..6b1766dca 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h | |||
| @@ -27,29 +27,23 @@ | |||
| 27 | #include <array> | 27 | #include <array> |
| 28 | #include <cstdint> | 28 | #include <cstdint> |
| 29 | 29 | ||
| 30 | #ifdef _MSC_VER | 30 | using u8 = std::uint8_t; ///< 8-bit unsigned byte |
| 31 | #ifndef __func__ | 31 | using u16 = std::uint16_t; ///< 16-bit unsigned short |
| 32 | #define __func__ __FUNCTION__ | 32 | using u32 = std::uint32_t; ///< 32-bit unsigned word |
| 33 | #endif | 33 | using u64 = std::uint64_t; ///< 64-bit unsigned int |
| 34 | #endif | ||
| 35 | 34 | ||
| 36 | typedef std::uint8_t u8; ///< 8-bit unsigned byte | 35 | using s8 = std::int8_t; ///< 8-bit signed byte |
| 37 | typedef std::uint16_t u16; ///< 16-bit unsigned short | 36 | using s16 = std::int16_t; ///< 16-bit signed short |
| 38 | typedef std::uint32_t u32; ///< 32-bit unsigned word | 37 | using s32 = std::int32_t; ///< 32-bit signed word |
| 39 | typedef std::uint64_t u64; ///< 64-bit unsigned int | 38 | using s64 = std::int64_t; ///< 64-bit signed int |
| 40 | 39 | ||
| 41 | typedef std::int8_t s8; ///< 8-bit signed byte | 40 | using f32 = float; ///< 32-bit floating point |
| 42 | typedef std::int16_t s16; ///< 16-bit signed short | 41 | using f64 = double; ///< 64-bit floating point |
| 43 | typedef std::int32_t s32; ///< 32-bit signed word | ||
| 44 | typedef std::int64_t s64; ///< 64-bit signed int | ||
| 45 | |||
| 46 | typedef float f32; ///< 32-bit floating point | ||
| 47 | typedef double f64; ///< 64-bit floating point | ||
| 48 | 42 | ||
| 49 | // TODO: It would be nice to eventually replace these with strong types that prevent accidental | 43 | // TODO: It would be nice to eventually replace these with strong types that prevent accidental |
| 50 | // conversion between each other. | 44 | // conversion between each other. |
| 51 | typedef u64 VAddr; ///< Represents a pointer in the userspace virtual address space. | 45 | using VAddr = u64; ///< Represents a pointer in the userspace virtual address space. |
| 52 | typedef u64 PAddr; ///< Represents a pointer in the ARM11 physical address space. | 46 | using PAddr = u64; ///< Represents a pointer in the ARM11 physical address space. |
| 53 | 47 | ||
| 54 | using u128 = std::array<std::uint64_t, 2>; | 48 | using u128 = std::array<std::uint64_t, 2>; |
| 55 | static_assert(sizeof(u128) == 16, "u128 must be 128 bits wide"); | 49 | static_assert(sizeof(u128) == 16, "u128 must be 128 bits wide"); |