summaryrefslogtreecommitdiffstats
path: root/glib/dbus-binding-tool-glib.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2005-07-09 18:54:45 +0000
committerColin Walters <walters@verbum.org>2005-07-09 18:54:45 +0000
commit745b19d640e657118b298c6b7cc37798af878a5a (patch)
treeb5143d1b1f5b92efcd0cda93aa9ff890bbc9bdf4 /glib/dbus-binding-tool-glib.c
parentb1ae5399f82a88ba397d55f224d00f437564bac5 (diff)
2005-07-09 Colin Walters <walters@verbum.org>
* glib/dbus-gparser.c (parse_annotation): Add annotations to argument if available, not method. * glib/dbus-gobject.c (arg_iterate): More verbose warnings. (invoke_object_method): First, remove some redundant GValues (object_value, error_value) in favor of working on array directly. Second, rework constness to be less buggy. Now we iterate directly over the argument metadata instead of parallel iterating over output signature and metadata. * glib/dbus-glib-tool.h: Add INVALID_ANNOTATION error. * glib/dbus-binding-tool-glib.c (generate_glue): Barf on const annotation on input args.
Diffstat (limited to 'glib/dbus-binding-tool-glib.c')
-rw-r--r--glib/dbus-binding-tool-glib.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/glib/dbus-binding-tool-glib.c b/glib/dbus-binding-tool-glib.c
index c87327a3..f161c638 100644
--- a/glib/dbus-binding-tool-glib.c
+++ b/glib/dbus-binding-tool-glib.c
@@ -554,8 +554,21 @@ generate_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error)
g_string_append_c (object_introspection_data_blob, direction);
g_string_append_c (object_introspection_data_blob, '\0');
- if (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_CONST) != NULL)
- g_string_append_c (object_introspection_data_blob, 'C');
+ if (arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_CONST) != NULL)
+ {
+ if (arg_info_get_direction (arg) == ARG_IN)
+ {
+ g_set_error (error,
+ DBUS_BINDING_TOOL_ERROR,
+ DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION,
+ "Input argument \"%s\" has const annotation in method \"%s\" of interface \"%s\"\n",
+ arg_info_get_name (arg),
+ method_info_get_name (method),
+ interface_info_get_name (interface));
+ return FALSE;
+ }
+ g_string_append_c (object_introspection_data_blob, 'C');
+ }
else
g_string_append_c (object_introspection_data_blob, 'F');
g_string_append_c (object_introspection_data_blob, '\0');