From 745b19d640e657118b298c6b7cc37798af878a5a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 9 Jul 2005 18:54:45 +0000 Subject: 2005-07-09 Colin Walters * 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. --- glib/dbus-binding-tool-glib.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'glib/dbus-binding-tool-glib.c') 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'); -- cgit