After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710867 - Fix uint8/char types for g_file_[load|replace]_contents()
Fix uint8/char types for g_file_[load|replace]_contents()
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: GObject Introspection
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 679237 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-25 10:43 UTC by Philip Withnall
Modified: 2018-05-22 14:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio-2.0: Fix uint8[]/char** types for contents parameters for g_file_[load|replace]_contents() (4.22 KB, patch)
2013-10-25 10:44 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2013-10-25 10:43:59 UTC
Vala likes the contents parameter to be a uint8[], whereas the C actually declares it as char**.
Comment 1 Philip Withnall 2013-10-25 10:44:56 UTC
Created attachment 258092 [details] [review]
gio-2.0: Fix uint8[]/char** types for contents parameters for g_file_[load|replace]_contents()
Comment 2 Philip Withnall 2013-10-25 23:00:55 UTC
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(-)
Comment 3 Luca Bruno 2013-10-26 10:45:17 UTC
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.
Comment 4 Philip Withnall 2013-10-26 22:30:25 UTC
(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?
Comment 5 Philip Withnall 2013-11-08 01:05:07 UTC
Ping.
Comment 6 Evan Nemerson 2014-01-25 06:31:57 UTC
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.
Comment 7 Evan Nemerson 2014-01-25 07:32:49 UTC
*** Bug 679237 has been marked as a duplicate of this bug. ***
Comment 8 GNOME Infrastructure Team 2018-05-22 14:58:36 UTC
-- 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.