Coverage Report

Created: 2025-07-01 07:09

/src/glib/gobject/gboxed.c
Line
Count
Source (jump to first uncovered line)
1
/* GObject - GLib Type, Object, Parameter and Signal Library
2
 * Copyright (C) 2000-2001 Red Hat, Inc.
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2.1 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General
15
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
16
 */
17
18
#include "config.h"
19
20
#include <string.h>
21
22
/* for GValueArray */
23
#ifndef GLIB_DISABLE_DEPRECATION_WARNINGS
24
#define GLIB_DISABLE_DEPRECATION_WARNINGS
25
#endif
26
27
#include "gboxed.h"
28
#include "gclosure.h"
29
#include "gtype-private.h"
30
#include "gvalue.h"
31
#include "gvaluearray.h"
32
#include "gvaluecollector.h"
33
34
35
/**
36
 * SECTION:gboxed
37
 * @short_description: A mechanism to wrap opaque C structures registered
38
 *     by the type system
39
 * @see_also: #GParamSpecBoxed, g_param_spec_boxed()
40
 * @title: Boxed Types
41
 *
42
 * #GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
43
 * thing the type system needs to know about the structures is how to copy them
44
 * (a #GBoxedCopyFunc) and how to free them (a #GBoxedFreeFunc) — beyond that
45
 * they are treated as opaque chunks of memory.
46
 *
47
 * Boxed types are useful for simple value-holder structures like rectangles or
48
 * points. They can also be used for wrapping structures defined in non-#GObject
49
 * based libraries. They allow arbitrary structures to be handled in a uniform
50
 * way, allowing uniform copying (or referencing) and freeing (or unreferencing)
51
 * of them, and uniform representation of the type of the contained structure.
52
 * In turn, this allows any type which can be boxed to be set as the data in a
53
 * #GValue, which allows for polymorphic handling of a much wider range of data
54
 * types, and hence usage of such types as #GObject property values.
55
 *
56
 * #GBoxed is designed so that reference counted types can be boxed. Use the
57
 * type’s ‘ref’ function as the #GBoxedCopyFunc, and its ‘unref’ function as the
58
 * #GBoxedFreeFunc. For example, for #GBytes, the #GBoxedCopyFunc is
59
 * g_bytes_ref(), and the #GBoxedFreeFunc is g_bytes_unref().
60
 */
61
62
static inline void              /* keep this function in sync with gvalue.c */
63
value_meminit (GValue *value,
64
         GType   value_type)
