Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support const array of gdk::Atom #259

Merged
merged 1 commit into from Jan 13, 2019

Conversation

Projects
None yet
3 participants
@EPashkin
Copy link
Member

EPashkin commented Jan 13, 2019

Will be needed for gtk-rs/gir-files#32, but can be done before.

cc @GuillaumeGomez , @sdroege

src/atom.rs Outdated
let v: Vec<_> = t.iter().map(|s| s.to_glib_none()).collect();

let v_ptr = unsafe {
let v_ptr = glib_ffi::g_malloc0(mem::size_of::<ffi::GdkAtom>() * t.len() + 1) as *mut ffi::GdkAtom;

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jan 13, 2019

Member

I think the correct syntax here would be (wrapping the t.len() + 1):

let v_ptr = glib_ffi::g_malloc0(mem::size_of::<ffi::GdkAtom>() * (t.len() + 1)) as *mut ffi::GdkAtom;

This comment has been minimized.

@EPashkin

EPashkin Jan 13, 2019

Author Member

Good catch, thanks

This comment has been minimized.

@EPashkin

EPashkin Jan 13, 2019

Author Member

Fixed

@EPashkin EPashkin force-pushed the EPashkin:const_gdk_atom_arrays branch from 8489183 to 04df154 Jan 13, 2019

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Jan 13, 2019

👍

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Jan 13, 2019

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit 7f2466c into gtk-rs:master Jan 13, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@EPashkin EPashkin deleted the EPashkin:const_gdk_atom_arrays branch Jan 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.