1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2025-07-25 19:37:52 +02:00

girepository/girmodule: Use clearer scope for the build struct

Allocate it only when needed avoiding manual memset
This commit is contained in:
Marco Trevisan (Treviño)
2024-05-10 17:52:01 +02:00
committed by Philip Withnall
parent 05f606f3c5
commit 6a4f8e5bb7

@@ -481,7 +481,6 @@ gi_ir_module_build_typelib (GIIrModule *module)
for (e = module->entries, i = 0; e; e = e->next, i++) for (e = module->entries, i = 0; e; e = e->next, i++)
{ {
GIIrTypelibBuild build;
GIIrNode *node = e->data; GIIrNode *node = e->data;
if (strchr (node->name, '.')) if (strchr (node->name, '.'))
@@ -524,6 +523,7 @@ gi_ir_module_build_typelib (GIIrModule *module)
} }
else else
{ {
GIIrTypelibBuild build = {0};
old_offset = offset; old_offset = offset;
offset2 = offset + gi_ir_node_get_size (node); offset2 = offset + gi_ir_node_get_size (node);
@@ -532,7 +532,6 @@ gi_ir_module_build_typelib (GIIrModule *module)
entry->offset = offset; entry->offset = offset;
entry->name = gi_ir_write_string (node->name, strings, data, &offset2); entry->name = gi_ir_write_string (node->name, strings, data, &offset2);
memset (&build, 0, sizeof (build));
build.module = module; build.module = module;
build.strings = strings; build.strings = strings;
build.types = types; build.types = types;