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)
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);

View File

@ -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);

View File

@ -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,

View File

@ -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);
}

View File

@ -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);

View File

@ -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)
{

View File

@ -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)

View File

@ -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);

View File

@ -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);