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

View file

@ -189,7 +189,7 @@ namespace psf
std::vector<def_table_t> indices; indices.reserve(psf.size());
// Generate indices and calculate key table length
std::size_t key_offset = 0, data_offset = 0;
usz key_offset = 0, data_offset = 0;
for (const auto& entry : psf)
{
@ -246,7 +246,7 @@ namespace psf
else if (fmt == format::string || fmt == format::array)
{
const std::string& value = entry.second.as_string();
const std::size_t size = std::min<std::size_t>(max, value.size());
const usz size = std::min<usz>(max, value.size());
if (value.size() + (fmt == format::string) > max)
{

View file

@ -47,7 +47,7 @@ fs::file pup_object::get_file(u64 entry_id)
bool pup_object::validate_hashes()
{
for (size_t i = 0; i < m_file_tbl.size(); i++)
for (usz i = 0; i < m_file_tbl.size(); i++)
{
u8 *hash = m_hash_tbl[i].hash;
PUPFileEntry file = m_file_tbl[i];

View file

@ -7,7 +7,7 @@
LOG_CHANNEL(tar_log, "TAR");
tar_object::tar_object(const fs::file& file, size_t offset)
tar_object::tar_object(const fs::file& file, usz offset)
: m_file(file)
, initial_offset(static_cast<int>(offset))
{

View file

@ -28,7 +28,7 @@ class tar_object
TARHeader read_header(u64 offset);
public:
tar_object(const fs::file& file, size_t offset = 0);
tar_object(const fs::file& file, usz offset = 0);
std::vector<std::string> get_filenames();

View file

@ -253,7 +253,7 @@ u32 TROPUSRLoader::GetUnlockedPlatinumID(u32 trophy_id, const std::string& confi
trophy_base = trophy_base->GetChildren();
}
const size_t trophy_count = m_table4.size();
const usz trophy_count = m_table4.size();
for (std::shared_ptr<rXmlNode> n = trophy_base->GetChildren(); n; n = n->GetNext())
{
@ -281,7 +281,7 @@ u32 TROPUSRLoader::GetUnlockedPlatinumID(u32 trophy_id, const std::string& confi
}
// The platinum trophy stays locked if any relevant trophy is still locked
for (size_t i = 0; i < trophy_count; i++)
for (usz i = 0; i < trophy_count; i++)
{
if (m_table4[i].trophy_pid == pid && !m_table6[i].trophy_state)
{