From 8f68c1e6468031d6458ce058c21ace78c9d77a1d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 25 Jul 2022 00:18:23 +0100 Subject: [PATCH] Rename G_MARKUP_PARSE_FLAGS_NONE The prefix for GMarkupParseFlags enumeration members is G_MARKUP; this means that G_MARKUP_PARSE_FLAGS_NONE gets split into GLib.MarkupParseFlags.PARSE_FLAGS_NONE by the introspection scanner. The `/*< nick=none >*/` trigraph attribute is a glib-mkenum thing, and does not affect the introspection scanner; it would also only affect the GEnumValue nickname, which is not used by language bindings to resolve the name of the enumeration member. Plus, GMarkupParseFlags does not have a corresponding GType anyway. --- gio/gcontenttype.c | 3 +-- glib/gbookmarkfile.c | 2 +- glib/gmarkup.h | 4 ++-- glib/tests/autoptr.c | 2 +- glib/tests/markup-collect.c | 2 +- glib/tests/markup-parse.c | 2 +- glib/tests/markup-subparser.c | 3 +-- glib/tests/markup.c | 3 +-- gobject/tests/boxed.c | 3 +-- 9 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c index a824aa55f..1e21bbd04 100644 --- a/gio/gcontenttype.c +++ b/gio/gcontenttype.c @@ -435,8 +435,7 @@ load_comment_for_mime_helper (const char *dir, if (!res) return NULL; - context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, - &parse_data, NULL); + context = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, &parse_data, NULL); res = g_markup_parse_context_parse (context, data, len, NULL); g_free (data); g_markup_parse_context_free (context); diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c index a45f939b0..68618fb1c 100644 --- a/glib/gbookmarkfile.c +++ b/glib/gbookmarkfile.c @@ -1510,7 +1510,7 @@ g_bookmark_file_parse (GBookmarkFile *bookmark, parse_data->bookmark_file = bookmark; context = g_markup_parse_context_new (&markup_parser, - G_MARKUP_PARSE_FLAGS_NONE, + G_MARKUP_DEFAULT_FLAGS, parse_data, (GDestroyNotify) parse_data_free); diff --git a/glib/gmarkup.h b/glib/gmarkup.h index 6224d1343..5b5781350 100644 --- a/glib/gmarkup.h +++ b/glib/gmarkup.h @@ -76,7 +76,7 @@ GQuark g_markup_error_quark (void); /** * GMarkupParseFlags: - * @G_MARKUP_PARSE_FLAGS_NONE: No special behaviour. Since: 2.74 + * @G_MARKUP_DEFAULT_FLAGS: No special behaviour. Since: 2.74 * @G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use * @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked * sections are not passed literally to the @passthrough function of @@ -97,7 +97,7 @@ GQuark g_markup_error_quark (void); */ typedef enum { - G_MARKUP_PARSE_FLAGS_NONE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0, /*< nick=none >*/ + G_MARKUP_DEFAULT_FLAGS GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0, G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0, G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1, G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2, diff --git a/glib/tests/autoptr.c b/glib/tests/autoptr.c index 07697e3f0..06f1a0bff 100644 --- a/glib/tests/autoptr.c +++ b/glib/tests/autoptr.c @@ -244,7 +244,7 @@ static void test_g_markup_parse_context (void) { g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser, - G_MARKUP_PARSE_FLAGS_NONE, + G_MARKUP_DEFAULT_FLAGS, NULL, NULL); g_assert_nonnull (val); } diff --git a/glib/tests/markup-collect.c b/glib/tests/markup-collect.c index bc6091d1c..8afc829d7 100644 --- a/glib/tests/markup-collect.c +++ b/glib/tests/markup-collect.c @@ -209,7 +209,7 @@ test_cleanup (void) return; context = g_markup_parse_context_new (&cleanup_parser, - G_MARKUP_PARSE_FLAGS_NONE, NULL, + G_MARKUP_DEFAULT_FLAGS, NULL, NULL); g_markup_parse_context_parse (context, XML, -1, NULL); diff --git a/glib/tests/markup-parse.c b/glib/tests/markup-parse.c index 1945bc39b..136a9a961 100644 --- a/glib/tests/markup-parse.c +++ b/glib/tests/markup-parse.c @@ -314,7 +314,7 @@ main (int argc, char *argv[]) if (argc > 1) { gint arg = 1; - GMarkupParseFlags flags = G_MARKUP_PARSE_FLAGS_NONE; + GMarkupParseFlags flags = G_MARKUP_DEFAULT_FLAGS; if (strcmp (argv[1], "--cdata-as-text") == 0) { diff --git a/glib/tests/markup-subparser.c b/glib/tests/markup-subparser.c index 7d70f8c98..e2e94ea90 100644 --- a/glib/tests/markup-subparser.c +++ b/glib/tests/markup-subparser.c @@ -291,8 +291,7 @@ test (gconstpointer user_data) error = NULL; string = g_string_new (NULL); - ctx = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, - string, NULL); + ctx = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, string, NULL); result = g_markup_parse_context_parse (ctx, tc->markup, strlen (tc->markup), &error); if (result) diff --git a/glib/tests/markup.c b/glib/tests/markup.c index 6fced87d4..f0f3cfe0b 100644 --- a/glib/tests/markup.c +++ b/glib/tests/markup.c @@ -80,8 +80,7 @@ test_markup_stack (void) gboolean res; GError *error = NULL; - context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, - &data, NULL); + context = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, &data, NULL); res = g_markup_parse_context_parse (context, content, -1, &error); g_assert (res); g_assert_no_error (error); diff --git a/gobject/tests/boxed.c b/gobject/tests/boxed.c index dd45a80a3..4d3f4ea6f 100644 --- a/gobject/tests/boxed.c +++ b/gobject/tests/boxed.c @@ -560,8 +560,7 @@ test_boxed_markup (void) g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT); g_assert (G_VALUE_HOLDS_BOXED (&value)); - c = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, - NULL, NULL); + c = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, NULL, NULL); g_value_take_boxed (&value, c); c2 = g_value_get_boxed (&value);