C++: make the member funciton layout_info and root_item const

It might be called with a const pointer
This commit is contained in:
Olivier Goffart 2021-11-02 11:44:45 +01:00
parent fde3846392
commit 4b73cce76e

View file

@ -1361,7 +1361,7 @@ fn generate_component(
Access::Public, Access::Public,
Declaration::Function(Function { Declaration::Function(Function {
name: "root_item".to_owned(), name: "root_item".to_owned(),
signature: "()".into(), signature: "() const".into(),
statements: Some(vec![format!("return {};", get_root_item)]), statements: Some(vec![format!("return {};", get_root_item)]),
..Default::default() ..Default::default()
}), }),
@ -1372,7 +1372,7 @@ fn generate_component(
Declaration::Function(Function { Declaration::Function(Function {
name: "layout_info".into(), name: "layout_info".into(),
signature: signature:
"(sixtyfps::Orientation o, [[maybe_unused]] sixtyfps::private_api::WindowRc *window_handle) -> sixtyfps::LayoutInfo" "(sixtyfps::Orientation o, [[maybe_unused]] const sixtyfps::private_api::WindowRc *window_handle) const -> sixtyfps::LayoutInfo"
.into(), .into(),
statements: Some(layout_info_function_body( statements: Some(layout_info_function_body(
&component, &component,