refactor: fix x64 compilation issues in Common,ObjCommon,ObjCompiling,ObjImage components

This commit is contained in:
Jan
2025-04-25 22:55:04 +01:00
committed by Jan Laupetin
parent 5635470b6e
commit ee4301952a
18 changed files with 116 additions and 119 deletions

View File

@ -42,14 +42,14 @@ uint32_t CommonStructuredDataEnum::CalculateChecksum(const uint32_t initialValue
{
auto checksum = initialValue;
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(m_name.c_str()), m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(m_name.c_str()), static_cast<unsigned>(m_name.size() + 1u));
const auto littleEndianElementCount = endianness::ToLittleEndian(ElementCount());
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(&littleEndianElementCount), sizeof(littleEndianElementCount));
for (const auto& entry : m_entries)
{
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(entry.m_name.c_str()), entry.m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(entry.m_name.c_str()), static_cast<unsigned>(entry.m_name.size() + 1));
const auto littleEndianValue = endianness::ToLittleEndian(entry.m_value);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(&littleEndianValue), sizeof(littleEndianValue));

View File

@ -41,10 +41,10 @@ uint32_t CommonStructuredDataStruct::CalculateChecksum(const CommonStructuredDat
{
auto checksum = initialValue;
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(m_name.c_str()), m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(m_name.c_str()), static_cast<unsigned>(m_name.size() + 1u));
for (const auto& property : m_properties)
{
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(property.m_name.c_str()), property.m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(property.m_name.c_str()), static_cast<unsigned>(property.m_name.size() + 1u));
const auto littleEndianOffset = endianness::ToLittleEndian(property.m_offset_in_bits);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(&littleEndianOffset), sizeof(littleEndianOffset));
@ -68,7 +68,7 @@ uint32_t CommonStructuredDataStruct::CalculateChecksum(const CommonStructuredDat
if (currentType.m_info.type_index < def.m_enums.size())
{
const auto& _enum = *def.m_enums[currentType.m_info.type_index];
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(_enum.m_name.c_str()), _enum.m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(_enum.m_name.c_str()), static_cast<unsigned>(_enum.m_name.size() + 1u));
currentType = CommonStructuredDataType(CommonStructuredDataTypeCategory::UNKNOWN);
}
break;
@ -76,7 +76,7 @@ uint32_t CommonStructuredDataStruct::CalculateChecksum(const CommonStructuredDat
if (currentType.m_info.type_index < def.m_structs.size())
{
const auto& _struct = *def.m_structs[currentType.m_info.type_index];
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(_struct.m_name.c_str()), _struct.m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(_struct.m_name.c_str()), static_cast<unsigned>(_struct.m_name.size() + 1u));
currentType = CommonStructuredDataType(CommonStructuredDataTypeCategory::UNKNOWN);
}
break;
@ -99,7 +99,7 @@ uint32_t CommonStructuredDataStruct::CalculateChecksum(const CommonStructuredDat
if (enumedArray.m_enum_index < def.m_enums.size())
{
const auto& _enum = *def.m_enums[enumedArray.m_enum_index];
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(_enum.m_name.c_str()), _enum.m_name.size() + 1);
checksum = crc32(checksum, reinterpret_cast<const Bytef*>(_enum.m_name.c_str()), static_cast<unsigned>(_enum.m_name.size() + 1u));
}
currentType = enumedArray.m_array_type;
}