65
0
{
66
0
  value->g_type = value_type;
67
0
  memset (value->data, 0, sizeof (value->data));
68
0
}
69
70
static GValue *
71
value_copy (GValue *src_value)
72
0
{
73
0
  GValue *dest_value = g_new0 (GValue, 1);
74
75
0
  if (G_VALUE_TYPE (src_value))
76
0
    {
77
0
      g_value_init (dest_value, G_VALUE_TYPE (src_value));
78
0
      g_value_copy (src_value, dest_value);
79
0
    }
80
0
  return dest_value;
81
0
}
82
83
static void
84
value_free (GValue *value)
85
0
{
86
0
  if (G_VALUE_TYPE (value))
87
0
    g_value_unset (value);
88
0
  g_free (value);
89
0
}
90
91
static GPollFD *
92
pollfd_copy (GPollFD *src)
93
0
{
94
0
  GPollFD *dest = g_new0 (GPollFD, 1);
95
  /* just a couple of integers */
96
0
  memcpy (dest, src, sizeof (GPollFD));
97
0
  return dest;
98
0
}
99
100
void
101
_g_boxed_type_init (void)
102
75
{
103
75
  const GTypeInfo info = {
104
75
    0,                          /* class_size */
105
75
    NULL,                       /* base_init */
106
75
    NULL,                       /* base_destroy */
107
75
    NULL,                       /* class_init */
108
75
    NULL,                       /* class_destroy */
109
75
    NULL,                       /* class_data */
110
75
    0,                          /* instance_size */
111
75
    0,                          /* n_preallocs */
112
75
    NULL,                       /* instance_init */
113
75
    NULL,                       /* value_table */
114
75
  };
115
75
  const GTypeFundamentalInfo finfo = { G_TYPE_FLAG_DERIVABLE, };
116
75
  GType type G_GNUC_UNUSED  /* when compiling with G_DISABLE_ASSERT */;
117
118
  /* G_TYPE_BOXED
119
   */
120
75
  type = g_type_register_fundamental (G_TYPE_BOXED, g_intern_static_string ("GBoxed"), &info, &finfo,
121
75
              G_TYPE_FLAG_ABSTRACT | G_TYPE_FLAG_VALUE_ABSTRACT);
122
75
  g_assert (type == G_TYPE_BOXED);
123
75
}
124
125
static GString *
126
gstring_copy (GString *src_gstring)
127
0
{
128
0
  return g_string_new_len (src_gstring->str, src_gstring->len);
129
0
}
130
131
static void
132
gstring_free (GString *gstring)
133
0
{
134
0
  g_string_free (gstring, TRUE);
135
0
}
136
137
G_DEFINE_BOXED_TYPE (GClosure, g_closure, g_closure_ref, g_closure_unref)
138
G_DEFINE_BOXED_TYPE (GValue, g_value, value_copy, value_free)
139
G_DEFINE_BOXED_TYPE (GValueArray, g_value_array, g_value_array_copy, g_value_array_free)
140
G_DEFINE_BOXED_TYPE (GDate, g_date, g_date_copy, g_date_free)
141
/* the naming is a bit odd, but GString is obviously not G_TYPE_STRING */
142
G_DEFINE_BOXED_TYPE (GString, g_gstring, gstring_copy, gstring_free)
143
G_DEFINE_BOXED_TYPE (GHashTable, g_hash_table, g_hash_table_ref, g_hash_table_unref)
144
G_DEFINE_BOXED_TYPE (GArray, g_array, g_array_ref, g_array_unref)
145
G_DEFINE_BOXED_TYPE (GPtrArray, g_ptr_array,g_ptr_array_ref, g_ptr_array_unref)
146
G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_unref)
147
G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref)
148
G_DEFINE_BOXED_TYPE (GTree, g_tree, g_tree_ref, g_tree_unref)
149
150
G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref)
151
G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref)
152
153
#define g_variant_type_get_type g_variant_type_get_gtype
154
G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_variant_type_free)
155
#undef g_variant_type_get_type
156
157
G_DEFINE_BOXED_TYPE (GVariantBuilder, g_variant_builder, g_variant_builder_ref, g_variant_builder_unref)
158
G_DEFINE_BOXED_TYPE (GVariantDict, g_variant_dict, g_variant_dict_ref, g_variant_dict_unref)
159
160
G_DEFINE_BOXED_TYPE (GError, g_error, g_error_copy, g_error_free)
161
162
G_DEFINE_BOXED_TYPE (GDateTime, g_date_time, g_date_time_ref, g_date_time_unref)
163
G_DEFINE_BOXED_TYPE (GTimeZone, g_time_zone, g_time_zone_ref, g_time_zone_unref)
164
G_DEFINE_BOXED_TYPE (GKeyFile, g_key_file, g_key_file_ref, g_key_file_unref)
165
G_DEFINE_BOXED_TYPE (GMappedFile, g_mapped_file, g_mapped_file_ref, g_mapped_file_unref)
166
167
G_DEFINE_BOXED_TYPE (GMainLoop, g_main_loop, g_main_loop_ref, g_main_loop_unref)
168
G_DEFINE_BOXED_TYPE (GMainContext, g_main_context, g_main_context_ref, g_main_context_unref)
169
G_DEFINE_BOXED_TYPE (GSource, g_source, g_source_ref, g_source_unref)
170
G_DEFINE_BOXED_TYPE (GPollFD, g_pollfd, pollfd_copy, g_free)
171
G_DEFINE_BOXED_TYPE (GMarkupParseContext, g_markup_parse_context, g_markup_parse_context_ref, g_markup_parse_context_unref)
172
173
G_DEFINE_BOXED_TYPE (GThread, g_thread, g_thread_ref, g_thread_unref)
174
G_DEFINE_BOXED_TYPE (GChecksum, g_checksum, g_checksum_copy, g_checksum_free)
175
G_DEFINE_BOXED_TYPE (GUri, g_uri, g_uri_ref, g_uri_unref)
176
177
G_DEFINE_BOXED_TYPE (GOptionGroup, g_option_group, g_option_group_ref, g_option_group_unref)
178
179
/* This one can't use G_DEFINE_BOXED_TYPE (GStrv, g_strv, g_strdupv, g_strfreev) */
180
GType
181
g_strv_get_type (void)
182
0
{
183
0
  static gsize static_g_define_type_id = 0;
184
185
0
  if (g_once_init_enter (&static_g_define_type_id))
186
0
    {
187
0
      GType g_define_type_id =
188
0
        g_boxed_type_register_static (g_intern_static_string ("GStrv"),
189
0
                                      (GBoxedCopyFunc) g_strdupv,
190
0
                                      (GBoxedFreeFunc) g_strfreev);
191
192
0
      g_once_init_leave (&static_g_define_type_id, g_define_type_id);
193
0
    }
194
195
0
  return static_g_define_type_id;
196
0
}
197
198
GType
199
g_variant_get_gtype (void)
200
0
{
201
0
  return G_TYPE_VARIANT;
202
0
}
203
204
static void
205
boxed_proxy_value_init (GValue *value)
206
0
{
207
0
  value->data[0].v_pointer = NULL;
208
0
}
209
210
static void
211
boxed_proxy_value_free (GValue *value)
212
0
{
213
0
  if (value->data[0].v_pointer && !(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS))
214
0
    _g_type_boxed_free (G_VALUE_TYPE (value), value->data[0].v_pointer);
215
0
}
216
217
static void
218
boxed_proxy_value_copy (const GValue *src_value,
219
      GValue       *dest_value)
