mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-23 18:02:46 -06:00
address_space_info: Use type alias to simplify code
We can define an alias for the index arrays and then just reuse it to make the code nicer to read.
This commit is contained in:
parent
c3eb42de65
commit
ed0fe04b4f
1 changed files with 11 additions and 12 deletions
|
@ -49,18 +49,17 @@ constexpr bool IsAllowedIndexForAddress(std::size_t index) {
|
||||||
return index < AddressSpaceInfos.size() && AddressSpaceInfos[index].address != Invalid;
|
return index < AddressSpaceInfos.size() && AddressSpaceInfos[index].address != Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr std::array<std::size_t, static_cast<std::size_t>(AddressSpaceInfo::Type::Count)>
|
using IndexArray = std::array<std::size_t, static_cast<std::size_t>(AddressSpaceInfo::Type::Count)>;
|
||||||
AddressSpaceIndices32Bit{
|
|
||||||
|
constexpr IndexArray AddressSpaceIndices32Bit{
|
||||||
0, 1, 0, 2, 0, 3,
|
0, 1, 0, 2, 0, 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr std::array<std::size_t, static_cast<std::size_t>(AddressSpaceInfo::Type::Count)>
|
constexpr IndexArray AddressSpaceIndices36Bit{
|
||||||
AddressSpaceIndices36Bit{
|
|
||||||
4, 5, 4, 6, 4, 7,
|
4, 5, 4, 6, 4, 7,
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr std::array<std::size_t, static_cast<std::size_t>(AddressSpaceInfo::Type::Count)>
|
constexpr IndexArray AddressSpaceIndices39Bit{
|
||||||
AddressSpaceIndices39Bit{
|
|
||||||
9, 8, 8, 10, 12, 11,
|
9, 8, 8, 10, 12, 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue