Skip to content

Commit

Permalink
c++: use unsigned integers for the index in visit_dynamic_children
Browse files Browse the repository at this point in the history
This is what rust does, too, and prevents errors when the indices
get big.
  • Loading branch information
hunger committed Jun 14, 2023
1 parent 0d18e08 commit 99ea465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/compiler/generator/cpp.rs
Expand Up @@ -1712,7 +1712,7 @@ fn generate_sub_component(
field_access,
Declaration::Function(Function {
name: "visit_dynamic_children".into(),
signature: "(intptr_t dyn_index, [[maybe_unused]] slint::private_api::TraversalOrder order, [[maybe_unused]] slint::private_api::ItemVisitorRefMut visitor) const -> uint64_t".into(),
signature: "(uintptr_t dyn_index, [[maybe_unused]] slint::private_api::TraversalOrder order, [[maybe_unused]] slint::private_api::ItemVisitorRefMut visitor) const -> uint64_t".into(),
statements: Some(vec![
" auto self = this;".to_owned(),
format!(" switch(dyn_index) {{ {} }};", children_visitor_cases.join("")),
Expand Down

0 comments on commit 99ea465

Please sign in to comment.