220
0
{
221
0
  if (src_value->data[0].v_pointer)
222
0
    dest_value->data[0].v_pointer = _g_type_boxed_copy (G_VALUE_TYPE (src_value), src_value->data[0].v_pointer);
223
0
  else
224
0
    dest_value->data[0].v_pointer = src_value->data[0].v_pointer;
225
0
}
226
227
static gpointer
228
boxed_proxy_value_peek_pointer (const GValue *value)
229
0
{
230
0
  return value->data[0].v_pointer;
231
0
}
232
233
static gchar*
234
boxed_proxy_collect_value (GValue      *value,
235
         guint        n_collect_values,
236
         GTypeCValue *collect_values,
237
         guint        collect_flags)
238
0
{
239
0
  if (!collect_values[0].v_pointer)
240
0
    value->data[0].v_pointer = NULL;
241
0
  else
242
0
    {
243
0
      if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
244
0
  {
245
0
    value->data[0].v_pointer = collect_values[0].v_pointer;
246
0
    value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
247
0
  }
248
0
      else
249
0
  value->data[0].v_pointer = _g_type_boxed_copy (G_VALUE_TYPE (value), collect_values[0].v_pointer);
250
0
    }
251
252
0
  return NULL;
253
0
}
254
255
static gchar*
256
boxed_proxy_lcopy_value (const GValue *value,
257
       guint         n_collect_values,
258
       GTypeCValue  *collect_values,
259
       guint         collect_flags)
