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.
This commit is contained in:
Emmanuele Bassi 2022-07-25 00:18:23 +01:00
parent aa65fc2537
commit 8f68c1e646
9 changed files with 10 additions and 14 deletions

View File

@ -435,8 +435,7 @@ load_comment_for_mime_helper (const char *dir,
if (!res) if (!res)
return NULL; return NULL;
context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, context = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, &parse_data, NULL);
&parse_data, NULL);
res = g_markup_parse_context_parse (context, data, len, NULL); res = g_markup_parse_context_parse (context, data, len, NULL);
g_free (data); g_free (data);
g_markup_parse_context_free (context); g_markup_parse_context_free (context);

View File

@ -1510,7 +1510,7 @@ g_bookmark_file_parse (GBookmarkFile *bookmark,
parse_data->bookmark_file = bookmark; parse_data->bookmark_file = bookmark;
context = g_markup_parse_context_new (&markup_parser, context = g_markup_parse_context_new (&markup_parser,
G_MARKUP_PARSE_FLAGS_NONE, G_MARKUP_DEFAULT_FLAGS,
parse_data, parse_data,
(GDestroyNotify) parse_data_free); (GDestroyNotify) parse_data_free);

View File

@ -76,7 +76,7 @@ GQuark g_markup_error_quark (void);
/** /**
* GMarkupParseFlags: * 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_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use
* @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked * @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked
* sections are not passed literally to the @passthrough function of * sections are not passed literally to the @passthrough function of
@ -97,7 +97,7 @@ GQuark g_markup_error_quark (void);
*/ */
typedef enum 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_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1, G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1,
G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2, G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2,

View File

@ -244,7 +244,7 @@ static void
test_g_markup_parse_context (void) test_g_markup_parse_context (void)
{ {
g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser, g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser,
G_MARKUP_PARSE_FLAGS_NONE, G_MARKUP_DEFAULT_FLAGS,
NULL, NULL); NULL, NULL);
g_assert_nonnull (val); g_assert_nonnull (val);
} }

View File

@ -209,7 +209,7 @@ test_cleanup (void)
return; return;
context = g_markup_parse_context_new (&cleanup_parser, context = g_markup_parse_context_new (&cleanup_parser,
G_MARKUP_PARSE_FLAGS_NONE, NULL, G_MARKUP_DEFAULT_FLAGS, NULL,
NULL); NULL);
g_markup_parse_context_parse (context, XML, -1, NULL); g_markup_parse_context_parse (context, XML, -1, NULL);

View File

@ -314,7 +314,7 @@ main (int argc, char *argv[])
if (argc > 1) if (argc > 1)
{ {
gint arg = 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) if (strcmp (argv[1], "--cdata-as-text") == 0)
{ {

View File

@ -291,8 +291,7 @@ test (gconstpointer user_data)
error = NULL; error = NULL;
string = g_string_new (NULL); string = g_string_new (NULL);
ctx = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, ctx = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, string, NULL);
string, NULL);
result = g_markup_parse_context_parse (ctx, tc->markup, result = g_markup_parse_context_parse (ctx, tc->markup,
strlen (tc->markup), &error); strlen (tc->markup), &error);
if (result) if (result)

View File

@ -80,8 +80,7 @@ test_markup_stack (void)
gboolean res; gboolean res;
GError *error = NULL; GError *error = NULL;
context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, context = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, &data, NULL);
&data, NULL);
res = g_markup_parse_context_parse (context, content, -1, &error); res = g_markup_parse_context_parse (context, content, -1, &error);
g_assert (res); g_assert (res);
g_assert_no_error (error); g_assert_no_error (error);

View File

@ -560,8 +560,7 @@ test_boxed_markup (void)
g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT); g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT);
g_assert (G_VALUE_HOLDS_BOXED (&value)); g_assert (G_VALUE_HOLDS_BOXED (&value));
c = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE, c = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, NULL, NULL);
NULL, NULL);
g_value_take_boxed (&value, c); g_value_take_boxed (&value, c);
c2 = g_value_get_boxed (&value); c2 = g_value_get_boxed (&value);