From 6a4f8e5bb7284033568276d187b0d29c8dcb08e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 10 May 2024 17:52:01 +0200 Subject: [PATCH] girepository/girmodule: Use clearer scope for the build struct Allocate it only when needed avoiding manual memset --- girepository/girmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/girepository/girmodule.c b/girepository/girmodule.c index f3f259397..253415be9 100644 --- a/girepository/girmodule.c +++ b/girepository/girmodule.c @@ -481,7 +481,6 @@ gi_ir_module_build_typelib (GIIrModule *module) for (e = module->entries, i = 0; e; e = e->next, i++) { - GIIrTypelibBuild build; GIIrNode *node = e->data; if (strchr (node->name, '.')) @@ -524,6 +523,7 @@ gi_ir_module_build_typelib (GIIrModule *module) } else { + GIIrTypelibBuild build = {0}; old_offset = offset; offset2 = offset + gi_ir_node_get_size (node); @@ -532,7 +532,6 @@ gi_ir_module_build_typelib (GIIrModule *module) entry->offset = offset; entry->name = gi_ir_write_string (node->name, strings, data, &offset2); - memset (&build, 0, sizeof (build)); build.module = module; build.strings = strings; build.types = types;