260
0
{
261
0
  gpointer *boxed_p = collect_values[0].v_pointer;
262
263
0
  g_return_val_if_fail (boxed_p != NULL, g_strdup_printf ("value location for '%s' passed as NULL", G_VALUE_TYPE_NAME (value)));
264
265
0
  if (!value->data[0].v_pointer)
266
0
    *boxed_p = NULL;
267
0
  else if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
268
0
    *boxed_p = value->data[0].v_pointer;
269
0
  else
270
0
    *boxed_p = _g_type_boxed_copy (G_VALUE_TYPE (value), value->data[0].v_pointer);
271
272
0
  return NULL;
273
0
}
274
275
/**
276
 * g_boxed_type_register_static:
277
 * @name: Name of the new boxed type.
278
 * @boxed_copy: Boxed structure copy function.
279
 * @boxed_free: Boxed structure free function.
280
 *
281
 * This function creates a new %G_TYPE_BOXED derived type id for a new
282
 * boxed type with name @name. Boxed type handling functions have to be
283
 * provided to copy and free opaque boxed structures of this type.
284
 *
285
 * Returns: New %G_TYPE_BOXED derived type id for @name.
286
 */
287
GType
288
g_boxed_type_register_static (const gchar   *name,
289
            GBoxedCopyFunc boxed_copy,
290
            GBoxedFreeFunc boxed_free)
291
75
{
292
75
  static const GTypeValueTable vtable = {
293
75
    boxed_proxy_value_init,
294
75
    boxed_proxy_value_free,
295
75
    boxed_proxy_value_copy,
296
75
    boxed_proxy_value_peek_pointer,
297
75
    "p",
298
75
    boxed_proxy_collect_value,
299
75
    "p",
300
75
    boxed_proxy_lcopy_value,
301
75
  };
302
75
  GTypeInfo type_info = {
303
75
    0,      /* class_size */
304
75
    NULL,   /* base_init */
305
75
    NULL,   /* base_finalize */
306
75
    NULL,   /* class_init */
307
75
    NULL,   /* class_finalize */
308
75
    NULL,   /* class_data */
309
75
    0,      /* instance_size */
310
75
    0,      /* n_preallocs */
311
75
    NULL,   /* instance_init */
312
75
    &vtable,    /* value_table */
313
75
  };
314
75
  GType type;
315
316
75
  g_return_val_if_fail (name != NULL, 0);
317
75
  g_return_val_if_fail (boxed_copy != NULL, 0);
318
75
  g_return_val_if_fail (boxed_free != NULL, 0);
319
75
  g_return_val_if_fail (g_type_from_name (name) == 0, 0);
320
321
75
  type = g_type_register_static (G_TYPE_BOXED, name, &type_info, 0);
322
323
  /* install proxy functions upon successful registration */
324
75
  if (type)
325
75
    _g_type_boxed_init (type, boxed_copy, boxed_free);
326
327
75
  return type;
328
75
}
329
330
/**
331
 * g_boxed_copy:
332
 * @boxed_type: The type of @src_boxed.
333
 * @src_boxed: (not nullable): The boxed structure to be copied.
334
 * 
335
 * Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
336
 * 
337
 * Returns: (transfer full) (not nullable): The newly created copy of the boxed
338
 *    structure.
339
 */
340
gpointer
341
g_boxed_copy (GType         boxed_type,
342
        gconstpointer src_boxed)
