mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 22:30:22 +00:00
builder: Remove root special case from precompile
This commit is contained in:
parent
6c8b505f93
commit
9c12b58e32
@ -374,9 +374,6 @@ marshal_tree (GString *marshaled,
|
|||||||
case RECORD_TYPE_ELEMENT:
|
case RECORD_TYPE_ELEMENT:
|
||||||
element = (RecordDataElement *)node;
|
element = (RecordDataElement *)node;
|
||||||
|
|
||||||
/* Special case the root */
|
|
||||||
if (element->parent != NULL)
|
|
||||||
{
|
|
||||||
marshal_uint32 (marshaled, RECORD_TYPE_ELEMENT);
|
marshal_uint32 (marshaled, RECORD_TYPE_ELEMENT);
|
||||||
marshal_uint32 (marshaled, element->name->offset);
|
marshal_uint32 (marshaled, element->name->offset);
|
||||||
marshal_uint32 (marshaled, element->n_attributes);
|
marshal_uint32 (marshaled, element->n_attributes);
|
||||||
@ -388,12 +385,10 @@ marshal_tree (GString *marshaled,
|
|||||||
marshal_uint32 (marshaled, attr_names[i]->offset);
|
marshal_uint32 (marshaled, attr_names[i]->offset);
|
||||||
marshal_uint32 (marshaled, attr_values[i]->offset);
|
marshal_uint32 (marshaled, attr_values[i]->offset);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (l = element->children.head; l != NULL; l = l->next)
|
for (l = element->children.head; l != NULL; l = l->next)
|
||||||
marshal_tree (marshaled, l->data);
|
marshal_tree (marshaled, l->data);
|
||||||
|
|
||||||
if (element->parent != NULL)
|
|
||||||
marshal_uint32 (marshaled, RECORD_TYPE_END_ELEMENT);
|
marshal_uint32 (marshaled, RECORD_TYPE_END_ELEMENT);
|
||||||
break;
|
break;
|
||||||
case RECORD_TYPE_TEXT:
|
case RECORD_TYPE_TEXT:
|
||||||
@ -407,6 +402,17 @@ marshal_tree (GString *marshaled,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
marshal_root (GString *marshaled,
|
||||||
|
RecordDataNode *node)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
RecordDataElement *element = (RecordDataElement *)node;
|
||||||
|
|
||||||
|
for (l = element->children.head; l != NULL; l = l->next)
|
||||||
|
marshal_tree (marshaled, l->data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _gtk_buildable_parser_precompile:
|
* _gtk_buildable_parser_precompile:
|
||||||
* @text: chunk of text to parse
|
* @text: chunk of text to parse
|
||||||
@ -481,7 +487,7 @@ _gtk_buildable_parser_precompile (const char *text,
|
|||||||
g_string_append_len (marshaled, s->string, s->len + 1);
|
g_string_append_len (marshaled, s->string, s->len + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
marshal_tree (marshaled, &data.root->base);
|
marshal_root (marshaled, &data.root->base);
|
||||||
|
|
||||||
record_data_node_free (&data.root->base);
|
record_data_node_free (&data.root->base);
|
||||||
g_string_chunk_free (data.chunks);
|
g_string_chunk_free (data.chunks);
|
||||||
|
Loading…
Reference in New Issue
Block a user