button: Add const qualifiers where needed

This commit is contained in:
Dorota Czaplejewicz
2019-08-16 17:59:43 +00:00
parent 4e9a8e4afe
commit a64bff6aab
4 changed files with 7 additions and 7 deletions

View File

@ -52,7 +52,7 @@ void squeek_button_set_bounds(struct squeek_button* button, EekBounds bounds);
struct squeek_symbol *squeek_button_get_symbol (
const struct squeek_button *button);
struct squeek_key *squeek_button_get_key(struct squeek_button*);
struct squeek_key *squeek_button_get_key(const struct squeek_button*);
uint32_t *squeek_button_has_key(const struct squeek_button* button,
const struct squeek_key *key);
void squeek_button_print(const struct squeek_button* button);

View File

@ -263,9 +263,9 @@ pub mod c {
#[no_mangle]
pub extern "C"
fn squeek_button_get_key(
button: *mut ::layout::Button
button: *const ::layout::Button
) -> ::keyboard::c::CKeyState {
let button = unsafe { &mut *button };
let button = unsafe { &*button };
::keyboard::c::CKeyState::wrap(button.state.clone())
}