343
0
{
344
0
  GTypeValueTable *value_table;
345
0
  gpointer dest_boxed;
346
347
0
  g_return_val_if_fail (G_TYPE_IS_BOXED (boxed_type), NULL);
348
0
  g_return_val_if_fail (G_TYPE_IS_ABSTRACT (boxed_type) == FALSE, NULL);
349
0
  g_return_val_if_fail (src_boxed != NULL, NULL);
350
351
0
  value_table = g_type_value_table_peek (boxed_type);
352
0
  g_assert (value_table != NULL);
353
354
  /* check if our proxying implementation is used, we can short-cut here */
355
0
  if (value_table->value_copy == boxed_proxy_value_copy)
356
0
    dest_boxed = _g_type_boxed_copy (boxed_type, (gpointer) src_boxed);
357
0
  else
358
0
    {
359
0
      GValue src_value, dest_value;
360
361
      /* we heavily rely on third-party boxed type value vtable
362
       * implementations to follow normal boxed value storage
363
       * (data[0].v_pointer is the boxed struct, and
364
       * data[1].v_uint holds the G_VALUE_NOCOPY_CONTENTS flag,
365
       * rest zero).
366
       * but then, we can expect that since we laid out the
367
       * g_boxed_*() API.
368
       * data[1].v_uint&G_VALUE_NOCOPY_CONTENTS shouldn't be set
369
       * after a copy.
370
       */
371
      /* equiv. to g_value_set_static_boxed() */
372
0
      value_meminit (&src_value, boxed_type);
373
0
      src_value.data[0].v_pointer = (gpointer) src_boxed;
374
0
      src_value.data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
375
376
      /* call third-party code copy function, fingers-crossed */
377
0
      value_meminit (&dest_value, boxed_type);
378
0
      value_table->value_copy (&src_value, &dest_value);
379
380
      /* double check and grouse if things went wrong */
381
0
      if (dest_value.data[1].v_ulong)
382
0
  g_warning ("the copy_value() implementation of type '%s' seems to make use of reserved GValue fields",
383
0
       g_type_name (boxed_type));
384
385
0
      dest_boxed = dest_value.data[0].v_pointer;
386
0
    }
387
388
0
  return dest_boxed;
389
0
}
390
391
/**
392
 * g_boxed_free:
393
 * @boxed_type: The type of @boxed.
394
 * @boxed: (not nullable): The boxed structure to be freed.
395
 *
396
 * Free the boxed structure @boxed which is of type @boxed_type.
397
 */
398
void
399
g_boxed_free (GType    boxed_type,
400
        gpointer boxed)
401
0
{
402
0
  GTypeValueTable *value_table;
403
404
0
  g_return_if_fail (G_TYPE_IS_BOXED (boxed_type));
405
0
  g_return_if_fail (G_TYPE_IS_ABSTRACT (boxed_type) == FALSE);
406
0
  g_return_if_fail (boxed != NULL);
407
408
0
  value_table = g_type_value_table_peek (boxed_type);
409
0
  g_assert (value_table != NULL);
410
411
  /* check if our proxying implementation is used, we can short-cut here */
412
0
  if (value_table->value_free == boxed_proxy_value_free)
413
0
    _g_type_boxed_free (boxed_type, boxed);
414
0
  else
415
0
    {
416
0
      GValue value;
417
418
      /* see g_boxed_copy() on why we think we can do this */
419
0
      value_meminit (&value, boxed_type);
420
0
      value.data[0].v_pointer = boxed;
421
0
      value_table->value_free (&value);
422
0
    }
423
0
}
424
425
/**
426
 * g_value_get_boxed:
427
 * @value: a valid #GValue of %G_TYPE_BOXED derived type
428
 *
429
 * Get the contents of a %G_TYPE_BOXED derived #GValue.
430
 *
431
 * Returns: (transfer none): boxed contents of @value
432
 */
433
gpointer
434
g_value_get_boxed (const GValue *value)
435
0
{
436
0
  g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), NULL);
437
0
  g_return_val_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value)), NULL);
438
439
0
  return value->data[0].v_pointer;
440
0
}
441
442
/**
443
 * g_value_dup_boxed: (skip)
444
 * @value: a valid #GValue of %G_TYPE_BOXED derived type
445
 *
446
 * Get the contents of a %G_TYPE_BOXED derived #GValue.  Upon getting,
447
 * the boxed value is duplicated and needs to be later freed with
448
 * g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
449
 * return_value);
450
 *
451
 * Returns: boxed contents of @value
452
 */
