[gobject-introspection] Make error more verbose in parser
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Make error more verbose in parser
- Date: Wed, 9 Dec 2009 11:39:44 +0000 (UTC)
commit 91d7a09777e90767b26b2fc5ca050142b5843da7
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 9 11:21:30 2009 +0000
Make error more verbose in parser
By printing the function when arguments are missing
https://bugzilla.gnome.org/show_bug.cgi?id=604161
girepository/girparser.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 1bbe59f..7741617 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -840,11 +840,14 @@ start_function (GMarkupParseContext *context,
}
static void
-parse_param_transfer (GIrNodeParam *param, const gchar *transfer)
+parse_param_transfer (GIrNodeParam *param, const gchar *transfer, const gchar *name)
{
if (transfer == NULL)
{
- g_warning ("required attribute 'transfer-ownership' missing");
+ if (!name)
+ g_warning ("required attribute 'transfer-ownership' missing");
+ else
+ g_warning ("required attribute 'transfer-ownership' for function '%s'", name);
}
else if (strcmp (transfer, "none") == 0)
{
@@ -948,7 +951,7 @@ start_parameter (GMarkupParseContext *context,
else
param->allow_none = FALSE;
- parse_param_transfer (param, transfer);
+ parse_param_transfer (param, transfer, name);
if (scope && strcmp (scope, "call") == 0)
param->scope = GI_SCOPE_TYPE_CALL;
@@ -1950,7 +1953,7 @@ start_return_value (GMarkupParseContext *context,
state_switch (ctx, STATE_FUNCTION_RETURN);
transfer = find_attribute ("transfer-ownership", attribute_names, attribute_values);
- parse_param_transfer (param, transfer);
+ parse_param_transfer (param, transfer, NULL);
switch (CURRENT_NODE (ctx)->type)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]