• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 0d4e401ede234a3ce25e6098776ef5e966ad080b Mon Sep 17 00:00:00 2001
2From: Simon McVittie <smcv@collabora.com>
3Date: Thu, 23 Jun 2022 10:18:08 +0100
4Subject: [PATCH] gmarkup: Add G_MARKUP_PARSE_FLAGS_NONE
5
6Signed-off-by: Simon McVittie <smcv@collabora.com>
7
8Conflict:NA
9Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/0d4e401ede234a3ce25e6098776ef5e966ad080b
10
11---
12 gio/gcontenttype.c            | 3 ++-
13 glib/gbookmarkfile.c          | 2 +-
14 glib/gmarkup.h                | 2 ++
15 glib/tests/autoptr.c          | 4 +++-
16 glib/tests/markup-collect.c   | 4 +++-
17 glib/tests/markup-parse.c     | 2 +-
18 glib/tests/markup-subparser.c | 3 ++-
19 glib/tests/markup.c           | 3 ++-
20 gobject/tests/boxed.c         | 3 ++-
21 9 files changed, 18 insertions(+), 8 deletions(-)
22
23diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c
24index 190c5d7bf8..170bb43419 100644
25--- a/gio/gcontenttype.c
26+++ b/gio/gcontenttype.c
27@@ -435,7 +435,8 @@ load_comment_for_mime_helper (const char *dir,
28   if (!res)
29     return NULL;
30
31-  context = g_markup_parse_context_new   (&parser, 0, &parse_data, NULL);
32+  context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
33+                                        &parse_data, NULL);
34   res = g_markup_parse_context_parse (context, data, len, NULL);
35   g_free (data);
36   g_markup_parse_context_free (context);
37diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c
38index 5ae1ad6642..a45f939b0f 100644
39--- a/glib/gbookmarkfile.c
40+++ b/glib/gbookmarkfile.c
41@@ -1510,7 +1510,7 @@ g_bookmark_file_parse (GBookmarkFile  *bookmark,
42   parse_data->bookmark_file = bookmark;
43
44   context = g_markup_parse_context_new (&markup_parser,
45-  					0,
46+  					G_MARKUP_PARSE_FLAGS_NONE,
47   					parse_data,
48   					(GDestroyNotify) parse_data_free);
49
50diff --git a/glib/gmarkup.h b/glib/gmarkup.h
51index ae6976b154..6224d13431 100644
52--- a/glib/gmarkup.h
53+++ b/glib/gmarkup.h
54@@ -76,6 +76,7 @@ GQuark g_markup_error_quark (void);
55
56 /**
57  * GMarkupParseFlags:
58+ * @G_MARKUP_PARSE_FLAGS_NONE: No special behaviour. Since: 2.74
59  * @G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use
60  * @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked
61  *     sections are not passed literally to the @passthrough function of
62@@ -96,6 +97,7 @@ GQuark g_markup_error_quark (void);
63  */
64 typedef enum
65 {
66+  G_MARKUP_PARSE_FLAGS_NONE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0, /*< nick=none >*/
67   G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
68   G_MARKUP_TREAT_CDATA_AS_TEXT              = 1 << 1,
69   G_MARKUP_PREFIX_ERROR_POSITION            = 1 << 2,
70diff --git a/glib/tests/autoptr.c b/glib/tests/autoptr.c
71index 1b2dd7b094..035d3f6133 100644
72--- a/glib/tests/autoptr.c
73+++ b/glib/tests/autoptr.c
74@@ -243,7 +243,9 @@ static GMarkupParser parser = {
75 static void
76 test_g_markup_parse_context (void)
77 {
78-  g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser,  0, NULL, NULL);
79+  g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser,
80+                                                                   G_MARKUP_PARSE_FLAGS_NONE,
81+                                                                   NULL, NULL);
82   g_assert_nonnull (val);
83 }
84
85diff --git a/glib/tests/markup-collect.c b/glib/tests/markup-collect.c
86index 04b814b6cc..fa89b0ca61 100644
87--- a/glib/tests/markup-collect.c
88+++ b/glib/tests/markup-collect.c
89@@ -206,7 +206,9 @@ test_cleanup (void)
90   if (!g_test_undefined ())
91     return;
92
93-  context = g_markup_parse_context_new (&cleanup_parser, 0, NULL, NULL);
94+  context = g_markup_parse_context_new (&cleanup_parser,
95+                                        G_MARKUP_PARSE_FLAGS_NONE, NULL,
96+                                        NULL);
97   g_markup_parse_context_parse (context, XML, -1, NULL);
98
99   g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
100diff --git a/glib/tests/markup-parse.c b/glib/tests/markup-parse.c
101index 00742d7459..1945bc39bd 100644
102--- a/glib/tests/markup-parse.c
103+++ b/glib/tests/markup-parse.c
104@@ -314,7 +314,7 @@ main (int argc, char *argv[])
105   if (argc > 1)
106     {
107       gint arg = 1;
108-      GMarkupParseFlags flags = 0;
109+      GMarkupParseFlags flags = G_MARKUP_PARSE_FLAGS_NONE;
110
111       if (strcmp (argv[1], "--cdata-as-text") == 0)
112         {
113diff --git a/glib/tests/markup-subparser.c b/glib/tests/markup-subparser.c
114index 71b9ac6af5..4b1bc50185 100644
115--- a/glib/tests/markup-subparser.c
116+++ b/glib/tests/markup-subparser.c
117@@ -289,7 +289,8 @@ test (gconstpointer user_data)
118
119   error = NULL;
120   string = g_string_new (NULL);
121-  ctx = g_markup_parse_context_new (&parser, 0, string, NULL);
122+  ctx = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
123+                                    string, NULL);
124   result = g_markup_parse_context_parse (ctx, tc->markup,
125                                          strlen (tc->markup), &error);
126   if (result)
127diff --git a/glib/tests/markup.c b/glib/tests/markup.c
128index 71f9ff16c3..6fced87d49 100644
129--- a/glib/tests/markup.c
130+++ b/glib/tests/markup.c
131@@ -80,7 +80,8 @@ test_markup_stack (void)
132   gboolean res;
133   GError *error = NULL;
134
135-  context = g_markup_parse_context_new (&parser, 0, &data, NULL);
136+  context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
137+                                        &data, NULL);
138   res = g_markup_parse_context_parse (context, content, -1, &error);
139   g_assert (res);
140   g_assert_no_error (error);
141diff --git a/gobject/tests/boxed.c b/gobject/tests/boxed.c
142index f961a2f87b..c2d091c54a 100644
143--- a/gobject/tests/boxed.c
144+++ b/gobject/tests/boxed.c
145@@ -560,7 +560,8 @@ test_boxed_markup (void)
146   g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT);
147   g_assert (G_VALUE_HOLDS_BOXED (&value));
148
149-  c = g_markup_parse_context_new (&parser, 0, NULL, NULL);
150+  c = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
151+                                  NULL, NULL);
152   g_value_take_boxed (&value, c);
153
154   c2 = g_value_get_boxed (&value);
155--
156GitLab
157
158