summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib.c12
-rw-r--r--linenoise/linenoise.c3
-rw-r--r--parser.c12
-rw-r--r--stream.h6
-rw-r--r--sysif.c12
-rw-r--r--tree.c8
6 files changed, 26 insertions, 27 deletions
diff --git a/lib.c b/lib.c
index 66e859f1..c61cf60d 100644
--- a/lib.c
+++ b/lib.c
@@ -8067,13 +8067,11 @@ ucnum cobj_handle_hash_op(val obj, int *count, ucnum seed)
return cobj_eq_hash_op(coerce(val, handle), count, seed);
}
-static struct cobj_ops cptr_ops = {
- cobj_equal_handle_op,
- cptr_print_op,
- cobj_destroy_stub_op,
- cobj_mark_op,
- cobj_handle_hash_op
-};
+static struct cobj_ops cptr_ops = cobj_ops_init(cobj_equal_handle_op,
+ cptr_print_op,
+ cobj_destroy_stub_op,
+ cobj_mark_op,
+ cobj_handle_hash_op);
val cptr_typed(mem_t *handle, val type_sym, struct cobj_ops *ops)
{
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index 83a08ec7..75721075 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -159,7 +159,7 @@ enum key_action {
};
static lino_os_t lino_os;
-static lino_t lino_list = { &lino_list, &lino_list };
+static lino_t lino_list;
volatile sig_atomic_t lino_list_busy;
static int atexit_registered = 0; /* Register atexit just 1 time. */
@@ -2840,4 +2840,5 @@ void lino_set_result(lino_t *ls, wchar_t *res)
void lino_init(lino_os_t *os)
{
lino_os = *os;
+ lino_list.next = lino_list.prev = &lino_list;
}
diff --git a/parser.c b/parser.c
index 6372032c..c6699988 100644
--- a/parser.c
+++ b/parser.c
@@ -107,13 +107,11 @@ static void parser_destroy(val obj)
free(p);
}
-static struct cobj_ops parser_ops = {
- eq,
- cobj_print_op,
- parser_destroy,
- parser_mark,
- cobj_eq_hash_op,
-};
+static struct cobj_ops parser_ops = cobj_ops_init(eq,
+ cobj_print_op,
+ parser_destroy,
+ parser_mark,
+ cobj_eq_hash_op);
void parser_common_init(parser_t *p)
{
diff --git a/stream.h b/stream.h
index 2d7688c6..14204d81 100644
--- a/stream.h
+++ b/stream.h
@@ -116,9 +116,9 @@ struct stdio_mode {
int redir[STDIO_MODE_NREDIRS][2];
};
-#define stdio_mode_init_blank { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }
-#define stdio_mode_init_r { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1 }
-#define stdio_mode_init_rpb { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, -1 }
+#define stdio_mode_init_blank { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, { { 0 } } }
+#define stdio_mode_init_r { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, { { 0 } } }
+#define stdio_mode_init_rpb { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, -1, { { 0 } } }
#define std_input (deref(lookup_var_l(nil, stdin_s)))
#define std_output (deref(lookup_var_l(nil, stdout_s)))
diff --git a/sysif.c b/sysif.c
index d4452b65..dd563b7b 100644
--- a/sysif.c
+++ b/sysif.c
@@ -2015,13 +2015,11 @@ static void cptr_dl_destroy_op(val obj)
}
}
-static struct cobj_ops cptr_dl_ops = {
- cobj_equal_handle_op,
- cptr_print_op,
- cptr_dl_destroy_op,
- cobj_mark_op,
- cobj_handle_hash_op
-};
+static struct cobj_ops cptr_dl_ops = cobj_ops_init(cobj_equal_handle_op,
+ cptr_print_op,
+ cptr_dl_destroy_op,
+ cobj_mark_op,
+ cobj_handle_hash_op);
static val dlopen_wrap(val name, val flags)
{
diff --git a/tree.c b/tree.c
index f4473b88..12c478ab 100644
--- a/tree.c
+++ b/tree.c
@@ -82,7 +82,7 @@ struct tree_diter {
val lastnode;
};
-#define tree_iter_init() { 0, tr_visited_nothing }
+#define tree_iter_init() { 0, tr_visited_nothing, { 0 } }
val tree_s, tree_iter_s, tree_fun_whitelist_s;
@@ -243,7 +243,11 @@ static val tn_build_tree(ucnum n, val x)
static void tr_rebuild(struct tree *tr, val node, val parent, ucnum size)
{
- obj_t dummy = { { TNOD } };
+#if CONFIG_GEN_GC
+ obj_t dummy = { { TNOD, 0, { 0 }, 0 } };
+#else
+ obj_t dummy = { { TNOD, { 0 }, 0 } };
+#endif
val flat = tn_flatten(node, &dummy);
val new_root = (tn_build_tree(size, flat), dummy.tn.left);