chore: fix compilation issues with x64

This commit is contained in:
Jan
2025-04-06 13:50:04 +02:00
parent 37d52ae8da
commit 6f31e8cc29
32 changed files with 150 additions and 155 deletions

View File

@ -53,15 +53,15 @@ namespace
case CommonStructuredDataTypeCategory::SHORT:
return {DATA_SHORT, {0}};
case CommonStructuredDataTypeCategory::STRING:
return {DATA_STRING, {inputType.m_info.string_length}};
return {DATA_STRING, {static_cast<unsigned>(inputType.m_info.string_length)}};
case CommonStructuredDataTypeCategory::ENUM:
return {DATA_ENUM, {inputType.m_info.type_index}};
return {DATA_ENUM, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::STRUCT:
return {DATA_STRUCT, {inputType.m_info.type_index}};
return {DATA_STRUCT, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::INDEXED_ARRAY:
return {DATA_INDEXED_ARRAY, {inputType.m_info.type_index}};
return {DATA_INDEXED_ARRAY, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::ENUM_ARRAY:
return {DATA_ENUM_ARRAY, {inputType.m_info.type_index}};
return {DATA_ENUM_ARRAY, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::UNKNOWN:
default:
assert(false);
@ -129,14 +129,14 @@ namespace
{
outputIndexedArray.arraySize = static_cast<int>(inputIndexedArray.m_element_count);
outputIndexedArray.elementType = ConvertType(inputIndexedArray.m_array_type);
outputIndexedArray.elementSize = utils::Align(inputIndexedArray.m_element_size_in_bits, 8u) / 8u;
outputIndexedArray.elementSize = utils::Align(inputIndexedArray.m_element_size_in_bits, 8uz) / 8uz;
}
void ConvertEnumedArray(const CommonStructuredDataEnumedArray& inputEnumedArray, StructuredDataEnumedArray& outputEnumedArray)
{
outputEnumedArray.enumIndex = static_cast<int>(inputEnumedArray.m_enum_index);
outputEnumedArray.elementType = ConvertType(inputEnumedArray.m_array_type);
outputEnumedArray.elementSize = utils::Align(inputEnumedArray.m_element_size_in_bits, 8u) / 8u;
outputEnumedArray.elementSize = utils::Align(inputEnumedArray.m_element_size_in_bits, 8uz) / 8uz;
}
void ConvertDef(const CommonStructuredDataDef& inputDef, StructuredDataDef& outputDef)

View File

@ -131,7 +131,7 @@ public:
sizeof(SoundAssetBankEntry),
sizeof(SoundAssetBankChecksum),
0x40,
m_entries.size(),
static_cast<unsigned>(m_entries.size()),
0,
0,
m_total_size,
@ -157,9 +157,9 @@ public:
SoundAssetBankEntry entry{
sound.m_sound_id,
soundSize,
static_cast<size_t>(m_current_offset),
frameCount,
static_cast<unsigned>(soundSize),
static_cast<unsigned>(m_current_offset),
static_cast<unsigned>(frameCount),
frameRateIndex,
static_cast<unsigned char>(header.formatChunk.nChannels),
sound.m_looping,
@ -188,8 +188,8 @@ public:
const auto frameRateIndex = INDEX_FOR_FRAMERATE[metaData.m_sample_rate];
SoundAssetBankEntry entry{
sound.m_sound_id,
soundSize,
static_cast<size_t>(m_current_offset),
static_cast<unsigned>(soundSize),
static_cast<unsigned>(m_current_offset),
static_cast<unsigned>(metaData.m_total_samples),
frameRateIndex,
metaData.m_number_of_channels,

View File

@ -240,7 +240,7 @@ namespace sdd::struct_scope_sequences
if (state->m_current_struct_is_root && state->m_current_struct->m_properties.empty())
state->m_current_struct_padding_offset -= 64u;
state->m_current_struct->m_size_in_byte = utils::Align(state->m_current_struct_padding_offset, 8u) / 8;
state->m_current_struct->m_size_in_byte = utils::Align(state->m_current_struct_padding_offset, 8uz) / 8;
state->m_current_struct_padding_offset = 0u;
state->m_current_struct_is_root = false;
state->m_current_struct = nullptr;

View File

@ -74,7 +74,7 @@ class StructuredDataDefSizeCalculatorInternal
m_type_stack.emplace_back(CommonStructuredDataTypeCategory::STRUCT, index);
auto currentOffset = 0u;
auto currentOffset = 0uz;
for (auto& property : _struct.m_properties)
{
CalculateForType(property.m_type);
@ -85,7 +85,7 @@ class StructuredDataDefSizeCalculatorInternal
currentOffset += property.m_type.GetSizeInBits(m_def);
}
currentOffset = utils::Align(currentOffset, 8u);
currentOffset = utils::Align(currentOffset, 8uz);
_struct.m_size_in_byte += currentOffset / 8;
m_struct_calculated[index] = true;

View File

@ -286,7 +286,7 @@ namespace
common.m_vertices.emplace_back(vertex);
XModelVertexBoneWeights vertexWeights{.weightOffset = common.m_bone_weight_data.weights.size(), .weightCount = 0u};
XModelVertexBoneWeights vertexWeights{.weightOffset = static_cast<unsigned>(common.m_bone_weight_data.weights.size()), .weightCount = 0u};
for (auto i = 0u; i < std::extent_v<decltype(joints)>; i++)
{
if (std::abs(weights[i]) < std::numeric_limits<float>::epsilon())