453
gpointer
454
g_value_dup_boxed (const GValue *value)
455
0
{
456
0
  g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), NULL);
457
0
  g_return_val_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value)), NULL);
458
459
0
  return value->data[0].v_pointer ? g_boxed_copy (G_VALUE_TYPE (value), value->data[0].v_pointer) : NULL;
460
0
}
461
462
static inline void
463
value_set_boxed_internal (GValue       *value,
464
        gconstpointer boxed,
465
        gboolean      need_copy,
466
        gboolean      need_free)
467
0
{
468
0
  if (!boxed)
469
0
    {
470
      /* just resetting to NULL might not be desired, need to
471
       * have value reinitialized also (for values defaulting
472
       * to other default value states than a NULL data pointer),
473
       * g_value_reset() will handle this
474
       */
475
0
      g_value_reset (value);
476
0
      return;
477
0
    }
478
479
0
  if (value->data[0].v_pointer && !(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS))
480
0
    g_boxed_free (G_VALUE_TYPE (value), value->data[0].v_pointer);
481
0
  value->data[1].v_uint = need_free ? 0 : G_VALUE_NOCOPY_CONTENTS;
482
0
  value->data[0].v_pointer = need_copy ? g_boxed_copy (G_VALUE_TYPE (value), boxed) : (gpointer) boxed;
483
0
}
484
485
/**
486
 * g_value_set_boxed:
487
 * @value: a valid #GValue of %G_TYPE_BOXED derived type
488
 * @v_boxed: (nullable): boxed value to be set
489
 *
490
 * Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
491
 */
492
void
493
g_value_set_boxed (GValue       *value,
494
       gconstpointer boxed)
495
0
{
496
0
  g_return_if_fail (G_VALUE_HOLDS_BOXED (value));
497
0
  g_return_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value)));
498
499
0
  value_set_boxed_internal (value, boxed, TRUE, TRUE);
500
0
}
501
502
/**
503
 * g_value_set_static_boxed:
504
 * @value: a valid #GValue of %G_TYPE_BOXED derived type
505
 * @v_boxed: (nullable): static boxed value to be set
506
 *
507
 * Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
508
 * The boxed value is assumed to be static, and is thus not duplicated
509
 * when setting the #GValue.
510
 */
511
void
512
g_value_set_static_boxed (GValue       *value,
513
        gconstpointer boxed)
514
0
{
515
0
  g_return_if_fail (G_VALUE_HOLDS_BOXED (value));
516
0
  g_return_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value)));
517
518
0
  value_set_boxed_internal (value, boxed, FALSE, FALSE);
519
0
}
520
521
/**
522
 * g_value_set_boxed_take_ownership:
523
 * @value: a valid #GValue of %G_TYPE_BOXED derived type
524
 * @v_boxed: (nullable): duplicated unowned boxed value to be set
525
 *
526
 * This is an internal function introduced mainly for C marshallers.
527
 *
528
 * Deprecated: 2.4: Use g_value_take_boxed() instead.
529
 */
530
void
531
g_value_set_boxed_take_ownership (GValue       *value,
532
          gconstpointer boxed)
533
0
{
534
0
  g_value_take_boxed (value, boxed);
535
0
}
536
537
/**
538
 * g_value_take_boxed:
539
 * @value: a valid #GValue of %G_TYPE_BOXED derived type
540
 * @v_boxed: (nullable): duplicated unowned boxed value to be set
541
 *
542
 * Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
543
 * and takes over the ownership of the caller’s reference to @v_boxed;
544
 * the caller doesn’t have to unref it any more.
545
 *
546
 * Since: 2.4
547
 */
548
void
549
g_value_take_boxed (GValue       *value,
550
        gconstpointer boxed)
551
0
{
552
0
  g_return_if_fail (G_VALUE_HOLDS_BOXED (value));
553
0
  g_return_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value)));
554
555
0
  value_set_boxed_internal (value, boxed, FALSE, TRUE);
556
0
}