Skip to content

Commit

Permalink
fixes types
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Jul 21, 2024
1 parent 85b64bd commit 9b2900d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pya2l/aml/marshal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void dumps(std::stringstream& ss, const Declaration& decl) {
void dumps(std::stringstream& ss, const AmlFile& amlf) {
const auto& decls = amlf.get_decls();
const std::size_t decl_count = std::size(decls);
ss << to_binary<std::uint32_t>(decl_count);
ss << to_binary<std::size_t>(decl_count);
for (const auto& decl : decls) {
dumps(ss, decl);
}
Expand Down
24 changes: 12 additions & 12 deletions pya2l/aml/unmarshal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ class Unmarshaller {
const auto& disc = m_reader.from_binary_str();
if (disc == "E") {
auto name = m_reader.from_binary_str();
auto enumerator_count = m_reader.from_binary<std::uint32_t>();
auto enumerator_count = m_reader.from_binary<std::size_t>();

enumerators_t enumerators;

for (std::uint32_t idx = 0UL; idx < enumerator_count; ++idx) {
for (auto idx = 0UL; idx < enumerator_count; ++idx) {
auto tag = m_reader.from_binary_str();
auto value = m_reader.from_binary< std::uint32_t>();

Expand Down Expand Up @@ -142,9 +142,9 @@ class Unmarshaller {
const auto& disc = m_reader.from_binary_str();
if (disc == "S") {
auto name = m_reader.from_binary_str();
auto tags_count = m_reader.from_binary<std::uint32_t>();
auto tags_count = m_reader.from_binary<std::size_t>();
std::vector<std::tuple<std::string, tagged_struct_member_t>> members;
for (std::uint32_t idx = 0UL; idx < tags_count; ++idx) {
for (auto idx = 0UL; idx < tags_count; ++idx) {
const auto& tag = m_reader.from_binary_str();
members.emplace_back(tag, load_tagged_struct_member());
}
Expand All @@ -158,10 +158,10 @@ class Unmarshaller {
const auto& disc = m_reader.from_binary_str();
if (disc == "U") {
auto name = m_reader.from_binary_str();
auto tags_count = m_reader.from_binary<std::uint32_t>();
auto tags_count = m_reader.from_binary<std::size_t>();
std::vector<tagged_union_member_t> members;

for (std::uint32_t idx = 0UL; idx < tags_count; ++idx) {
for (auto idx = 0UL; idx < tags_count; ++idx) {
auto tag = m_reader.from_binary_str();
const auto& dt = m_reader.from_binary_str();

Expand Down Expand Up @@ -205,9 +205,9 @@ class Unmarshaller {
}

member_t load_member() {
auto arr_count = m_reader.from_binary<std::uint32_t>();
auto arr_count = m_reader.from_binary<std::size_t>();
std::vector<std::uint32_t> array_spec;
for (std::uint32_t idx = 0UL; idx < arr_count; ++idx) {
for (auto idx = 0UL; idx < arr_count; ++idx) {
array_spec.push_back(m_reader.from_binary<std::uint32_t>());
}
return member_t{ array_spec, std::make_unique<type_t>(load_type()) };
Expand All @@ -217,10 +217,10 @@ class Unmarshaller {
const auto& disc = m_reader.from_binary_str();
if (disc == "S") {
auto name = m_reader.from_binary_str();
auto member_count = m_reader.from_binary<std::uint32_t>();
auto member_count = m_reader.from_binary<std::size_t>();
std::vector<struct_member_t> members;

for (std::uint32_t idx = 0UL; idx < member_count; ++idx) {
for (auto idx = 0UL; idx < member_count; ++idx) {
auto member = load_member();
auto mult = m_reader.from_binary<bool>();
members.emplace_back(mult, std::move(member));
Expand All @@ -247,9 +247,9 @@ class Unmarshaller {
}

std::vector<std::variant<type_t, block_t>> run() {
auto decl_count = m_reader.from_binary<std::uint32_t>();
auto decl_count = m_reader.from_binary<std::size_t>();
std::vector<std::variant<type_t, block_t>> result;
for (std::uint32_t idx = 0UL; idx < decl_count; ++idx) {
for (auto idx = 0UL; idx < decl_count; ++idx) {
const auto& disc1 = m_reader.from_binary_str();

if (disc1 == "TY") {
Expand Down

0 comments on commit 9b2900d

Please sign in to comment.