about summary refs log tree commit diff
path: root/cmd
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2023-06-03 11:39:46 +0300
committerAlexey Yerin <yyp@disroot.org>2023-06-03 11:39:46 +0300
commit5bbe71aa7e1e90851f586696304473d00d1c599d (patch)
treefea39c974e80a85a7181af44ebd3ec9ec102ced3 /cmd
parent616abb352df95663d9aefa9fc3432f52a6dc0d1d (diff)
Fill uninitialized fields
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hare-gi/context.ha6
-rw-r--r--cmd/hare-gi/main.ha6
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;