Bug Summary

File:ctk/ctkcssnodedeclaration.c
Warning:line 55, column 10
Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name ctkcssnodedeclaration.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/ctk -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -D G_LOG_DOMAIN="Ctk" -D G_LOG_USE_STRUCTURED=1 -D CTK_VERSION="3.25.5" -D CTK_BINARY_VERSION="3.0.0" -D CTK_COMPILATION -D CTK_PRINT_BACKEND_ENABLE_UNSUPPORTED -D CTK_LIBDIR="/usr/lib" -D CTK_LOCALEDIR="/usr/share/locale" -D CTK_DATADIR="/usr/share" -D CTK_DATA_PREFIX="/usr" -D CTK_SYSCONFDIR="/usr/etc" -D CTK_HOST="x86_64-pc-linux-gnu" -D CTK_PRINT_BACKENDS="file,cups" -D X11_DATA_PREFIX="/usr" -D ISO_CODES_PREFIX="" -I .. -I ../ctk -I .. -I ../cdk -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -D G_ENABLE_DEBUG -D G_ENABLE_CONSISTENCY_CHECKS -D GLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_66 -D GLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_66 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/atk-1.0 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/gio-unix-2.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/pango-1.0 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -D PIC -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/rootdir/ctk -ferror-limit 19 -fvisibility=hidden -fgnuc-version=4.2.1 -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-09-19-170505-43637-1 -x c ctkcssnodedeclaration.c
1/*
2 * Copyright © 2014 Benjamin Otte <otte@gnome.org>
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 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 Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "config.h"
19
20#include "ctkcssnodedeclarationprivate.h"
21#include "ctkwidgetpathprivate.h"
22
23#include <string.h>
24
25typedef struct _CtkRegion CtkRegion;
26
27struct _CtkRegion
28{
29 GQuark class_quark;
30 CtkRegionFlags flags;
31};
32
33struct _CtkCssNodeDeclaration {
34 guint refcount;
35 CtkJunctionSides junction_sides;
36 GType type;
37 const /* interned */ char *name;
38 const /* interned */ char *id;
39 CtkStateFlags state;
40 guint n_classes;
41 guint n_regions;
42 /* GQuark classes[n_classes]; */
43 /* CtkRegion region[n_regions]; */
44};
45
46static inline GQuark *
47get_classes (const CtkCssNodeDeclaration *decl)
48{
49 return (GQuark *) (decl + 1);
50}
51
52static inline CtkRegion *
53get_regions (const CtkCssNodeDeclaration *decl)
54{
55 return (CtkRegion *) (get_classes (decl) + decl->n_classes);
Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption
56}
57
58static inline gsize
59sizeof_node (guint n_classes,
60 guint n_regions)
61{
62 return sizeof (CtkCssNodeDeclaration)
63 + sizeof (GQuark) * n_classes
64 + sizeof (CtkRegion) * n_regions;
65}
66
67static inline gsize
68sizeof_this_node (CtkCssNodeDeclaration *decl)
69{
70 return sizeof_node (decl->n_classes, decl->n_regions);
71}
72
73static void
74ctk_css_node_declaration_make_writable (CtkCssNodeDeclaration **decl)
75{
76 if ((*decl)->refcount == 1)
77 return;
78
79 (*decl)->refcount--;
80
81 *decl = g_memdup2 (*decl, sizeof_this_node (*decl));
82 (*decl)->refcount = 1;
83}
84
85static void
86ctk_css_node_declaration_make_writable_resize (CtkCssNodeDeclaration **decl,
87 gsize offset,
88 gsize bytes_added,
89 gsize bytes_removed)
90{
91 gsize old_size = sizeof_this_node (*decl);
92 gsize new_size = old_size + bytes_added - bytes_removed;
93
94 if ((*decl)->refcount == 1)
95 {
96 if (bytes_removed > 0 && old_size - offset - bytes_removed > 0)
97 memmove (((char *) *decl) + offset, ((char *) *decl) + offset + bytes_removed, old_size - offset - bytes_removed);
98 *decl = g_realloc (*decl, new_size);
99 if (bytes_added > 0 && old_size - offset > 0)
100 memmove (((char *) *decl) + offset + bytes_added, ((char *) *decl) + offset, old_size - offset);
101 }
102 else
103 {
104 CtkCssNodeDeclaration *old = *decl;
105
106 old->refcount--;
107
108 *decl = g_malloc (new_size);
109 memcpy (*decl, old, offset);
110 if (old_size - offset - bytes_removed > 0)
111 memcpy (((char *) *decl) + offset + bytes_added, ((char *) old) + offset + bytes_removed, old_size - offset - bytes_removed);
112 (*decl)->refcount = 1;
113 }
114}
115
116CtkCssNodeDeclaration *
117ctk_css_node_declaration_new (void)
118{
119 static CtkCssNodeDeclaration empty = {
120 1, /* need to own a ref ourselves so the copy-on-write path kicks in when people change things */
121 0,
122 0,
123 NULL((void*)0),
124 NULL((void*)0),
125 0,
126 0,
127 0
128 };
129
130 return ctk_css_node_declaration_ref (&empty);
131}
132
133CtkCssNodeDeclaration *
134ctk_css_node_declaration_ref (CtkCssNodeDeclaration *decl)
135{
136 decl->refcount++;
137
138 return decl;
139}
140
141void
142ctk_css_node_declaration_unref (CtkCssNodeDeclaration *decl)
143{
144 decl->refcount--;
145 if (decl->refcount > 0)
146 return;
147
148 g_free (decl);
149}
150
151gboolean
152ctk_css_node_declaration_set_junction_sides (CtkCssNodeDeclaration **decl,
153 CtkJunctionSides junction_sides)
154{
155 if ((*decl)->junction_sides == junction_sides)
156 return FALSE(0);
157
158 ctk_css_node_declaration_make_writable (decl);
159 (*decl)->junction_sides = junction_sides;
160
161 return TRUE(!(0));
162}
163
164CtkJunctionSides
165ctk_css_node_declaration_get_junction_sides (const CtkCssNodeDeclaration *decl)
166{
167 return decl->junction_sides;
168}
169
170gboolean
171ctk_css_node_declaration_set_type (CtkCssNodeDeclaration **decl,
172 GType type)
173{
174 if ((*decl)->type == type)
175 return FALSE(0);
176
177 ctk_css_node_declaration_make_writable (decl);
178 (*decl)->type = type;
179
180 return TRUE(!(0));
181}
182
183GType
184ctk_css_node_declaration_get_type (const CtkCssNodeDeclaration *decl)
185{
186 return decl->type;
187}
188
189gboolean
190ctk_css_node_declaration_set_name (CtkCssNodeDeclaration **decl,
191 /*interned*/ const char *name)
192{
193 if ((*decl)->name == name)
194 return FALSE(0);
195
196 ctk_css_node_declaration_make_writable (decl);
197 (*decl)->name = name;
198
199 return TRUE(!(0));
200}
201
202/*interned*/ const char *
203ctk_css_node_declaration_get_name (const CtkCssNodeDeclaration *decl)
204{
205 return decl->name;
206}
207
208gboolean
209ctk_css_node_declaration_set_id (CtkCssNodeDeclaration **decl,
210 const char *id)
211{
212 id = g_intern_string (id);
213
214 if ((*decl)->id == id)
215 return FALSE(0);
216
217 ctk_css_node_declaration_make_writable (decl);
218 (*decl)->id = id;
219
220 return TRUE(!(0));
221}
222
223const char *
224ctk_css_node_declaration_get_id (const CtkCssNodeDeclaration *decl)
225{
226 return decl->id;
227}
228
229gboolean
230ctk_css_node_declaration_set_state (CtkCssNodeDeclaration **decl,
231 CtkStateFlags state)
232{
233 if ((*decl)->state == state)
234 return FALSE(0);
235
236 ctk_css_node_declaration_make_writable (decl);
237 (*decl)->state = state;
238
239 return TRUE(!(0));
240}
241
242CtkStateFlags
243ctk_css_node_declaration_get_state (const CtkCssNodeDeclaration *decl)
244{
245 return decl->state;
246}
247
248static gboolean
249find_class (const CtkCssNodeDeclaration *decl,
250 GQuark class_quark,
251 guint *position)
252{
253 gint min, max, mid;
254 gboolean found = FALSE(0);
255 GQuark *classes;
256 guint pos;
257
258 *position = 0;
259
260 if (decl->n_classes == 0)
261 return FALSE(0);
262
263 min = 0;
264 max = decl->n_classes - 1;
265 classes = get_classes (decl);
266
267 do
268 {
269 GQuark item;
270
271 mid = (min + max) / 2;
272 item = classes[mid];
273
274 if (class_quark == item)
275 {
276 found = TRUE(!(0));
277 pos = mid;
278 break;
279 }
280 else if (class_quark > item)
281 min = pos = mid + 1;
282 else
283 {
284 max = mid - 1;
285 pos = mid;
286 }
287 }
288 while (min <= max);
289
290 *position = pos;
291
292 return found;
293}
294
295gboolean
296ctk_css_node_declaration_add_class (CtkCssNodeDeclaration **decl,
297 GQuark class_quark)
298{
299 guint pos;
300
301 if (find_class (*decl, class_quark, &pos))
302 return FALSE(0);
303
304 ctk_css_node_declaration_make_writable_resize (decl,
305 (char *) &get_classes (*decl)[pos] - (char *) *decl,
306 sizeof (GQuark),
307 0);
308 (*decl)->n_classes++;
309 get_classes(*decl)[pos] = class_quark;
310
311 return TRUE(!(0));
312}
313
314gboolean
315ctk_css_node_declaration_remove_class (CtkCssNodeDeclaration **decl,
316 GQuark class_quark)
317{
318 guint pos;
319
320 if (!find_class (*decl, class_quark, &pos))
321 return FALSE(0);
322
323 ctk_css_node_declaration_make_writable_resize (decl,
324 (char *) &get_classes (*decl)[pos] - (char *) *decl,
325 0,
326 sizeof (GQuark));
327 (*decl)->n_classes--;
328
329 return TRUE(!(0));
330}
331
332gboolean
333ctk_css_node_declaration_clear_classes (CtkCssNodeDeclaration **decl)
334{
335 if ((*decl)->n_classes == 0)
336 return FALSE(0);
337
338 ctk_css_node_declaration_make_writable_resize (decl,
339 (char *) get_classes (*decl) - (char *) *decl,
340 0,
341 sizeof (GQuark) * (*decl)->n_classes);
342 (*decl)->n_classes = 0;
343
344 return TRUE(!(0));
345}
346
347gboolean
348ctk_css_node_declaration_has_class (const CtkCssNodeDeclaration *decl,
349 GQuark class_quark)
350{
351 guint pos;
352 GQuark *classes = get_classes (decl);
353
354 switch (decl->n_classes)
355 {
356 case 3:
357 if (classes[2] == class_quark)
358 return TRUE(!(0));
359
360 case 2:
361 if (classes[1] == class_quark)
362 return TRUE(!(0));
363
364 case 1:
365 if (classes[0] == class_quark)
366 return TRUE(!(0));
367
368 case 0:
369 return FALSE(0);
370
371 default:
372 return find_class (decl, class_quark, &pos);
373 }
374}
375
376const GQuark *
377ctk_css_node_declaration_get_classes (const CtkCssNodeDeclaration *decl,
378 guint *n_classes)
379{
380 *n_classes = decl->n_classes;
381
382 return get_classes (decl);
383}
384
385static gboolean
386find_region (const CtkCssNodeDeclaration *decl,
387 GQuark region_quark,
388 guint *position)
389{
390 gint min, max, mid;
391 gboolean found = FALSE(0);
392 CtkRegion *regions;
393 guint pos;
394
395 if (position)
396 *position = 0;
397
398 if (decl->n_regions == 0)
399 return FALSE(0);
400
401 min = 0;
402 max = decl->n_regions - 1;
403 regions = get_regions (decl);
404
405 do
406 {
407 GQuark item;
408
409 mid = (min + max) / 2;
410 item = regions[mid].class_quark;
411
412 if (region_quark == item)
413 {
414 found = TRUE(!(0));
415 pos = mid;
416 break;
417 }
418 else if (region_quark > item)
419 min = pos = mid + 1;
420 else
421 {
422 max = mid - 1;
423 pos = mid;
424 }
425 }
426 while (min <= max);
427
428 if (position)
429 *position = pos;
430
431 return found;
432}
433
434gboolean
435ctk_css_node_declaration_add_region (CtkCssNodeDeclaration **decl,
436 GQuark region_quark,
437 CtkRegionFlags flags)
438{
439 CtkRegion *regions;
440 guint pos;
441
442 if (find_region (*decl, region_quark, &pos))
443 return FALSE(0);
444
445 ctk_css_node_declaration_make_writable_resize (decl,
446 (char *) &get_regions (*decl)[pos] - (char *) *decl,
447 sizeof (CtkRegion),
448 0);
449 (*decl)->n_regions++;
450 regions = get_regions(*decl);
451 regions[pos].class_quark = region_quark;
452 regions[pos].flags = flags;
453
454 return TRUE(!(0));
455}
456
457gboolean
458ctk_css_node_declaration_remove_region (CtkCssNodeDeclaration **decl,
459 GQuark region_quark)
460{
461 guint pos;
462
463 if (!find_region (*decl, region_quark, &pos))
464 return FALSE(0);
465
466 ctk_css_node_declaration_make_writable_resize (decl,
467 (char *) &get_regions (*decl)[pos] - (char *) *decl,
468 0,
469 sizeof (CtkRegion));
470 (*decl)->n_regions--;
471
472 return TRUE(!(0));
473}
474
475gboolean
476ctk_css_node_declaration_clear_regions (CtkCssNodeDeclaration **decl)
477{
478 if ((*decl)->n_regions == 0)
479 return FALSE(0);
480
481 ctk_css_node_declaration_make_writable_resize (decl,
482 (char *) get_regions (*decl) - (char *) *decl,
483 0,
484 sizeof (CtkRegion) * (*decl)->n_regions);
485 (*decl)->n_regions = 0;
486
487 return TRUE(!(0));
488}
489
490gboolean
491ctk_css_node_declaration_has_region (const CtkCssNodeDeclaration *decl,
492 GQuark region_quark,
493 CtkRegionFlags *flags_return)
494{
495 guint pos;
496
497 if (!find_region (decl, region_quark, &pos))
498 {
499 if (flags_return)
500 *flags_return = 0;
501 return FALSE(0);
502 }
503
504 if (flags_return)
505 *flags_return = get_regions (decl)[pos].flags;
506
507 return TRUE(!(0));
508}
509
510GList *
511ctk_css_node_declaration_list_regions (const CtkCssNodeDeclaration *decl)
512{
513 CtkRegion *regions;
514 GList *result;
515 guint i;
516
517 regions = get_regions (decl);
518 result = NULL((void*)0);
519
520 for (i = 0; i < decl->n_regions; i++)
521 {
522 result = g_list_prepend (result, GUINT_TO_POINTER (regions[i].class_quark)((gpointer) (gulong) (regions[i].class_quark)));
523 }
524
525 return result;
526}
527
528guint
529ctk_css_node_declaration_hash (gconstpointer elem)
530{
531 const CtkCssNodeDeclaration *decl = elem;
532 GQuark *classes;
533 CtkRegion *regions;
534 guint hash, i;
535
536 hash = (guint) decl->type;
537 hash ^= GPOINTER_TO_UINT (decl->name)((guint) (gulong) (decl->name));
538 hash <<= 5;
539 hash ^= GPOINTER_TO_UINT (decl->id)((guint) (gulong) (decl->id));
540
541 classes = get_classes (decl);
542 for (i = 0; i < decl->n_classes; i++)
543 {
544 hash <<= 5;
545 hash += classes[i];
546 }
547
548 regions = get_regions (decl);
549 for (i = 0; i < decl->n_regions; i++)
550 {
551 hash <<= 5;
552 hash += regions[i].class_quark;
553 hash += regions[i].flags;
554 }
555
556 hash ^= ((guint) decl->junction_sides) << (sizeof (guint) * 8 - 5);
557 hash ^= decl->state;
558
559 return hash;
560}
561
562gboolean
563ctk_css_node_declaration_equal (gconstpointer elem1,
564 gconstpointer elem2)
565{
566 const CtkCssNodeDeclaration *decl1 = elem1;
567 const CtkCssNodeDeclaration *decl2 = elem2;
568 GQuark *classes1, *classes2;
569 CtkRegion *regions1, *regions2;
570 guint i;
571
572 if (decl1 == decl2)
573 return TRUE(!(0));
574
575 if (decl1->type != decl2->type)
576 return FALSE(0);
577
578 if (decl1->name != decl2->name)
579 return FALSE(0);
580
581 if (decl1->state != decl2->state)
582 return FALSE(0);
583
584 if (decl1->id != decl2->id)
585 return FALSE(0);
586
587 if (decl1->n_classes != decl2->n_classes)
588 return FALSE(0);
589
590 classes1 = get_classes (decl1);
591 classes2 = get_classes (decl2);
592 for (i = 0; i < decl1->n_classes; i++)
593 {
594 if (classes1[i] != classes2[i])
595 return FALSE(0);
596 }
597
598 if (decl1->n_regions != decl2->n_regions)
599 return FALSE(0);
600
601 regions1 = get_regions (decl1);
602 regions2 = get_regions (decl2);
603 for (i = 0; i < decl1->n_regions; i++)
604 {
605 if (regions1[i].class_quark != regions2[i].class_quark ||
606 regions1[i].flags != regions2[i].flags)
607 return FALSE(0);
608 }
609
610 if (decl1->junction_sides != decl2->junction_sides)
611 return FALSE(0);
612
613 return TRUE(!(0));
614}
615
616void
617ctk_css_node_declaration_add_to_widget_path (const CtkCssNodeDeclaration *decl,
618 CtkWidgetPath *path,
619 guint pos)
620{
621 GQuark *classes;
622 CtkRegion *regions;
623 guint i;
624
625 /* Set name and id */
626 ctk_widget_path_iter_set_object_name (path, pos, decl->name);
627 if (decl->id)
628 ctk_widget_path_iter_set_name (path, pos, decl->id);
629
630 /* Set widget regions */
631 regions = get_regions (decl);
632 for (i = 0; i < decl->n_regions; i++)
633 {
634G_GNUC_BEGIN_IGNORE_DEPRECATIONSclang diagnostic push clang diagnostic ignored "-Wdeprecated-declarations"
635 ctk_widget_path_iter_add_region (path, pos,
636 g_quark_to_string (regions[i].class_quark),
637 regions[i].flags);
638G_GNUC_END_IGNORE_DEPRECATIONSclang diagnostic pop
639 }
640
641 /* Set widget classes */
642 classes = get_classes (decl);
643 for (i = 0; i < decl->n_classes; i++)
644 {
645 ctk_widget_path_iter_add_qclass (path, pos, classes[i]);
646 }
647
648 /* Set widget state */
649 ctk_widget_path_iter_set_state (path, pos, decl->state);
650}
651
652/* Append the declaration to the string, in selector format */
653void
654ctk_css_node_declaration_print (const CtkCssNodeDeclaration *decl,
655 GString *string)
656{
657 static const char *state_names[] = {
658 "active",
659 "hover",
660 "selected",
661 "disabled",
662 "indeterminate",
663 "focus",
664 "backdrop",
665 "dir(ltr)",
666 "dir(rtl)",
667 "link",
668 "visited",
669 "checked",
670 "drop(active)"
671 };
672 const GQuark *classes;
673 guint i;
674
675 if (decl->name)
676 g_string_append (string, decl->name)(__builtin_constant_p (decl->name) ? __extension__ ({ const
char * const __val = (decl->name); g_string_append_len_inline
(string, __val, (__val != ((void*)0)) ? (gssize) strlen (((__val
) + !(__val))) : (gssize) -1); }) : g_string_append_len_inline
(string, decl->name, (gssize) -1))
;
677 else
678 g_string_append (string, g_type_name (decl->type))(__builtin_constant_p (g_type_name (decl->type)) ? __extension__
({ const char * const __val = (g_type_name (decl->type));
g_string_append_len_inline (string, __val, (__val != ((void*
)0)) ? (gssize) strlen (((__val) + !(__val))) : (gssize) -1);
}) : g_string_append_len_inline (string, g_type_name (decl->
type), (gssize) -1))
;
679
680 if (decl->id)
681 {
682 g_string_append_c (string, '#')g_string_append_c_inline (string, '#');
683 g_string_append (string, decl->id)(__builtin_constant_p (decl->id) ? __extension__ ({ const char
* const __val = (decl->id); g_string_append_len_inline (string
, __val, (__val != ((void*)0)) ? (gssize) strlen (((__val) + !
(__val))) : (gssize) -1); }) : g_string_append_len_inline (string
, decl->id, (gssize) -1))
;
684 }
685
686 classes = get_classes (decl);
687 for (i = 0; i < decl->n_classes; i++)
688 {
689 g_string_append_c (string, '.')g_string_append_c_inline (string, '.');
690 g_string_append (string, g_quark_to_string (classes[i]))(__builtin_constant_p (g_quark_to_string (classes[i])) ? __extension__
({ const char * const __val = (g_quark_to_string (classes[i]
)); g_string_append_len_inline (string, __val, (__val != ((void
*)0)) ? (gssize) strlen (((__val) + !(__val))) : (gssize) -1)
; }) : g_string_append_len_inline (string, g_quark_to_string (
classes[i]), (gssize) -1))
;
691 }
692
693 for (i = 0; i < G_N_ELEMENTS (state_names)(sizeof (state_names) / sizeof ((state_names)[0])); i++)
694 {
695 if (decl->state & (1 << i))
696 {
697 g_string_append_c (string, ':')g_string_append_c_inline (string, ':');
698 g_string_append (string, state_names[i])(__builtin_constant_p (state_names[i]) ? __extension__ ({ const
char * const __val = (state_names[i]); g_string_append_len_inline
(string, __val, (__val != ((void*)0)) ? (gssize) strlen (((__val
) + !(__val))) : (gssize) -1); }) : g_string_append_len_inline
(string, state_names[i], (gssize) -1))
;
699 }
700 }
701}