GNOME Bugzilla – Bug 710867
Fix uint8/char types for g_file_[load|replace]_contents()
Last modified: 2018-05-22 14:58:36 UTC
Vala likes the contents parameter to be a uint8[], whereas the C actually declares it as char**.
Created attachment 258092 [details] [review] gio-2.0: Fix uint8[]/char** types for contents parameters for g_file_[load|replace]_contents()
Comment on attachment 258092 [details] [review] gio-2.0: Fix uint8[]/char** types for contents parameters for g_file_[load|replace]_contents() Thanks for the fast review. commit e4ef6fb72f560da385a09d262ef8afd2b64a1fc8 Author: Philip Withnall <philip.withnall@collabora.co.uk> Date: Fri Oct 25 11:44:18 2013 +0100 gio-2.0: Fix uint8[]/char** types for contents parameters for g_file_[load|r https://bugzilla.gnome.org/show_bug.cgi?id=710867 vapi/gio-2.0.vapi | 4 ++-- vapi/metadata/Gio-2.0.metadata | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
commit 158a273158582155cf5baf1242bb10d12a3e223d Author: Luca Bruno <lucabru@src.gnome.org> Date: Sat Oct 26 12:43:14 2013 +0200 Revert "gio-2.0: Fix uint8[]/char** types for contents parameters for g_file_[load|replace]_contents()" This reverts commit e4ef6fb72f560da385a09d262ef8afd2b64a1fc8. I can't regenerate the bindings with this patch. Reverting. "type" in the metadata is not about the C type, but the Vala type.
(In reply to comment #3) > I can't regenerate the bindings with this patch. Reverting. "type" in the > metadata is not about the C type, but the Vala type. So what is the right metadata tag to add the ‘type’ attribute in the VAPI?
Ping.
There isn't one. We should be picking this up from the GIR like we do for non-arrays. The GIR looks like this: <parameter name="contents" transfer-ownership="none"> <doc xml:space="preserve">a string containing the new contents for @file</doc> <array length="1" zero-terminated="0" c:type="char*"> <type name="guint8"/> </array> </parameter> It would be better to fix the GIR parser than adding another metadata annotation, so I'm moving this bug over to the GObject Introspection component.
*** Bug 679237 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/415.