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 597053 - uint16 in dbus is not translated
uint16 in dbus is not translated
Status: RESOLVED WONTFIX
Product: vala
Classification: Core
Component: D-Bus
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 562498
Blocks:
 
 
Reported: 2009-10-01 22:23 UTC by Baruch Even
Modified: 2010-03-21 10:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
class that exhibits the bug (3.99 KB, text/x-vala)
2009-10-01 22:23 UTC, Baruch Even
Details

Description Baruch Even 2009-10-01 22:23:08 UTC
Created attachment 144549 [details]
class that exhibits the bug

I have code to talk to avahi with an async method as:
group.AddService(
                    -1, //IF_UNSPEC,
                    -1, //PROTO_UNSPEC,
                    (uint32)0,  //flags
                    service_name, "_http._tcp",
                    "", "", // Domain and host are local
                    (uint16)80
                     , ""// service TXT
                    );

This gets translated to:
void _dynamic_AddService5 (DBusGProxy* self, gint param1, gint param2, guint32
param3, const char* param4, const char* param5, const char* param6, const char*
param7, guint16 param8, const char* param9, GError** error) {
    dbus_g_proxy_call (self, "AddService", error, G_TYPE_INT, param1,
G_TYPE_INT, param2, G_TYPE_UINT, param3, G_TYPE_STRING, param4, G_TYPE_STRING,
param5, G_TYPE_STRING, param6, G_TYPE_STRING, param7, TYPE_UINT16, param8,
G_TYPE_STRING, param9, G_TYPE_INVALID, G_TYPE_INVALID);
    if (*error) {
        return;
    }
}

Notice that I get TYPE_UINT16 instead of G_TYPE_UINT16.

I tried to use ushort in vala but that just got eliminated.

Attached is the full class. It happens in 0.7.6 and 0.7.7.
Comment 1 Jürg Billeter 2009-10-02 03:36:49 UTC
Unfortunately, there is currently no G_TYPE_INT16 in glib, see bug 562498. For this reason, dbus-glib can't send int16 values, as far as I understand it.

While dynamic D-Bus client support in Vala uses dbus-glib and thus can't be used with int16, you can switch to the static D-Bus client support, which directly uses libdbus marshalling and doesn't need anything like G_TYPE_INT16.
Comment 2 Jürg Billeter 2010-03-21 10:49:20 UTC
As the GLib bug won't be fixed, there is not much we can do in places where we use dbus-glib. I recommend you to use static D-Bus client support in Vala. That should work fine as it does not use the marshalling code from dbus-glib.