[Vala] Vala and DBus types



I've noticed a somewhat strange behaviour of Vala when translating language types to DBus types (this may be due to my little know-how on Vala and C)

I need to pass a timestamp (for logging purposes) with a DBus signal, so I wanted to use the unix epoch. This value is of time_t type, which is a long int (at least looking in C includes). Long int should be (tested with sizeof() function both in Vala and C) 4 bytes on 32-bit systems and 8 bytes on 64-bit.
So I'm passing that value via DBus using a long type ( public signal log_event (long timestamp, ...) ). On 32-bit platforms this is (correctly?) translated in an Int32 DBus type, but on 64-bit platforms I expected it to be translated in an Int64 type, as long is 8 bytes in this architecture, but it is translated again with an Int32.
Is this a bug or am I missing something?

Moreover I found out that passing the parameter as an int64 or uint64, the type is not translated in DBus Int64 and UInt64 but in Error(x) and Error(t) (btw x and t are the DBus codes for the two types). I haven't tested if it's only a "visualization" problem and the data is correctly passed.
"Playing" even more with types I discovered that passing a parameter as a int16 or uint16 does not compile (even though Int16 and UInt16 are valid types in DBus) (Compilation errors are: "glib-2.0.vapi:310.1-310.19: error: The type `int16` doesn't declare a marshaller type name" and "glib-2.0.vapi:310.1-310.19: error: The type `int16` doesn't declare a type id" repeated several times -- I thingk one time for each signal call)

Any ideas?

Thanks

Daniele Benucci

--
Grabel's Law:
2 is not equal to 3 -- not even for large values of 2.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]