diff options
author | Alexey Yerin <yyp@disroot.org> | 2023-06-03 11:39:46 +0300 |
---|---|---|
committer | Alexey Yerin <yyp@disroot.org> | 2023-06-03 11:39:46 +0300 |
commit | 5bbe71aa7e1e90851f586696304473d00d1c599d (patch) | |
tree | fea39c974e80a85a7181af44ebd3ec9ec102ced3 /cmd | |
parent | 616abb352df95663d9aefa9fc3432f52a6dc0d1d (diff) |
Fill uninitialized fields
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/hare-gi/context.ha | 6 | ||||
-rw-r--r-- | cmd/hare-gi/main.ha | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cmd/hare-gi/context.ha b/cmd/hare-gi/context.ha index d4f47fa..f1ff3d1 100644 --- a/cmd/hare-gi/context.ha +++ b/cmd/hare-gi/context.ha @@ -50,6 +50,12 @@ type context = struct { glib: *namespace, gobject: *namespace, }; +fn context_init() context = context { + current = null: *namespace, + glib = null: *namespace, + gobject = null: *namespace, + ... +}; fn context_finish(ctx: *context) void = { for (let i = 0z; i < len(ctx.namespaces); i += 1) { namespace_finish(&ctx.namespaces[i]); diff --git a/cmd/hare-gi/main.ha b/cmd/hare-gi/main.ha index 6aa1213..e0afc98 100644 --- a/cmd/hare-gi/main.ha +++ b/cmd/hare-gi/main.ha @@ -17,11 +17,7 @@ export fn main() void = { const cmd = getopt::parse(os::args, help...); defer getopt::finish(&cmd); - let ctx = context { - glib = null: *namespace, - gobject = null: *namespace, - ... - }; + let ctx = context_init(); defer context_finish(&ctx); let check = false; |