summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilderparser.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-03-03 07:10:51 -0500
committerMatthias Clasen <mclasen@redhat.com>2023-03-14 14:56:42 -0400
commita36123c802ba27e4e1fcb94c4b8cc9515bcf21ec (patch)
tree80f8a3bf5a3c37d92f9609bb0e512b8cd6b4a24e /gtk/gtkbuilderparser.c
parent9f88dba1622a02b44f49fc0079b7810e588347d3 (diff)
downloadgtk+-a36123c802ba27e4e1fcb94c4b8cc9515bcf21ec.tar.gz
gtk: Stop using g_slice
Diffstat (limited to 'gtk/gtkbuilderparser.c')
-rw-r--r--gtk/gtkbuilderparser.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index 1d2d0b3d0b..a1a7bd68c0 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -527,7 +527,7 @@ parse_requires (ParserData *data,
version_minor = g_ascii_strtoll (split[1], NULL, 10);
g_strfreev (split);
- req_info = g_slice_new0 (RequiresInfo);
+ req_info = g_new0 (RequiresInfo, 1);
req_info->library = g_strdup (library);
req_info->major = version_major;
req_info->minor = version_minor;
@@ -659,7 +659,7 @@ parse_object (GtkBuildableParseContext *context,
}
}
- object_info = g_slice_new0 (ObjectInfo);
+ object_info = g_new0 (ObjectInfo, 1);
object_info->tag_type = TAG_OBJECT;
object_info->type = object_type;
object_info->oclass = g_type_class_ref (object_type);
@@ -766,7 +766,7 @@ parse_template (GtkBuildableParseContext *context,
++data->cur_object_level;
- object_info = g_slice_new0 (ObjectInfo);
+ object_info = g_new0 (ObjectInfo, 1);
object_info->tag_type = TAG_TEMPLATE;
object_info->type = parsed_type;
object_info->oclass = g_type_class_ref (parsed_type);
@@ -802,7 +802,7 @@ free_object_info (ObjectInfo *info)
g_ptr_array_free (info->properties, TRUE);
g_free (info->constructor);
g_free (info->id);
- g_slice_free (ObjectInfo, info);
+ g_free (info);
}
static void
@@ -836,7 +836,7 @@ parse_child (ParserData *data,
return;
}
- child_info = g_slice_new0 (ChildInfo);
+ child_info = g_new0 (ChildInfo, 1);
child_info->tag_type = TAG_CHILD;
child_info->type = g_strdup (type);
child_info->internal_child = g_strdup (internal_child);
@@ -851,7 +851,7 @@ free_child_info (ChildInfo *info)
{
g_free (info->type);
g_free (info->internal_child);
- g_slice_free (ChildInfo, info);
+ g_free (info);
}
static void
@@ -924,7 +924,7 @@ parse_property (ParserData *data,
{
BindingInfo *binfo;
- binfo = g_slice_new0 (BindingInfo);
+ binfo = g_new0 (BindingInfo, 1);
binfo->tag_type = TAG_BINDING;
binfo->target = NULL;
binfo->target_pspec = pspec;
@@ -944,7 +944,7 @@ parse_property (ParserData *data,
return;
}
- info = g_slice_new0 (PropertyInfo);
+ info = g_new0 (PropertyInfo, 1);
info->tag_type = TAG_PROPERTY;
info->pspec = pspec;
info->text = g_string_new ("");
@@ -1022,7 +1022,7 @@ parse_binding (ParserData *data,
}
- info = g_slice_new0 (BindingExpressionInfo);
+ info = g_new0 (BindingExpressionInfo, 1);
info->tag_type = TAG_BINDING_EXPRESSION;
info->target = NULL;
info->target_pspec = pspec;
@@ -1044,7 +1044,7 @@ free_property_info (PropertyInfo *info)
}
g_string_free (info->text, TRUE);
g_free (info->context);
- g_slice_free (PropertyInfo, info);
+ g_free (info);
}
static void
@@ -1075,7 +1075,7 @@ free_expression_info (ExpressionInfo *info)
g_assert_not_reached ();
break;
}
- g_slice_free (ExpressionInfo, info);
+ g_free (info);
}
static gboolean
@@ -1161,7 +1161,7 @@ parse_constant_expression (ParserData *data,
}
}
- info = g_slice_new0 (ExpressionInfo);
+ info = g_new0 (ExpressionInfo, 1);
info->tag_type = TAG_EXPRESSION;
info->expression_type = EXPRESSION_CONSTANT;
info->constant.type = type;
@@ -1221,7 +1221,7 @@ parse_closure_expression (ParserData *data,
swapped = FALSE;
}
- info = g_slice_new0 (ExpressionInfo);
+ info = g_new0 (ExpressionInfo, 1);
info->tag_type = TAG_EXPRESSION;
info->expression_type = EXPRESSION_CLOSURE;
info->closure.type = type;
@@ -1277,7 +1277,7 @@ parse_lookup_expression (ParserData *data,
}
}
- info = g_slice_new0 (ExpressionInfo);
+ info = g_new0 (ExpressionInfo, 1);
info->tag_type = TAG_EXPRESSION;
info->expression_type = EXPRESSION_PROPERTY;
info->property.this_type = type;
@@ -1513,7 +1513,7 @@ parse_signal (ParserData *data,
swapped = FALSE;
}
- info = g_slice_new0 (SignalInfo);
+ info = g_new0 (SignalInfo, 1);
info->id = id;
info->detail = detail;
info->handler = g_strdup (handler);
@@ -1535,7 +1535,7 @@ _free_signal_info (SignalInfo *info,
g_free (info->handler);
g_free (info->connect_object_name);
g_free (info->object_name);
- g_slice_free (SignalInfo, info);
+ g_free (info);
}
void
@@ -1544,7 +1544,7 @@ _free_binding_info (BindingInfo *info,
{
g_free (info->source);
g_free (info->source_property);
- g_slice_free (BindingInfo, info);
+ g_free (info);
}
void
@@ -1553,7 +1553,7 @@ free_binding_expression_info (BindingExpressionInfo *info)
if (info->expr)
free_expression_info (info->expr);
g_free (info->object_name);
- g_slice_free (BindingExpressionInfo, info);
+ g_free (info);
}
static void
@@ -1561,7 +1561,7 @@ free_requires_info (RequiresInfo *info,
gpointer user_data)
{
g_free (info->library);
- g_slice_free (RequiresInfo, info);
+ g_free (info);
}
static void
@@ -1604,7 +1604,7 @@ create_subparser (GObject *object,
{
SubParser *subparser;
- subparser = g_slice_new0 (SubParser);
+ subparser = g_new0 (SubParser, 1);
subparser->object = object;
subparser->child = child;
subparser->tagname = g_strdup (element_name);
@@ -1620,7 +1620,7 @@ static void
free_subparser (SubParser *subparser)
{
g_free (subparser->tagname);
- g_slice_free (SubParser, subparser);
+ g_free (subparser);
}
static gboolean
@@ -2141,7 +2141,7 @@ text (GtkBuildableParseContext *context,
text_len--;
if (expr_info->property.expression == NULL && text_len > 0)
{
- ExpressionInfo *constant = g_slice_new0 (ExpressionInfo);
+ ExpressionInfo *constant = g_new0 (ExpressionInfo, 1);
constant->tag_type = TAG_EXPRESSION;
constant->expression_type = EXPRESSION_CONSTANT;
constant->constant.type = G_TYPE_INVALID;