diff --git a/libc3/env.c b/libc3/env.c
index ebb3b73..77ae297 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -820,7 +820,7 @@ s_list ** env_get_struct_type_spec (s_env *env,
assert(env);
assert(module);
assert(dest);
- tag_init_sym_1(&tag_defstruct, "defstruct");
+ tag_init_sym(&tag_defstruct, &g_sym_defstruct);
tag_init_sym(&tag_module, module);
tag_init_var(&tag_var);
if (! env_module_maybe_reload(env, module, &env->facts))
@@ -959,12 +959,12 @@ bool env_module_load (s_env *env, const s_sym *module, s_facts *facts)
}
str_clean(&path);
tag_init_sym(&tag_module_name, module);
- tag_init_sym_1(&tag_load_time, "load_time");
+ tag_init_sym(&tag_load_time, &g_sym_load_time);
facts_replace_tags(facts, &tag_module_name, &tag_load_time,
&tag_time);
tag_clean(&tag_time);
if (env_get_struct_type_spec(env, module, &st_spec)) {
- tag_init_sym_1(&tag_struct_type, "struct_type");
+ tag_init_sym(&tag_struct_type, &g_sym_struct_type);
tag_st.type = TAG_STRUCT_TYPE;
st = &tag_st.data.struct_type;
struct_type_init(st, module, st_spec);
@@ -1202,7 +1202,7 @@ bool env_struct_type_exists (s_env *env, const s_sym *module)
assert(env);
assert(module);
tag_init_sym(&tag_module, module);
- tag_init_sym_1(&tag_defstruct, "defstruct");
+ tag_init_sym(&tag_defstruct, &g_sym_defstruct);
tag_init_var(&tag_var);
env_module_maybe_reload(env, module, &env->facts);
facts_with_tags(&env->facts, &cursor, &tag_module,
@@ -1225,7 +1225,7 @@ const s_struct_type * env_struct_type_find (s_env *env,
assert(env);
assert(module);
tag_init_sym(&tag_module, module);
- tag_init_sym_1(&tag_struct_type, "struct_type");
+ tag_init_sym(&tag_struct_type, &g_sym_struct_type);
tag_init_var(&tag_var);
env_module_maybe_reload(env, module, &env->facts);
facts_with(&env->facts, &cursor, (t_facts_spec) {
diff --git a/libc3/list_init.c b/libc3/list_init.c
index 9e407fd..d5836ac 100644
--- a/libc3/list_init.c
+++ b/libc3/list_init.c
@@ -322,17 +322,6 @@ s_list * list_init_sym (s_list *list, const s_sym *sym, s_list *next)
return list;
}
-s_list * list_init_sym_1 (s_list *list, const char *p, s_list *next)
-{
- s_list tmp;
- assert(list);
- list_init(&tmp, next);
- if (! tag_init_sym_1(&tmp.tag, p))
- return NULL;
- *list = tmp;
- return list;
-}
-
s_list * list_init_tuple (s_list *list, uw count, s_list *next)
{
s_list tmp;
@@ -763,19 +752,6 @@ s_list * list_new_sym (const s_sym *sym, s_list *next)
return list;
}
-s_list * list_new_sym_1 (const char *p, s_list *next)
-{
- s_list *list;
- list = list_new(next);
- if (! list)
- return NULL;
- if (! tag_init_sym_1(&list->tag, p)) {
- free(list);
- return NULL;
- }
- return list;
-}
-
s_list * list_new_tuple (uw count, s_list *next)
{
s_list *list;
diff --git a/libc3/list_init.h b/libc3/list_init.h
index e47ece0..d9dbd49 100644
--- a/libc3/list_init.h
+++ b/libc3/list_init.h
@@ -53,7 +53,6 @@ s_list * list_init_struct_with_data (s_list *list, const s_sym *module,
s_list *next);
s_list * list_init_sw (s_list *list, sw i, s_list *next);
s_list * list_init_sym (s_list *list, const s_sym *sym, s_list *next);
-s_list * list_init_sym_1 (s_list *list, const char *p, s_list *next);
s_list * list_init_tuple (s_list *list, uw count, s_list *next);
s_list * list_init_tuple_2 (s_list *list, const s_tag *a,
const s_tag *b, s_list *next);
@@ -98,7 +97,6 @@ s_list * list_new_struct_with_data (const s_sym *module,
s_list *next);
s_list * list_new_sw (sw i, s_list *next);
s_list * list_new_sym (const s_sym *sym, s_list *next);
-s_list * list_new_sym_1 (const char *p, s_list *next);
s_list * list_new_tuple (uw count, s_list *next);
s_list * list_new_tuple_2 (const s_tag *a, const s_tag *b,
s_list *next);
@@ -141,7 +139,6 @@ s_list * list_struct_with_data (s_list *list, const s_sym *module,
bool free_data, void *data);
s_list * list_sw (s_list *list, sw i);
s_list * list_sym (s_list *list, const s_sym *sym);
-s_list * list_sym_1 (s_list *list, const char *p);
s_list * list_tuple (s_list *list, uw count);
s_list * list_tuple_2 (s_list *list, const s_tag *a, const s_tag *b);
s_list * list_time (s_list *list);
diff --git a/libc3/sym.c b/libc3/sym.c
index 0e2acde..8bdfab4 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -14,54 +14,57 @@
#include <string.h>
#include "c3.h"
-const s_sym g_sym__brackets = {{{NULL}, 2, {"[]"}}};
-const s_sym g_sym__paren = {{{NULL}, 2, {"()"}}};
-const s_sym g_sym_Array = {{{NULL}, 5, {"Array"}}};
-const s_sym g_sym_Bool = {{{NULL}, 4, {"Bool"}}};
-const s_sym g_sym_C3 = {{{NULL}, 2, {"C3"}}};
-const s_sym g_sym_Call = {{{NULL}, 4, {"Call"}}};
-const s_sym g_sym_Cfn = {{{NULL}, 3, {"Cfn"}}};
-const s_sym g_sym_Character = {{{NULL}, 9, {"Character"}}};
-const s_sym g_sym_Char__star = {{{NULL}, 5, {"Char*"}}};
-const s_sym g_sym_F32 = {{{NULL}, 3, {"F32"}}};
-const s_sym g_sym_F64 = {{{NULL}, 3, {"F64"}}};
-const s_sym g_sym_Fact = {{{NULL}, 4, {"Fact"}}};
-const s_sym g_sym_Fn = {{{NULL}, 2, {"Fn"}}};
-const s_sym g_sym_Ident = {{{NULL}, 5, {"Ident"}}};
-const s_sym g_sym_Integer = {{{NULL}, 7, {"Integer"}}};
-const s_sym g_sym_List = {{{NULL}, 4, {"List"}}};
-const s_sym g_sym_Map = {{{NULL}, 3, {"Map"}}};
-const s_sym g_sym_Ptag = {{{NULL}, 4, {"Ptag"}}};
-const s_sym g_sym_Ptr = {{{NULL}, 3, {"Ptr"}}};
-const s_sym g_sym_PtrFree = {{{NULL}, 7, {"PtrFree"}}};
-const s_sym g_sym_Quote = {{{NULL}, 5, {"Quote"}}};
-const s_sym g_sym_Result = {{{NULL}, 6, {"Result"}}};
-const s_sym g_sym_S8 = {{{NULL}, 2, {"S8"}}};
-const s_sym g_sym_S16 = {{{NULL}, 3, {"S16"}}};
-const s_sym g_sym_S32 = {{{NULL}, 3, {"S32"}}};
-const s_sym g_sym_S64 = {{{NULL}, 3, {"S64"}}};
-const s_sym g_sym_Str = {{{NULL}, 3, {"Str"}}};
-const s_sym g_sym_Struct = {{{NULL}, 6, {"Struct"}}};
-const s_sym g_sym_StructType = {{{NULL}, 10, {"StructType"}}};
-const s_sym g_sym_Sw = {{{NULL}, 2, {"Sw"}}};
-const s_sym g_sym_Sym = {{{NULL}, 3, {"Sym"}}};
-const s_sym g_sym_Tag = {{{NULL}, 3, {"Tag"}}};
-const s_sym g_sym_Tuple = {{{NULL}, 5, {"Tuple"}}};
-const s_sym g_sym_U8 = {{{NULL}, 2, {"U8"}}};
-const s_sym g_sym_U16 = {{{NULL}, 3, {"U16"}}};
-const s_sym g_sym_U32 = {{{NULL}, 3, {"U32"}}};
-const s_sym g_sym_U64 = {{{NULL}, 3, {"U64"}}};
-const s_sym g_sym_Uw = {{{NULL}, 2, {"Uw"}}};
-const s_sym g_sym_Var = {{{NULL}, 3, {"Var"}}};
-const s_sym g_sym_Void = {{{NULL}, 4, {"Void"}}};
-const s_sym g_sym_cast = {{{NULL}, 4, {"cast"}}};
-const s_sym g_sym_r = {{{NULL}, 1, {"r"}}};
-const s_sym g_sym_rw = {{{NULL}, 2, {"rw"}}};
-const s_sym g_sym_rwx = {{{NULL}, 3, {"rwx"}}};
-const s_sym g_sym_rx = {{{NULL}, 2, {"rx"}}};
-const s_sym g_sym_w = {{{NULL}, 1, {"w"}}};
-const s_sym g_sym_wx = {{{NULL}, 2, {"wx"}}};
-const s_sym g_sym_x = {{{NULL}, 1, {"x"}}};
+const s_sym g_sym__brackets = {{{NULL}, 2, {"[]"}}};
+const s_sym g_sym__paren = {{{NULL}, 2, {"()"}}};
+const s_sym g_sym_Array = {{{NULL}, 5, {"Array"}}};
+const s_sym g_sym_Bool = {{{NULL}, 4, {"Bool"}}};
+const s_sym g_sym_C3 = {{{NULL}, 2, {"C3"}}};
+const s_sym g_sym_Call = {{{NULL}, 4, {"Call"}}};
+const s_sym g_sym_Cfn = {{{NULL}, 3, {"Cfn"}}};
+const s_sym g_sym_Character = {{{NULL}, 9, {"Character"}}};
+const s_sym g_sym_Char__star = {{{NULL}, 5, {"Char*"}}};
+const s_sym g_sym_F32 = {{{NULL}, 3, {"F32"}}};
+const s_sym g_sym_F64 = {{{NULL}, 3, {"F64"}}};
+const s_sym g_sym_Fact = {{{NULL}, 4, {"Fact"}}};
+const s_sym g_sym_Fn = {{{NULL}, 2, {"Fn"}}};
+const s_sym g_sym_Ident = {{{NULL}, 5, {"Ident"}}};
+const s_sym g_sym_Integer = {{{NULL}, 7, {"Integer"}}};
+const s_sym g_sym_List = {{{NULL}, 4, {"List"}}};
+const s_sym g_sym_Map = {{{NULL}, 3, {"Map"}}};
+const s_sym g_sym_Ptag = {{{NULL}, 4, {"Ptag"}}};
+const s_sym g_sym_Ptr = {{{NULL}, 3, {"Ptr"}}};
+const s_sym g_sym_PtrFree = {{{NULL}, 7, {"PtrFree"}}};
+const s_sym g_sym_Quote = {{{NULL}, 5, {"Quote"}}};
+const s_sym g_sym_Result = {{{NULL}, 6, {"Result"}}};
+const s_sym g_sym_S8 = {{{NULL}, 2, {"S8"}}};
+const s_sym g_sym_S16 = {{{NULL}, 3, {"S16"}}};
+const s_sym g_sym_S32 = {{{NULL}, 3, {"S32"}}};
+const s_sym g_sym_S64 = {{{NULL}, 3, {"S64"}}};
+const s_sym g_sym_Str = {{{NULL}, 3, {"Str"}}};
+const s_sym g_sym_Struct = {{{NULL}, 6, {"Struct"}}};
+const s_sym g_sym_StructType = {{{NULL}, 10, {"StructType"}}};
+const s_sym g_sym_Sw = {{{NULL}, 2, {"Sw"}}};
+const s_sym g_sym_Sym = {{{NULL}, 3, {"Sym"}}};
+const s_sym g_sym_Tag = {{{NULL}, 3, {"Tag"}}};
+const s_sym g_sym_Tuple = {{{NULL}, 5, {"Tuple"}}};
+const s_sym g_sym_U8 = {{{NULL}, 2, {"U8"}}};
+const s_sym g_sym_U16 = {{{NULL}, 3, {"U16"}}};
+const s_sym g_sym_U32 = {{{NULL}, 3, {"U32"}}};
+const s_sym g_sym_U64 = {{{NULL}, 3, {"U64"}}};
+const s_sym g_sym_Uw = {{{NULL}, 2, {"Uw"}}};
+const s_sym g_sym_Var = {{{NULL}, 3, {"Var"}}};
+const s_sym g_sym_Void = {{{NULL}, 4, {"Void"}}};
+const s_sym g_sym_defstruct = {{{NULL}, 9, {"defstruct"}}};
+const s_sym g_sym_cast = {{{NULL}, 4, {"cast"}}};
+const s_sym g_sym_load_time = {{{NULL}, 9, {"load_time"}}};
+const s_sym g_sym_r = {{{NULL}, 1, {"r"}}};
+const s_sym g_sym_rw = {{{NULL}, 2, {"rw"}}};
+const s_sym g_sym_rwx = {{{NULL}, 3, {"rwx"}}};
+const s_sym g_sym_rx = {{{NULL}, 2, {"rx"}}};
+const s_sym g_sym_struct_type = {{{NULL}, 11, {"struct_type"}}};
+const s_sym g_sym_w = {{{NULL}, 1, {"w"}}};
+const s_sym g_sym_wx = {{{NULL}, 2, {"wx"}}};
+const s_sym g_sym_x = {{{NULL}, 1, {"x"}}};
static s_sym_list * g_sym_list = NULL;
@@ -230,10 +233,13 @@ void sym_init_g_sym (void)
sym_intern(&g_sym_Var, NULL);
sym_intern(&g_sym_Void, NULL);
sym_intern(&g_sym_cast, NULL);
+ sym_intern(&g_sym_defstruct, NULL);
+ sym_intern(&g_sym_load_time, NULL);
sym_intern(&g_sym_r, NULL);
sym_intern(&g_sym_rw, NULL);
sym_intern(&g_sym_rwx, NULL);
sym_intern(&g_sym_rx, NULL);
+ sym_intern(&g_sym_struct_type, NULL);
sym_intern(&g_sym_w, NULL);
sym_intern(&g_sym_wx, NULL);
sym_intern(&g_sym_x, NULL);
diff --git a/libc3/sym.h b/libc3/sym.h
index 6168a41..f4f1c9f 100644
--- a/libc3/sym.h
+++ b/libc3/sym.h
@@ -66,11 +66,14 @@ extern const s_sym g_sym_U64;
extern const s_sym g_sym_Uw;
extern const s_sym g_sym_Var;
extern const s_sym g_sym_Void;
+ extern const s_sym g_sym_defstruct;
extern const s_sym g_sym_cast;
+ extern const s_sym g_sym_load_time;
extern const s_sym g_sym_r;
extern const s_sym g_sym_rw;
extern const s_sym g_sym_rwx;
extern const s_sym g_sym_rx;
+ extern const s_sym g_sym_struct_type;
extern const s_sym g_sym_w;
extern const s_sym g_sym_wx;
extern const s_sym g_sym_x;
diff --git a/libc3/tag_init.c b/libc3/tag_init.c
index 6e6082b..7ce0550 100644
--- a/libc3/tag_init.c
+++ b/libc3/tag_init.c
@@ -315,17 +315,6 @@ s_tag * tag_init_sym (s_tag *tag, const s_sym *sym)
return tag;
}
-s_tag * tag_init_sym_1 (s_tag *tag, const char *p)
-{
- s_tag tmp = {0};
- assert(tag);
- tmp.type = TAG_SYM;
- if (! sym_init_1(&tmp.data.sym, p))
- return NULL;
- *tag = tmp;
- return tag;
-}
-
s_tag * tag_init_tuple (s_tag *tag, uw count)
{
s_tag tmp = {0};
@@ -773,21 +762,6 @@ s_tag * tag_new_sym (const s_sym *sym)
return tag;
}
-s_tag * tag_new_sym_1 (const char *p)
-{
- s_tag *tag;
- if (! (tag = calloc(1, sizeof(s_tag)))) {
- warn("tag_new_sym_1: calloc");
- return NULL;
- }
- tag->type = TAG_SYM;
- if (! sym_init_1(&tag->data.sym, p)) {
- free(tag);
- return NULL;
- }
- return tag;
-}
-
s_tag * tag_new_tuple (uw count)
{
s_tag *tag;
@@ -1203,18 +1177,6 @@ s_tag * tag_sym (s_tag *tag, const s_sym *sym)
return tag;
}
-s_tag * tag_sym_1 (s_tag *tag, const char *p)
-{
- s_tag tmp = {0};
- assert(tag);
- tag_clean(tag);
- tmp.type = TAG_SYM;
- if (! sym_init_1(&tmp.data.sym, p))
- return NULL;
- *tag = tmp;
- return tag;
-}
-
s_tag * tag_tuple (s_tag *tag, uw count)
{
s_tag tmp = {0};
diff --git a/libc3/tag_init.h b/libc3/tag_init.h
index 7947320..b31e3b7 100644
--- a/libc3/tag_init.h
+++ b/libc3/tag_init.h
@@ -45,7 +45,6 @@ s_tag * tag_init_struct_with_data (s_tag *tag, const s_sym *module,
bool free_data, void *data);
s_tag * tag_init_sw (s_tag *tag, sw i);
s_tag * tag_init_sym (s_tag *tag, const s_sym *sym);
-s_tag * tag_init_sym_1 (s_tag *tag, const char *p);
s_tag * tag_init_tuple (s_tag *tag, uw count);
s_tag * tag_init_tuple_2 (s_tag *tag, const s_tag *a, const s_tag *b);
s_tag * tag_init_time (s_tag *tag);
@@ -87,7 +86,6 @@ s_tag * tag_new_struct_with_data (const s_sym *module, bool free_data,
void *data);
s_tag * tag_new_sw (sw i);
s_tag * tag_new_sym (const s_sym *sym);
-s_tag * tag_new_sym_1 (const char *p);
s_tag * tag_new_tuple (uw count);
s_tag * tag_new_tuple_2 (const s_tag *a, const s_tag *b);
s_tag * tag_new_time (void);
@@ -129,7 +127,6 @@ s_tag * tag_struct_with_data (s_tag *tag, const s_sym *module,
bool free_data, void *data);
s_tag * tag_sw (s_tag *tag, sw i);
s_tag * tag_sym (s_tag *tag, const s_sym *sym);
-s_tag * tag_sym_1 (s_tag *tag, const char *p);
s_tag * tag_tuple (s_tag *tag, uw count);
s_tag * tag_tuple_2 (s_tag *tag, const s_tag *a, const s_tag *b);
s_tag * tag_time (s_tag *tag);
diff --git a/libc3/tag_init.rb b/libc3/tag_init.rb
index 066580e..2ba03bc 100644
--- a/libc3/tag_init.rb
+++ b/libc3/tag_init.rb
@@ -361,7 +361,6 @@ class TagInitList
[Arg.new("sw", "i")]),
TagInit.new("sym", "TAG_SYM", :init_mode_direct,
[Arg.new("const s_sym *", "sym")]),
- TagInit1.new("sym", "1", "TAG_SYM", :init_mode_init),
TagInit.new("tuple", "TAG_TUPLE", :init_mode_init,
[Arg.new("uw", "count")]),
TagInit.new("tuple", "2", "TAG_TUPLE", :init_mode_init,
diff --git a/libc3/window/cairo/demo/flies.c b/libc3/window/cairo/demo/flies.c
index 247327f..bb32f73 100644
--- a/libc3/window/cairo/demo/flies.c
+++ b/libc3/window/cairo/demo/flies.c
@@ -60,14 +60,14 @@ bool flies_load (s_sequence *seq)
s_map *map;
tag_map(&seq->tag, 4);
map = &seq->tag.data.map;
- tag_init_sym_1( map->key + 0, "board");
+ tag_init_sym( map->key + 0, sym_1("board"));
tag_init_array(map->value + 0, sym_1("U8"),
2, (uw[]) {BOARD_SIZE, BOARD_SIZE});
- tag_init_sym_1(map->key + 1, "in");
+ tag_init_sym(map->key + 1, sym_1("in"));
tag_init_uw( map->value + 1, 0);
- tag_init_sym_1(map->key + 2, "out");
+ tag_init_sym(map->key + 2, sym_1("out"));
tag_init_uw( map->value + 2, 0);
- tag_init_sym_1(map->key + 3, "t");
+ tag_init_sym(map->key + 3, sym_1("t"));
tag_init_uw( map->value + 3, 0);
board = &map->value[0].data.array;
board->data = malloc(board->size);
diff --git a/libc3/window/cairo/demo/toasters.c b/libc3/window/cairo/demo/toasters.c
index ea59aac..cef5ddb 100644
--- a/libc3/window/cairo/demo/toasters.c
+++ b/libc3/window/cairo/demo/toasters.c
@@ -65,9 +65,9 @@ static void toast_render (s_tag *toast, s_window_cairo *window,
static s_tag * toaster_init (s_tag *toaster, f64 y)
{
tag_init_map(toaster, 2);
- tag_init_sym_1(toaster->data.map.key + 0, "x");
+ tag_init_sym(toaster->data.map.key + 0, sym_1("x"));
tag_init_f64(toaster->data.map.value + 0, -150);
- tag_init_sym_1(toaster->data.map.key + 1, "y");
+ tag_init_sym(toaster->data.map.key + 1, sym_1("y"));
tag_init_f64(toaster->data.map.value + 1, y);
return toaster;
}
@@ -103,9 +103,9 @@ bool toasters_load (s_sequence *seq)
s_map *map;
tag_map(&seq->tag, 2);
map = &seq->tag.data.map;
- tag_init_sym_1( map->key + 0, "toasters");
+ tag_init_sym( map->key + 0, sym_1("toasters"));
tag_init_list(map->value + 0, NULL);
- tag_init_sym_1( map->key + 1, "toasts");
+ tag_init_sym( map->key + 1, sym_1("toasts"));
tag_init_list(map->value + 1, NULL);
return true;
}
@@ -153,9 +153,9 @@ bool toasters_render_toasts (s_list **toasts, s_window_cairo *window,
y += 170.0;
*toasts = list_new_map(2, *toasts);
map = &(*toasts)->tag.data.map;
- tag_init_sym_1(map->key + 0, "toasts");
+ tag_init_sym(map->key + 0, sym_1("toasts"));
tag_init_list(map->value + 0, NULL);
- tag_init_sym_1(map->key + 1, "y");
+ tag_init_sym(map->key + 1, sym_1("y"));
tag_init_f64(map->value + 1, y);
}
i = *toasts;
@@ -206,9 +206,9 @@ bool toasters_render_toasters (s_list **toasters,
y += 170.0;
*toasters = list_new_map(2, *toasters);
map = &(*toasters)->tag.data.map;
- tag_init_sym_1(map->key + 0, "toasters");
+ tag_init_sym(map->key + 0, sym_1("toasters"));
tag_init_list(map->value + 0, NULL);
- tag_init_sym_1(map->key + 1, "y");
+ tag_init_sym(map->key + 1, sym_1("y"));
tag_init_f64(map->value + 1, y);
}
i = *toasters;
diff --git a/libc3/window/sdl2/demo/earth.c b/libc3/window/sdl2/demo/earth.c
index e1d6470..4b87c68 100644
--- a/libc3/window/sdl2/demo/earth.c
+++ b/libc3/window/sdl2/demo/earth.c
@@ -42,11 +42,11 @@ bool earth_load (s_sequence *seq)
if (! tag_map(&seq->tag, 3))
return false;
map = &seq->tag.data.map;
- tag_init_sym_1( map->key + 0, "camera");
+ tag_init_sym( map->key + 0, sym_1("camera"));
tag_init_ptr_free( map->value + 0, camera);
- tag_init_sym_1( map->key + 1, "camera_rot_x_speed");
+ tag_init_sym( map->key + 1, sym_1("camera_rot_x_speed"));
tag_init_f64( map->value + 1, 0.01);
- tag_init_sym_1( map->key + 2, "sphere");
+ tag_init_sym( map->key + 2, sym_1("sphere"));
tag_init_struct_with_data(map->value + 2, sym_1("GL.Sphere"),
true, sphere);
return true;
diff --git a/libc3/window/sdl2/demo/flies.c b/libc3/window/sdl2/demo/flies.c
index 74dfcda..4b12317 100644
--- a/libc3/window/sdl2/demo/flies.c
+++ b/libc3/window/sdl2/demo/flies.c
@@ -65,15 +65,15 @@ bool flies_load (s_sequence *seq)
s_map *map;
tag_map(&seq->tag, 4);
map = &seq->tag.data.map;
- tag_init_sym_1( map->key + 0, "board");
+ tag_init_sym( map->key + 0, sym_1("board"));
tag_init_array(map->value + 0, sym_1("U8"),
2, (uw[]) {BOARD_SIZE, BOARD_SIZE});
- tag_init_sym_1(map->key + 1, "in");
- tag_init_uw( map->value + 1, 0);
- tag_init_sym_1(map->key + 2, "out");
- tag_init_uw( map->value + 2, 0);
- tag_init_sym_1(map->key + 3, "t");
- tag_init_uw( map->value + 3, 0);
+ tag_init_sym( map->key + 1, sym_1("in"));
+ tag_init_uw( map->value + 1, 0);
+ tag_init_sym( map->key + 2, sym_1("out"));
+ tag_init_uw( map->value + 2, 0);
+ tag_init_sym( map->key + 3, sym_1("t"));
+ tag_init_uw( map->value + 3, 0);
board = &map->value[0].data.array;
board->data = malloc(board->size);
i = 0;
diff --git a/libc3/window/sdl2/demo/toasters.c b/libc3/window/sdl2/demo/toasters.c
index b4842a7..1773268 100644
--- a/libc3/window/sdl2/demo/toasters.c
+++ b/libc3/window/sdl2/demo/toasters.c
@@ -77,9 +77,9 @@ static void toast_render (s_tag *toast, s_window_sdl2 *window,
static s_tag * toaster_init (s_tag *toaster, f64 y)
{
tag_init_map(toaster, 2);
- tag_init_sym_1(toaster->data.map.key + 0, "x");
+ tag_init_sym(toaster->data.map.key + 0, sym_1("x"));
tag_init_f64(toaster->data.map.value + 0, -150);
- tag_init_sym_1(toaster->data.map.key + 1, "y");
+ tag_init_sym(toaster->data.map.key + 1, sym_1("y"));
tag_init_f64(toaster->data.map.value + 1, y);
return toaster;
}
@@ -119,9 +119,9 @@ bool toasters_load (s_sequence *seq)
s_map *map;
tag_map(&seq->tag, 2);
map = &seq->tag.data.map;
- tag_init_sym_1( map->key + 0, "toasters");
+ tag_init_sym( map->key + 0, sym_1("toasters"));
tag_init_list(map->value + 0, NULL);
- tag_init_sym_1( map->key + 1, "toasts");
+ tag_init_sym( map->key + 1, sym_1("toasts"));
tag_init_list(map->value + 1, NULL);
return true;
}
@@ -174,9 +174,9 @@ bool toasters_render_toasts (s_list **toasts, s_window_sdl2 *window,
y += TOASTERS_SPACING;
*toasts = list_new_map(2, *toasts);
map = &(*toasts)->tag.data.map;
- tag_init_sym_1(map->key + 0, "toasts");
+ tag_init_sym( map->key + 0, sym_1("toasts"));
tag_init_list(map->value + 0, NULL);
- tag_init_sym_1(map->key + 1, "y");
+ tag_init_sym( map->key + 1, sym_1("y"));
tag_init_f64(map->value + 1, y);
}
i = *toasts;
@@ -226,9 +226,9 @@ bool toasters_render_toasters (s_list **toasters, s_window_sdl2 *window,
y += TOASTERS_SPACING;
*toasters = list_new_map(2, *toasters);
map = &(*toasters)->tag.data.map;
- tag_init_sym_1(map->key + 0, "toasters");
+ tag_init_sym( map->key + 0, sym_1("toasters"));
tag_init_list(map->value + 0, NULL);
- tag_init_sym_1(map->key + 1, "y");
+ tag_init_sym( map->key + 1, sym_1("y"));
tag_init_f64(map->value + 1, y);
}
i = *toasters;
diff --git a/test/buf_inspect_test.c b/test/buf_inspect_test.c
index 3b33f8c..5eb013e 100644
--- a/test/buf_inspect_test.c
+++ b/test/buf_inspect_test.c
@@ -398,7 +398,6 @@ TEST_CASE(buf_inspect_tag)
BUF_INSPECT_TEST_TAG(tag_str_1(&tag, NULL, ""), "\"\"");
BUF_INSPECT_TEST_TAG(tag_str_1(&tag, NULL, "09AZaz"), "\"09AZaz\"");
BUF_INSPECT_TEST_TAG(tag_sym(&tag, sym_1("Module")), "Module");
- BUF_INSPECT_TEST_TAG(tag_sym_1(&tag, "Module"), "Module");
BUF_INSPECT_TEST_TAG(tag_u16(&tag, 0x100), "256");
BUF_INSPECT_TEST_TAG(tag_u32(&tag, 0x10000), "65536");
BUF_INSPECT_TEST_TAG(tag_u64(&tag, 0x100000000), "4294967296");
diff --git a/test/fact_test.c b/test/fact_test.c
index e93d524..12017be 100644
--- a/test/fact_test.c
+++ b/test/fact_test.c
@@ -71,9 +71,9 @@ TEST_CASE(fact_init)
{
s_tag sym[3];
s_fact fact;
- tag_init_sym_1(sym, "A");
- tag_init_sym_1(sym + 1, "B");
- tag_init_sym_1(sym + 2, "C");
+ tag_init_sym(sym, sym_1("A"));
+ tag_init_sym(sym + 1, sym_1("B"));
+ tag_init_sym(sym + 2, sym_1("C"));
TEST_EQ(fact_init(&fact, sym, sym + 1, sym + 2), &fact);
TEST_EQ(fact.subject, sym);
TEST_EQ(fact.predicate, sym + 1);