Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Cast trampolines before transmuting #284

Merged
merged 2 commits into from
Mar 21, 2016
Merged

Conversation

EPashkin
Copy link
Member

Fix warning introduced rust-lang/rust#19925
See #278

@GuillaumeGomez
Copy link
Member

Good too. Thanks @EPashkin!

@@ -90,7 +90,7 @@ pub fn idle_add<F>(func: F) -> u32
where F: FnMut() -> Continue + 'static {
assert_initialized_main_thread!();
unsafe {
glib_ffi::g_idle_add_full(glib_ffi::G_PRIORITY_DEFAULT_IDLE, transmute(trampoline),
glib_ffi::g_idle_add_full(glib_ffi::G_PRIORITY_DEFAULT_IDLE, transmute(trampoline as usize),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can apply to these the same approach as in glib right?

@EPashkin
Copy link
Member Author

Updated 3 first functions, but others still needed transmute as connect accept only GCallback (function without parameters)

@gkoz
Copy link
Member

gkoz commented Mar 21, 2016

Thanks!

gkoz added a commit that referenced this pull request Mar 21, 2016
Cast trampolines before transmuting
@gkoz gkoz merged commit 8756e3d into gtk-rs:master Mar 21, 2016
@EPashkin EPashkin deleted the trampoline_cast branch March 21, 2016 16:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants