diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-03 12:44:18 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-03 12:44:18 +0000 |
commit | 27201fd88037234905c2207164ab8b05bc5f50c7 (patch) | |
tree | 3fff8077b394c3391a9224539b5f4fbc0d4dc4f0 /tools/libglibcodegen.py | |
parent | e2b03bf558265459971a35d2aa30eb6f2b90893f (diff) | |
download | telepathy-glib-27201fd88037234905c2207164ab8b05bc5f50c7.tar.gz |
libglibcodegen.py: support arrays of arrays, and get [u]int64 right (modified patch from Marco Barisione)
20071203124418-53eee-7877c3e78124b02f28be9a28dcff3cd7db9deaf1.gz
Diffstat (limited to 'tools/libglibcodegen.py')
-rw-r--r-- | tools/libglibcodegen.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py index 35b326d6f..4140e2354 100644 --- a/tools/libglibcodegen.py +++ b/tools/libglibcodegen.py @@ -244,9 +244,9 @@ def type_to_gtype(s): elif s == 'u': #uint32 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'x': #int64 - return ("gint ", "G_TYPE_INT64","INT64", False) - elif s == 't': #uint32 - return ("guint ", "G_TYPE_UINT64","UINT64", False) + return ("gint64 ", "G_TYPE_INT64","INT64", False) + elif s == 't': #uint64 + return ("guint64 ", "G_TYPE_UINT64","UINT64", False) elif s == 'd': #double return ("gdouble ", "G_TYPE_DOUBLE","DOUBLE", False) elif s == 's': #string @@ -277,9 +277,6 @@ def type_to_gtype(s): return ("GArray *", "DBUS_TYPE_G_BOOLEAN_ARRAY", "BOXED", True) elif s == 'ao': #object path array return ("GArray *", "DBUS_TYPE_G_OBJECT_ARRAY", "BOXED", True) - elif s[:2] == 'a(': #array of structs, recurse - gtype = type_to_gtype(s[1:])[1] - return ("GPtrArray *", "(dbus_g_type_get_collection (\"GPtrArray\", "+gtype+"))", "BOXED", True) elif s == 'a{ss}': #hash table of string to string return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) elif s[:2] == 'a{': #some arbitrary hash tables @@ -288,6 +285,9 @@ def type_to_gtype(s): first = type_to_gtype(s[2]) second = type_to_gtype(s[3:-1]) return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) + elif s[:2] in ('a(', 'aa'): # array of structs or arrays, recurse + gtype = type_to_gtype(s[1:])[1] + return ("GPtrArray *", "(dbus_g_type_get_collection (\"GPtrArray\", "+gtype+"))", "BOXED", True) elif s[:1] == '(': #struct gtype = "(dbus_g_type_get_struct (\"GValueArray\", " for subsig in Signature(s[1:-1]): |