summaryrefslogtreecommitdiff
path: root/gobject/glib-genmarshal.c
diff options
context:
space:
mode:
authorMathias Hasselmann <hasselmm@src.gnome.org>2007-12-12 10:19:43 +0000
committerMathias Hasselmann <hasselmm@src.gnome.org>2007-12-12 10:19:43 +0000
commita5427003d32a435dee3ade62787366b84470469d (patch)
tree42706a21815d41921c3a7144f33b45cb540060e1 /gobject/glib-genmarshal.c
parent851f4a9b0fe336a165312e6597df5a90c1b7422c (diff)
Always exit with non-zero error code when printing warnings.
* gobject/glib-genmarshal.c: Add global exit_status variable, and use it in pad() and process_signature() to return with non-zero error code when printing warnings. (#495294) svn path=/trunk/; revision=6098
Diffstat (limited to 'gobject/glib-genmarshal.c')
-rw-r--r--gobject/glib-genmarshal.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c
index e05579d79..61ac8ada6 100644
--- a/gobject/glib-genmarshal.c
+++ b/gobject/glib-genmarshal.c
@@ -123,6 +123,7 @@ static gboolean gen_cbody = FALSE;
static gboolean gen_internal = FALSE;
static gboolean skip_ploc = FALSE;
static gboolean std_includes = TRUE;
+static gint exit_status = 0;
/* --- functions --- */
@@ -283,6 +284,7 @@ pad (const gchar *string)
buffer = g_strdup_printf ("%s ", string);
g_warning ("overfull string (%u bytes) for padspace",
(guint) strlen (string));
+ exit_status |= 2;
return buffer;
}
@@ -464,6 +466,7 @@ process_signature (Signature *sig)
if (!complete_out_arg (sig->rarg))
{
g_warning ("unknown type: %s", sig->rarg->keyword);
+ exit_status |= 1;
return;
}
for (node = sig->args; node; node = node->next)
@@ -473,6 +476,7 @@ process_signature (Signature *sig)
if (!complete_in_arg (iarg))
{
g_warning ("unknown type: %s", iarg->keyword);
+ exit_status |= 1;
return;
}
}
@@ -604,7 +608,6 @@ main (int argc,
GScanner *scanner;
GSList *slist, *files = NULL;
gint i;
- gint result = 0;
/* parse args and do fast exits */
parse_args (&argc, &argv);
@@ -665,7 +668,7 @@ main (int argc,
if (fd < 0)
{
g_warning ("failed to open \"%s\": %s", file, g_strerror (errno));
- result = 1;
+ exit_status |= 1;
continue;
}
@@ -724,7 +727,7 @@ main (int argc,
if (expected_token != G_TOKEN_NONE)
{
g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE);
- result = 1;
+ exit_status |= 1;
break;
}
@@ -751,7 +754,7 @@ main (int argc,
g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL);
g_hash_table_destroy (marshallers);
- return result;
+ return exit_status;
}
static void