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

Fix generating array with c:type="gpointer*" and other actual type #617

Merged
merged 1 commit into from Jul 1, 2018

Conversation

Projects
None yet
2 participants
@EPashkin
Member

EPashkin commented Jul 1, 2018

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jul 1, 2018

Member

In gtk-rs crates only affect gio-sys.

--- a/gio-sys/src/lib.rs
+++ b/gio-sys/src/lib.rs
@@ -8237,8 +8237,8 @@ extern "C" {
     pub fn g_list_store_remove_all(store: *mut GListStore);
     #[cfg(any(feature = "v2_46", feature = "dox"))]
     pub fn g_list_store_sort(store: *mut GListStore, compare_func: glib::GCompareDataFunc, user_data: gpointer);
-    //#[cfg(any(feature = "v2_44", feature = "dox"))]
-    //pub fn g_list_store_splice(store: *mut GListStore, position: c_uint, n_removals: c_uint, additions: /*Metadata mismatch*/*mut [c:type mismatch gpointer != GObject of Object], n_additions: c_uint);
+    #[cfg(any(feature = "v2_44", feature = "dox"))]
+    pub fn g_list_store_splice(store: *mut GListStore, position: c_uint, n_removals: c_uint, additions: *mut *mut gobject::GObject, n_additions: c_uint);
Member

EPashkin commented Jul 1, 2018

In gtk-rs crates only affect gio-sys.

--- a/gio-sys/src/lib.rs
+++ b/gio-sys/src/lib.rs
@@ -8237,8 +8237,8 @@ extern "C" {
     pub fn g_list_store_remove_all(store: *mut GListStore);
     #[cfg(any(feature = "v2_46", feature = "dox"))]
     pub fn g_list_store_sort(store: *mut GListStore, compare_func: glib::GCompareDataFunc, user_data: gpointer);
-    //#[cfg(any(feature = "v2_44", feature = "dox"))]
-    //pub fn g_list_store_splice(store: *mut GListStore, position: c_uint, n_removals: c_uint, additions: /*Metadata mismatch*/*mut [c:type mismatch gpointer != GObject of Object], n_additions: c_uint);
+    #[cfg(any(feature = "v2_44", feature = "dox"))]
+    pub fn g_list_store_splice(store: *mut GListStore, position: c_uint, n_removals: c_uint, additions: *mut *mut gobject::GObject, n_additions: c_uint);
@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 1, 2018

Member

Nice, that's what I tried except for adding the other *mut :) is that always correct?

Thanks!

Member

sdroege commented Jul 1, 2018

Nice, that's what I tried except for adding the other *mut :) is that always correct?

Thanks!

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jul 1, 2018

Member

IMHO is correct: glib_type is type name and it not contains "*", but c:type says that it passed as gpointer so we add "*".
Anyway its very rare occurrence.

Member

EPashkin commented Jul 1, 2018

IMHO is correct: glib_type is type name and it not contains "*", but c:type says that it passed as gpointer so we add "*".
Anyway its very rare occurrence.

@EPashkin EPashkin merged commit b37cc68 into gtk-rs:master Jul 1, 2018

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:fix_generating_array_passed_as_gpointers branch Jul 1, 2018

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 1, 2018

Member

Great! You regen sys?

Member

sdroege commented Jul 1, 2018

Great! You regen sys?

vhdirk pushed a commit to vhdirk/gir that referenced this pull request Jul 6, 2018

Merge pull request #617 from EPashkin/fix_generating_array_passed_as_…
…gpointers

Fix generating array with c:type="gpointer*" and other actual type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment