Add usz alias for std::size_t

This commit is contained in:
Nekotekina
2020-12-18 10:39:54 +03:00
parent 360c4d1554
commit fb29933d3d
173 changed files with 718 additions and 717 deletions
+6 -6
View File
@@ -5,19 +5,19 @@
namespace rpcs3
{
template<typename T>
static size_t hash_base(T value)
static usz hash_base(T value)
{
return static_cast<size_t>(value);
return static_cast<usz>(value);
}
template<typename T, typename U>
static size_t hash_struct_base(const T& value)
static usz hash_struct_base(const T& value)
{
// FNV 64-bit
size_t result = 14695981039346656037ull;
usz result = 14695981039346656037ull;
const U *bits = reinterpret_cast<const U*>(&value);
for (size_t n = 0; n < (sizeof(T) / sizeof(U)); ++n)
for (usz n = 0; n < (sizeof(T) / sizeof(U)); ++n)
{
result ^= bits[n];
result *= 1099511628211ull;
@@ -27,7 +27,7 @@ namespace rpcs3
}
template<typename T>
static size_t hash_struct(const T& value)
static usz hash_struct(const T& value)
{
static constexpr auto block_sz = sizeof(T);