From 534da53517ba559b21b7d11d56524eac13dfa30a Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 11 Jul 2019 16:10:06 +0200 Subject: [PATCH] :art: Introduce GWI_xB --- include/import.h | 8 +- src/lib/array.c | 56 ++++++------ src/lib/complex.c | 80 ++++++++-------- src/lib/engine.c | 104 ++++++++++----------- src/lib/event.c | 18 ++-- src/lib/func.c | 40 ++++---- src/lib/modules.c | 34 +++---- src/lib/object.c | 58 ++++++------ src/lib/prim.c | 228 +++++++++++++++++++++++----------------------- src/lib/ptr.c | 38 ++++---- src/lib/shred.c | 78 ++++++++-------- src/lib/string.c | 140 ++++++++++++++-------------- src/lib/ugen.c | 30 +++--- src/lib/vararg.c | 52 +++++------ src/lib/vec.c | 60 ++++++------ 15 files changed, 514 insertions(+), 510 deletions(-) diff --git a/include/import.h b/include/import.h index 0864ff38..ba881589 100644 --- a/include/import.h +++ b/include/import.h @@ -15,14 +15,18 @@ typedef struct Gwi_* Gwi; #define OP_CHECK(a) ANN Type a(const Env env NUSED, void* data NUSED, m_bool* mut NUSED) #define OP_EMIT(a) ANN m_bool a(const Emitter emit NUSED, void* data NUSED) #ifdef GWION_BUILTIN +#define GWI_BB(a) (void)(a); +#define GWI_OB(a) (void)(a); #define GWION_IMPORT(a) ANN m_bool import_##a(const Gwi gwi) #else +#define GWI_BB(a) CHECK_BB(a) +#define GWI_OB(a) CHECK_OB(a) #define GWION_IMPORT(a) ANN m_bool import(const Gwi gwi) #endif #define ALLOC_PTR(p, a, b, c) b* a = (b*)_mp_calloc(p, sizeof(b)); *a = (b)c #define _CHECK_OP(op, check, func)\ - CHECK_BB(gwi_oper_add(gwi, opck_##check))\ - CHECK_BB(gwi_oper_end(gwi, op, func)) + GWI_BB(gwi_oper_add(gwi, opck_##check))\ + GWI_BB(gwi_oper_end(gwi, op, func)) #define GWI_LOC new_loc(gwi->gwion->mp, __LINE__) diff --git a/src/lib/array.c b/src/lib/array.c index fa7a46e3..4e9b3c52 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -194,34 +194,34 @@ static FREEARG(freearg_array) { GWION_IMPORT(array) { t_array = gwi_mk_type(gwi, "@Array", SZ_INT, t_object); - CHECK_BB(gwi_class_ini(gwi, t_array, NULL, array_dtor)) - - CHECK_BB(gwi_item_ini(gwi, "int", "@array")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) - - CHECK_BB(gwi_func_ini(gwi, "int", "size", vm_vector_size)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_func_ini(gwi, "int", "depth", vm_vector_depth)) - CHECK_BB(gwi_func_end(gwi, 0)) - - CHECK_BB(gwi_func_ini(gwi, "int", "cap", vm_vector_cap)) - CHECK_BB(gwi_func_end(gwi, 0)) - - CHECK_BB(gwi_func_ini(gwi, "int", "remove", vm_vector_rem)) - CHECK_BB(gwi_func_arg(gwi, "int", "index")) - CHECK_BB(gwi_func_end(gwi, 0)) - - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "@Array", (m_str)OP_ANY_TYPE, NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_array_at)) - CHECK_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) - CHECK_BB(gwi_oper_add(gwi, opck_array_shift)) - CHECK_BB(gwi_oper_emi(gwi, opem_array_shift)) - CHECK_BB(gwi_oper_end(gwi, "<<", NULL)) - CHECK_BB(gwi_oper_ini(gwi, "@Array", "@Array", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_array_cast)) - CHECK_BB(gwi_oper_emi(gwi, opem_basic_cast)) - CHECK_BB(gwi_oper_end(gwi, "$", NULL)) + GWI_BB(gwi_class_ini(gwi, t_array, NULL, array_dtor)) + + GWI_BB(gwi_item_ini(gwi, "int", "@array")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) + + GWI_BB(gwi_func_ini(gwi, "int", "size", vm_vector_size)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "int", "depth", vm_vector_depth)) + GWI_BB(gwi_func_end(gwi, 0)) + + GWI_BB(gwi_func_ini(gwi, "int", "cap", vm_vector_cap)) + GWI_BB(gwi_func_end(gwi, 0)) + + GWI_BB(gwi_func_ini(gwi, "int", "remove", vm_vector_rem)) + GWI_BB(gwi_func_arg(gwi, "int", "index")) + GWI_BB(gwi_func_end(gwi, 0)) + + GWI_BB(gwi_class_end(gwi)) + GWI_BB(gwi_oper_ini(gwi, "@Array", (m_str)OP_ANY_TYPE, NULL)) + GWI_BB(gwi_oper_add(gwi, opck_array_at)) + GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) + GWI_BB(gwi_oper_add(gwi, opck_array_shift)) + GWI_BB(gwi_oper_emi(gwi, opem_array_shift)) + GWI_BB(gwi_oper_end(gwi, "<<", NULL)) + GWI_BB(gwi_oper_ini(gwi, "@Array", "@Array", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_array_cast)) + GWI_BB(gwi_oper_emi(gwi, opem_basic_cast)) + GWI_BB(gwi_oper_end(gwi, "$", NULL)) register_freearg(gwi, ArrayAlloc, freearg_array); return GW_OK; } diff --git a/src/lib/complex.c b/src/lib/complex.c index 54bd3897..bcd65861 100644 --- a/src/lib/complex.c +++ b/src/lib/complex.c @@ -114,47 +114,47 @@ polar_def2_r(Mul, *, +) polar_def2_r(Div, /, -) GWION_IMPORT(complex) { - CHECK_BB(gwi_class_ini(gwi, t_complex, NULL, NULL)) + GWI_BB(gwi_class_ini(gwi, t_complex, NULL, NULL)) gwi_item_ini(gwi, "float", "re"); - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) gwi_item_ini(gwi, "float", "im"); - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_class_ini(gwi, t_polar, NULL, NULL)) - CHECK_BB(gwi_item_ini(gwi, "float", "mod")) - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) - CHECK_BB(gwi_item_ini(gwi, "float", "phase")) - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "complex", "complex", "complex")) - CHECK_BB(gwi_oper_end(gwi, "+", ComplexAdd)) - CHECK_BB(gwi_oper_end(gwi, "-", ComplexSub)) - CHECK_BB(gwi_oper_end(gwi, "*", ComplexMul)) - CHECK_BB(gwi_oper_end(gwi, "/", ComplexDiv)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "=>", ComplexRAssign)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "+=>", ComplexRAdd)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "-=>", ComplexRSub)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "*=>", ComplexRMul)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "/=>", ComplexRDiv)) - CHECK_BB(gwi_oper_ini(gwi, "polar", "polar", "polar")) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "=>", ComplexRAssign)) - CHECK_BB(gwi_oper_end(gwi, "+", PolarAdd)) - CHECK_BB(gwi_oper_end(gwi, "-", PolarSub)) - CHECK_BB(gwi_oper_end(gwi, "*", PolarMul)) - CHECK_BB(gwi_oper_end(gwi, "/", PolarDiv)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "+=>", PolarRAdd)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "-=>", PolarRSub)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "*=>", PolarRMul)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "/=>", PolarRDiv)) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_polar, NULL, NULL)) + GWI_BB(gwi_item_ini(gwi, "float", "mod")) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_item_ini(gwi, "float", "phase")) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_class_end(gwi)) + GWI_BB(gwi_oper_ini(gwi, "complex", "complex", "complex")) + GWI_BB(gwi_oper_end(gwi, "+", ComplexAdd)) + GWI_BB(gwi_oper_end(gwi, "-", ComplexSub)) + GWI_BB(gwi_oper_end(gwi, "*", ComplexMul)) + GWI_BB(gwi_oper_end(gwi, "/", ComplexDiv)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "=>", ComplexRAssign)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "+=>", ComplexRAdd)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "-=>", ComplexRSub)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "*=>", ComplexRMul)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "/=>", ComplexRDiv)) + GWI_BB(gwi_oper_ini(gwi, "polar", "polar", "polar")) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "=>", ComplexRAssign)) + GWI_BB(gwi_oper_end(gwi, "+", PolarAdd)) + GWI_BB(gwi_oper_end(gwi, "-", PolarSub)) + GWI_BB(gwi_oper_end(gwi, "*", PolarMul)) + GWI_BB(gwi_oper_end(gwi, "/", PolarDiv)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "+=>", PolarRAdd)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "-=>", PolarRSub)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "*=>", PolarRMul)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "/=>", PolarRDiv)) return GW_OK; } diff --git a/src/lib/engine.c b/src/lib/engine.c index 4a629e6a..05bda69e 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -35,59 +35,59 @@ static FREEARG(freearg_gack) { } ANN static m_bool import_core_libs(const Gwi gwi) { - CHECK_OB((t_undefined = gwi_mk_type(gwi, "@Undefined", SZ_INT, NULL))) // size = SZ_INT to enable declarations - CHECK_OB((t_class = gwi_mk_type(gwi, "Class", SZ_INT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_class)) - CHECK_OB((t_auto = gwi_mk_type(gwi, "auto", SZ_INT, NULL))) // size = SZ_INT to enable declarations - CHECK_BB(gwi_add_type(gwi, t_auto)) + GWI_OB((t_undefined = gwi_mk_type(gwi, "@Undefined", SZ_INT, NULL))) // size = SZ_INT to enable declarations + GWI_OB((t_class = gwi_mk_type(gwi, "Class", SZ_INT, NULL))) + GWI_BB(gwi_add_type(gwi, t_class)) + GWI_OB((t_auto = gwi_mk_type(gwi, "auto", SZ_INT, NULL))) // size = SZ_INT to enable declarations + GWI_BB(gwi_add_type(gwi, t_auto)) SET_FLAG(t_class, abstract); - CHECK_OB((t_void = gwi_mk_type(gwi, "void", 0, NULL))) - CHECK_BB(gwi_add_type(gwi, t_void)) - CHECK_OB((t_null = gwi_mk_type(gwi, "@null", SZ_INT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_null)) - CHECK_OB((t_function = gwi_mk_type(gwi, "@function", SZ_INT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_function)) - CHECK_OB((t_fptr = gwi_mk_type(gwi, "@func_ptr", SZ_INT, t_function))) - CHECK_BB(gwi_add_type(gwi, t_fptr)) - CHECK_OB((t_lambda = gwi_mk_type(gwi, "@lambda", SZ_INT, t_function))) - CHECK_BB(gwi_add_type(gwi, t_fptr)) - CHECK_OB((t_gack = gwi_mk_type(gwi, "@Gack", SZ_INT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_gack)) - CHECK_OB((t_int = gwi_mk_type(gwi, "int", SZ_INT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_int)) - CHECK_OB((t_float = gwi_mk_type(gwi, "float", SZ_FLOAT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_float)) - CHECK_OB((t_dur = gwi_mk_type(gwi, "dur", SZ_FLOAT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_dur)) - CHECK_OB((t_time = gwi_mk_type(gwi, "time", SZ_FLOAT, NULL))) - CHECK_BB(gwi_add_type(gwi, t_time)) - CHECK_OB((t_now = gwi_mk_type(gwi, "@now", SZ_FLOAT, t_time))) - CHECK_BB(gwi_add_type(gwi, t_now)) - CHECK_OB((t_complex = gwi_mk_type(gwi, "complex", SZ_COMPLEX , NULL))) - CHECK_OB((t_polar = gwi_mk_type(gwi, "polar", SZ_COMPLEX , NULL))) - CHECK_OB((t_vec3 = gwi_mk_type(gwi, "Vec3", SZ_VEC3, NULL))) - CHECK_OB((t_vec4 = gwi_mk_type(gwi, "Vec4", SZ_VEC4, NULL))) - CHECK_BB(import_object(gwi)) - CHECK_OB((t_union = gwi_mk_type(gwi, "@Union", SZ_INT, t_object))) - CHECK_BB(gwi_class_ini(gwi, t_union, NULL, NULL)) - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(import_array(gwi)) - CHECK_BB(import_event(gwi)) - CHECK_BB(import_ugen(gwi)) - CHECK_BB(import_ptr(gwi)) - CHECK_BB(import_func(gwi)) - CHECK_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_new)) - CHECK_BB(gwi_oper_emi(gwi, opem_new)) - CHECK_BB(gwi_oper_end(gwi, "new", NULL)) - CHECK_BB(import_prim(gwi)) - CHECK_BB(import_complex(gwi)) - CHECK_BB(import_vec3(gwi)) - CHECK_BB(import_vec4(gwi)) - CHECK_BB(import_vararg(gwi)) - CHECK_BB(import_string(gwi)) - CHECK_BB(import_shred(gwi)) - CHECK_BB(import_modules(gwi)) + GWI_OB((t_void = gwi_mk_type(gwi, "void", 0, NULL))) + GWI_BB(gwi_add_type(gwi, t_void)) + GWI_OB((t_null = gwi_mk_type(gwi, "@null", SZ_INT, NULL))) + GWI_BB(gwi_add_type(gwi, t_null)) + GWI_OB((t_function = gwi_mk_type(gwi, "@function", SZ_INT, NULL))) + GWI_BB(gwi_add_type(gwi, t_function)) + GWI_OB((t_fptr = gwi_mk_type(gwi, "@func_ptr", SZ_INT, t_function))) + GWI_BB(gwi_add_type(gwi, t_fptr)) + GWI_OB((t_lambda = gwi_mk_type(gwi, "@lambda", SZ_INT, t_function))) + GWI_BB(gwi_add_type(gwi, t_fptr)) + GWI_OB((t_gack = gwi_mk_type(gwi, "@Gack", SZ_INT, NULL))) + GWI_BB(gwi_add_type(gwi, t_gack)) + GWI_OB((t_int = gwi_mk_type(gwi, "int", SZ_INT, NULL))) + GWI_BB(gwi_add_type(gwi, t_int)) + GWI_OB((t_float = gwi_mk_type(gwi, "float", SZ_FLOAT, NULL))) + GWI_BB(gwi_add_type(gwi, t_float)) + GWI_OB((t_dur = gwi_mk_type(gwi, "dur", SZ_FLOAT, NULL))) + GWI_BB(gwi_add_type(gwi, t_dur)) + GWI_OB((t_time = gwi_mk_type(gwi, "time", SZ_FLOAT, NULL))) + GWI_BB(gwi_add_type(gwi, t_time)) + GWI_OB((t_now = gwi_mk_type(gwi, "@now", SZ_FLOAT, t_time))) + GWI_BB(gwi_add_type(gwi, t_now)) + GWI_OB((t_complex = gwi_mk_type(gwi, "complex", SZ_COMPLEX , NULL))) + GWI_OB((t_polar = gwi_mk_type(gwi, "polar", SZ_COMPLEX , NULL))) + GWI_OB((t_vec3 = gwi_mk_type(gwi, "Vec3", SZ_VEC3, NULL))) + GWI_OB((t_vec4 = gwi_mk_type(gwi, "Vec4", SZ_VEC4, NULL))) + GWI_BB(import_object(gwi)) + GWI_OB((t_union = gwi_mk_type(gwi, "@Union", SZ_INT, t_object))) + GWI_BB(gwi_class_ini(gwi, t_union, NULL, NULL)) + GWI_BB(gwi_class_end(gwi)) + GWI_BB(import_array(gwi)) + GWI_BB(import_event(gwi)) + GWI_BB(import_ugen(gwi)) + GWI_BB(import_ptr(gwi)) + GWI_BB(import_func(gwi)) + GWI_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) + GWI_BB(gwi_oper_add(gwi, opck_new)) + GWI_BB(gwi_oper_emi(gwi, opem_new)) + GWI_BB(gwi_oper_end(gwi, "new", NULL)) + GWI_BB(import_prim(gwi)) + GWI_BB(import_complex(gwi)) + GWI_BB(import_vec3(gwi)) + GWI_BB(import_vec4(gwi)) + GWI_BB(import_vararg(gwi)) + GWI_BB(import_string(gwi)) + GWI_BB(import_shred(gwi)) + GWI_BB(import_modules(gwi)) register_freearg(gwi, SwitchIni, freearg_switchini); register_freearg(gwi, SwitchBranch, freearg_switchbranch); register_freearg(gwi, Gack, freearg_gack); diff --git a/src/lib/event.c b/src/lib/event.c index 77931069..9b8990c2 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -57,15 +57,15 @@ static MFUN(event_broadcast) { GWION_IMPORT(event) { t_event = gwi_mk_type(gwi, "Event", SZ_INT, t_object ); - CHECK_BB(gwi_class_ini(gwi, t_event, event_ctor, event_dtor)) - CHECK_BB(gwi_item_ini(gwi, "int", "@shreds")) - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) - CHECK_BB(gwi_func_ini(gwi, "void", "signal", event_signal)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_func_ini(gwi, "void", "broadcast", event_broadcast)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "Event", "@now", "int")) + GWI_BB(gwi_class_ini(gwi, t_event, event_ctor, event_dtor)) + GWI_BB(gwi_item_ini(gwi, "int", "@shreds")) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_func_ini(gwi, "void", "signal", event_signal)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "void", "broadcast", event_broadcast)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) + GWI_BB(gwi_oper_ini(gwi, "Event", "@now", "int")) _CHECK_OP("=>", eventwait, EventWait) return GW_OK; } diff --git a/src/lib/func.c b/src/lib/func.c index 9fd775c8..f544ebd9 100644 --- a/src/lib/func.c +++ b/src/lib/func.c @@ -294,26 +294,26 @@ static FREEARG(freearg_dottmpl) { } GWION_IMPORT(func) { - CHECK_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@function", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_func_call)) - CHECK_BB(gwi_oper_end(gwi, "=>", NULL)) - CHECK_BB(gwi_oper_ini(gwi, "@function", "@func_ptr", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_fptr_at)) - CHECK_BB(gwi_oper_emi(gwi, opem_func_assign)) - CHECK_BB(gwi_oper_end(gwi, "@=>", NULL /*FuncAssign*/)) - CHECK_BB(gwi_oper_add(gwi, opck_fptr_cast)) - CHECK_BB(gwi_oper_emi(gwi, opem_fptr_cast)) - CHECK_BB(gwi_oper_end(gwi, "$", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_fptr_impl)) - CHECK_BB(gwi_oper_emi(gwi, opem_fptr_impl)) - CHECK_BB(gwi_oper_end(gwi, "@implicit", NULL)) - CHECK_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_spork)) - CHECK_BB(gwi_oper_emi(gwi, opem_spork)) - CHECK_BB(gwi_oper_end(gwi, "spork", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_spork)) - CHECK_BB(gwi_oper_emi(gwi, opem_spork)) - CHECK_BB(gwi_oper_end(gwi, "fork", NULL)) + GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@function", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_func_call)) + GWI_BB(gwi_oper_end(gwi, "=>", NULL)) + GWI_BB(gwi_oper_ini(gwi, "@function", "@func_ptr", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_fptr_at)) + GWI_BB(gwi_oper_emi(gwi, opem_func_assign)) + GWI_BB(gwi_oper_end(gwi, "@=>", NULL /*FuncAssign*/)) + GWI_BB(gwi_oper_add(gwi, opck_fptr_cast)) + GWI_BB(gwi_oper_emi(gwi, opem_fptr_cast)) + GWI_BB(gwi_oper_end(gwi, "$", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_fptr_impl)) + GWI_BB(gwi_oper_emi(gwi, opem_fptr_impl)) + GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) + GWI_BB(gwi_oper_add(gwi, opck_spork)) + GWI_BB(gwi_oper_emi(gwi, opem_spork)) + GWI_BB(gwi_oper_end(gwi, "spork", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_spork)) + GWI_BB(gwi_oper_emi(gwi, opem_spork)) + GWI_BB(gwi_oper_end(gwi, "fork", NULL)) register_freearg(gwi, SporkIni, freearg_xork); register_freearg(gwi, ForkIni, freearg_xork); register_freearg(gwi, DotTmpl, freearg_dottmpl); diff --git a/src/lib/modules.c b/src/lib/modules.c index 075e1442..c65eefd7 100644 --- a/src/lib/modules.c +++ b/src/lib/modules.c @@ -40,12 +40,12 @@ static MFUN(gain_set_gain) { static GWION_IMPORT(gain) { const Type t_gain = gwi_mk_type(gwi, "Gain", SZ_INT, t_ugen); - CHECK_BB(gwi_class_ini(gwi, t_gain, gain_ctor, basic_dtor)) + GWI_BB(gwi_class_ini(gwi, t_gain, gain_ctor, basic_dtor)) gwi_func_ini(gwi, "float", "gain", gain_get_gain); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "gain", gain_set_gain); gwi_func_arg(gwi, "float", "arg0"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) return gwi_class_end(gwi); } @@ -70,12 +70,12 @@ static MFUN(impulse_set_next) { static GWION_IMPORT(impulse) { const Type t_impulse = gwi_mk_type(gwi, "Impulse", SZ_INT, t_ugen); - CHECK_BB(gwi_class_ini(gwi, t_impulse, impulse_ctor, basic_dtor)) + GWI_BB(gwi_class_ini(gwi, t_impulse, impulse_ctor, basic_dtor)) gwi_func_ini(gwi, "float", "next", impulse_get_next); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "next", impulse_set_next); gwi_func_arg(gwi, "float", "arg0"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) return gwi_class_end(gwi); } @@ -91,7 +91,7 @@ static CTOR(fullrect_ctor) { static GWION_IMPORT(fullrect) { const Type t_fullrect = gwi_mk_type(gwi, "FullRect", SZ_INT, t_ugen); - CHECK_BB(gwi_class_ini(gwi, t_fullrect, fullrect_ctor, basic_dtor)) + GWI_BB(gwi_class_ini(gwi, t_fullrect, fullrect_ctor, basic_dtor)) return gwi_class_end(gwi); } @@ -110,7 +110,7 @@ static CTOR(halfrect_ctor) { static GWION_IMPORT(halfrect) { const Type t_halfrect = gwi_mk_type(gwi, "HalfRect", SZ_INT, t_ugen); - CHECK_BB(gwi_class_ini(gwi, t_halfrect, halfrect_ctor, basic_dtor)) + GWI_BB(gwi_class_ini(gwi, t_halfrect, halfrect_ctor, basic_dtor)) return gwi_class_end(gwi); } @@ -134,12 +134,12 @@ static MFUN(step_set_next) { static GWION_IMPORT(step) { const Type t_step = gwi_mk_type(gwi, "Step", SZ_INT, t_ugen); - CHECK_BB(gwi_class_ini(gwi, t_step, step_ctor, basic_dtor)) + GWI_BB(gwi_class_ini(gwi, t_step, step_ctor, basic_dtor)) gwi_func_ini(gwi, "float", "next", step_get_next); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "next", step_set_next); gwi_func_arg(gwi, "float", "arg0"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) return gwi_class_end(gwi); } @@ -158,15 +158,15 @@ static CTOR(zerox_ctor) { static GWION_IMPORT(zerox) { const Type t_zerox = gwi_mk_type(gwi, "ZeroX", SZ_INT, t_ugen); - CHECK_BB(gwi_class_ini(gwi, t_zerox, zerox_ctor, basic_dtor)) + GWI_BB(gwi_class_ini(gwi, t_zerox, zerox_ctor, basic_dtor)) return gwi_class_end(gwi); } GWION_IMPORT(modules) { - CHECK_BB(import_gain(gwi)) - CHECK_BB(import_impulse(gwi)) - CHECK_BB(import_fullrect(gwi)) - CHECK_BB(import_halfrect(gwi)) - CHECK_BB(import_step(gwi)) + GWI_BB(import_gain(gwi)) + GWI_BB(import_impulse(gwi)) + GWI_BB(import_fullrect(gwi)) + GWI_BB(import_halfrect(gwi)) + GWI_BB(import_step(gwi)) return import_zerox(gwi); } diff --git a/src/lib/object.c b/src/lib/object.c index 436231ca..a0a653a4 100644 --- a/src/lib/object.c +++ b/src/lib/object.c @@ -149,35 +149,35 @@ static OP_CHECK(opck_implicit_null2obj) { } GWION_IMPORT(object) { - CHECK_OB((t_object = gwi_mk_type(gwi, "Object", SZ_INT, NULL))) - CHECK_BB(gwi_class_ini(gwi, t_object, NULL, NULL)) - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "@null", "Object", "Object")) - CHECK_BB(gwi_oper_add(gwi, at_object)) - CHECK_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) - CHECK_BB(gwi_oper_ini(gwi, "Object", "Object", NULL)) - CHECK_BB(gwi_oper_add(gwi, at_object)) - CHECK_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) - CHECK_BB(gwi_oper_ini(gwi, "Object", "Object", "int")) - CHECK_BB(gwi_oper_end(gwi, "==", EqObject)) - CHECK_BB(gwi_oper_end(gwi, "!=", NeqObject)) - CHECK_BB(gwi_oper_add(gwi, opck_object_cast)) - CHECK_BB(gwi_oper_emi(gwi, opem_basic_cast)) - CHECK_BB(gwi_oper_end(gwi, "$", NULL)) - CHECK_BB(gwi_oper_ini(gwi, "@null", "Object", "int")) - CHECK_BB(gwi_oper_end(gwi, "==", EqObject)) - CHECK_BB(gwi_oper_end(gwi, "!=", NeqObject)) - CHECK_BB(gwi_oper_add(gwi, opck_basic_cast)) - CHECK_BB(gwi_oper_emi(gwi, opem_basic_cast)) - CHECK_BB(gwi_oper_end(gwi, "$", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_implicit_null2obj)) - CHECK_BB(gwi_oper_end(gwi, "@implicit", NULL)) - CHECK_BB(gwi_oper_ini(gwi, "Object", "@null", "int")) - CHECK_BB(gwi_oper_end(gwi, "==", EqObject)) - CHECK_BB(gwi_oper_end(gwi, "!=", NeqObject)) - CHECK_BB(gwi_oper_ini(gwi, NULL, "Object", "int")) - CHECK_BB(gwi_oper_add(gwi, opck_unary_meta2)) - CHECK_BB(gwi_oper_end(gwi, "!", IntNot)) + t_object = gwi_mk_type(gwi, "Object", SZ_INT, NULL); + GWI_BB(gwi_class_ini(gwi, t_object, NULL, NULL)) + GWI_BB(gwi_class_end(gwi)) + GWI_BB(gwi_oper_ini(gwi, "@null", "Object", "Object")) + GWI_BB(gwi_oper_add(gwi, at_object)) + GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) + GWI_BB(gwi_oper_ini(gwi, "Object", "Object", NULL)) + GWI_BB(gwi_oper_add(gwi, at_object)) + GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) + GWI_BB(gwi_oper_ini(gwi, "Object", "Object", "int")) + GWI_BB(gwi_oper_end(gwi, "==", EqObject)) + GWI_BB(gwi_oper_end(gwi, "!=", NeqObject)) + GWI_BB(gwi_oper_add(gwi, opck_object_cast)) + GWI_BB(gwi_oper_emi(gwi, opem_basic_cast)) + GWI_BB(gwi_oper_end(gwi, "$", NULL)) + GWI_BB(gwi_oper_ini(gwi, "@null", "Object", "int")) + GWI_BB(gwi_oper_end(gwi, "==", EqObject)) + GWI_BB(gwi_oper_end(gwi, "!=", NeqObject)) + GWI_BB(gwi_oper_add(gwi, opck_basic_cast)) + GWI_BB(gwi_oper_emi(gwi, opem_basic_cast)) + GWI_BB(gwi_oper_end(gwi, "$", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_implicit_null2obj)) + GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_BB(gwi_oper_ini(gwi, "Object", "@null", "int")) + GWI_BB(gwi_oper_end(gwi, "==", EqObject)) + GWI_BB(gwi_oper_end(gwi, "!=", NeqObject)) + GWI_BB(gwi_oper_ini(gwi, NULL, "Object", "int")) + GWI_BB(gwi_oper_add(gwi, opck_unary_meta2)) + GWI_BB(gwi_oper_end(gwi, "!", IntNot)) gwi_item_ini(gwi, "@null", "null"); gwi_item_end(gwi, 0, NULL); gwi_reserve(gwi, "this"); diff --git a/src/lib/prim.c b/src/lib/prim.c index dfcf569d..b52318ee 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -18,27 +18,27 @@ #define CHECK_OP(op, check, func) _CHECK_OP(op, check, int_##func) GWION_IMPORT(int_op) { - CHECK_BB(gwi_oper_ini(gwi, "int", "int", "int")) - CHECK_BB(gwi_oper_end(gwi, "+", int_plus)) - CHECK_BB(gwi_oper_end(gwi, "-", int_minus)) - CHECK_BB(gwi_oper_end(gwi, "*", int_mul)) - CHECK_BB(gwi_oper_end(gwi, "/", int_div)) + GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_BB(gwi_oper_end(gwi, "+", int_plus)) + GWI_BB(gwi_oper_end(gwi, "-", int_minus)) + GWI_BB(gwi_oper_end(gwi, "*", int_mul)) + GWI_BB(gwi_oper_end(gwi, "/", int_div)) return gwi_oper_end(gwi, "%", int_modulo); } static GWION_IMPORT(int_logical) { - CHECK_BB(gwi_oper_end(gwi, "&&", int_and)) - CHECK_BB(gwi_oper_end(gwi, "||", int_or)) - CHECK_BB(gwi_oper_end(gwi, "==", int_eq)) - CHECK_BB(gwi_oper_end(gwi, "!=", int_neq)) - CHECK_BB(gwi_oper_end(gwi, ">", int_gt)) - CHECK_BB(gwi_oper_end(gwi, ">=", int_ge)) - CHECK_BB(gwi_oper_end(gwi, "<", int_lt)) - CHECK_BB(gwi_oper_end(gwi, "<=", int_le)) - CHECK_BB(gwi_oper_end(gwi, ">>", int_sr)) - CHECK_BB(gwi_oper_end(gwi, "<<", int_sl)) - CHECK_BB(gwi_oper_end(gwi, "&", int_sand)) - CHECK_BB(gwi_oper_end(gwi, "|", int_sor)) + GWI_BB(gwi_oper_end(gwi, "&&", int_and)) + GWI_BB(gwi_oper_end(gwi, "||", int_or)) + GWI_BB(gwi_oper_end(gwi, "==", int_eq)) + GWI_BB(gwi_oper_end(gwi, "!=", int_neq)) + GWI_BB(gwi_oper_end(gwi, ">", int_gt)) + GWI_BB(gwi_oper_end(gwi, ">=", int_ge)) + GWI_BB(gwi_oper_end(gwi, "<", int_lt)) + GWI_BB(gwi_oper_end(gwi, "<=", int_le)) + GWI_BB(gwi_oper_end(gwi, ">>", int_sr)) + GWI_BB(gwi_oper_end(gwi, "<<", int_sl)) + GWI_BB(gwi_oper_end(gwi, "&", int_sand)) + GWI_BB(gwi_oper_end(gwi, "|", int_sor)) return gwi_oper_end(gwi, "^", int_xor); } @@ -58,38 +58,38 @@ static GWION_IMPORT(int_r) { } static GWION_IMPORT(int_unary) { - CHECK_BB(gwi_oper_ini(gwi, NULL, "int", "int")) - CHECK_BB(gwi_oper_add(gwi, opck_unary_meta)) - CHECK_BB(gwi_oper_end(gwi, "-", int_negate)) - CHECK_BB(gwi_oper_add(gwi, opck_unary_meta2_uniq)) - CHECK_BB(gwi_oper_end(gwi, "!", IntNot)) + GWI_BB(gwi_oper_ini(gwi, NULL, "int", "int")) + GWI_BB(gwi_oper_add(gwi, opck_unary_meta)) + GWI_BB(gwi_oper_end(gwi, "-", int_negate)) + GWI_BB(gwi_oper_add(gwi, opck_unary_meta2_uniq)) + GWI_BB(gwi_oper_end(gwi, "!", IntNot)) CHECK_OP("++", unary, pre_inc) CHECK_OP("--", unary, pre_dec) - CHECK_BB(gwi_oper_end(gwi, "~", int_cmp)) - CHECK_BB(gwi_oper_ini(gwi, "int", NULL, "int")) + GWI_BB(gwi_oper_end(gwi, "~", int_cmp)) + GWI_BB(gwi_oper_ini(gwi, "int", NULL, "int")) CHECK_OP("++", post, post_inc) - CHECK_BB(gwi_oper_add(gwi, opck_post)) - CHECK_BB(gwi_oper_end(gwi, "--", int_post_dec)) + GWI_BB(gwi_oper_add(gwi, opck_post)) + GWI_BB(gwi_oper_end(gwi, "--", int_post_dec)) return GW_OK; } static GWION_IMPORT(int_values) { - CHECK_BB(gwi_enum_ini(gwi, "bool")) - CHECK_BB(gwi_enum_add(gwi, "false", 0)) - CHECK_BB(gwi_enum_add(gwi, "true", 1)) + GWI_BB(gwi_enum_ini(gwi, "bool")) + GWI_BB(gwi_enum_add(gwi, "false", 0)) + GWI_BB(gwi_enum_add(gwi, "true", 1)) t_bool = gwi_enum_end(gwi); - CHECK_BB(gwi_item_ini(gwi, "bool", "maybe")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) + GWI_BB(gwi_item_ini(gwi, "bool", "maybe")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) gwi_reserve(gwi, "maybe"); return GW_OK; } static GWION_IMPORT(int) { - CHECK_BB(gwi_oper_ini(gwi, "int", "int", "int")) - CHECK_BB(import_int_op(gwi)) - CHECK_BB(import_int_logical(gwi)) - CHECK_BB(import_int_r(gwi)) - CHECK_BB(import_int_unary(gwi)) + GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_BB(import_int_op(gwi)) + GWI_BB(import_int_logical(gwi)) + GWI_BB(import_int_r(gwi)) + GWI_BB(import_int_unary(gwi)) return import_int_values(gwi); } @@ -158,131 +158,131 @@ static OP_EMIT(opem_f2i) { #define CHECK_FI(op, check, func) _CHECK_OP(op, check, float_int_##func) static GWION_IMPORT(intfloat) { - CHECK_BB(gwi_oper_ini(gwi, "int", "float", "int")) - CHECK_BB(gwi_oper_end(gwi, "&&", int_float_and)) - CHECK_BB(gwi_oper_end(gwi, "||", int_float_or)) - CHECK_BB(gwi_oper_end(gwi, "==", int_float_eq)) - CHECK_BB(gwi_oper_end(gwi, "!=", int_float_neq)) - CHECK_BB(gwi_oper_end(gwi, ">", int_float_gt)) - CHECK_BB(gwi_oper_end(gwi, ">=", int_float_ge)) - CHECK_BB(gwi_oper_end(gwi, "<", int_float_lt)) - CHECK_BB(gwi_oper_end(gwi, "<=", int_float_le)) - CHECK_BB(gwi_oper_ini(gwi, "int", "float", "float")) - CHECK_BB(gwi_oper_end(gwi, "+", int_float_plus)) - CHECK_BB(gwi_oper_end(gwi, "*", int_float_mul)) - CHECK_BB(gwi_oper_end(gwi, "-", int_float_minus)) - CHECK_BB(gwi_oper_end(gwi, "/", int_float_div)) + GWI_BB(gwi_oper_ini(gwi, "int", "float", "int")) + GWI_BB(gwi_oper_end(gwi, "&&", int_float_and)) + GWI_BB(gwi_oper_end(gwi, "||", int_float_or)) + GWI_BB(gwi_oper_end(gwi, "==", int_float_eq)) + GWI_BB(gwi_oper_end(gwi, "!=", int_float_neq)) + GWI_BB(gwi_oper_end(gwi, ">", int_float_gt)) + GWI_BB(gwi_oper_end(gwi, ">=", int_float_ge)) + GWI_BB(gwi_oper_end(gwi, "<", int_float_lt)) + GWI_BB(gwi_oper_end(gwi, "<=", int_float_le)) + GWI_BB(gwi_oper_ini(gwi, "int", "float", "float")) + GWI_BB(gwi_oper_end(gwi, "+", int_float_plus)) + GWI_BB(gwi_oper_end(gwi, "*", int_float_mul)) + GWI_BB(gwi_oper_end(gwi, "-", int_float_minus)) + GWI_BB(gwi_oper_end(gwi, "/", int_float_div)) CHECK_IF("=>", rassign, r_assign) CHECK_IF("+=>", rassign, r_plus) CHECK_IF("-=>", rassign, r_minus) CHECK_IF("*=>", rassign, r_mul) CHECK_IF("/=>", rassign, r_div) - CHECK_BB(gwi_oper_emi(gwi, opem_i2f)) + GWI_BB(gwi_oper_emi(gwi, opem_i2f)) _CHECK_OP("$", basic_cast, CastI2F) _CHECK_OP("@implicit", implicit_i2f, CastI2F) return GW_OK; } static GWION_IMPORT(floatint) { - CHECK_BB(gwi_oper_ini(gwi, "float", "int", "float")) - CHECK_BB(gwi_oper_end(gwi, "+", float_int_plus)) - CHECK_BB(gwi_oper_end(gwi, "-", float_int_minus)) - CHECK_BB(gwi_oper_end(gwi, "*", float_int_mul)) - CHECK_BB(gwi_oper_end(gwi, "/", float_int_div)) - CHECK_BB(gwi_oper_ini(gwi, "float", "int", "int")) - CHECK_BB(gwi_oper_end(gwi, "&&", float_int_and)) - CHECK_BB(gwi_oper_end(gwi, "||", float_int_or)) - CHECK_BB(gwi_oper_end(gwi, "==", float_int_eq)) - CHECK_BB(gwi_oper_end(gwi, "!=", float_int_neq)) - CHECK_BB(gwi_oper_end(gwi, ">", float_int_gt)) - CHECK_BB(gwi_oper_end(gwi, ">=", float_int_ge)) - CHECK_BB(gwi_oper_end(gwi, "<", float_int_lt)) - CHECK_BB(gwi_oper_end(gwi, "<=", float_int_le)) + GWI_BB(gwi_oper_ini(gwi, "float", "int", "float")) + GWI_BB(gwi_oper_end(gwi, "+", float_int_plus)) + GWI_BB(gwi_oper_end(gwi, "-", float_int_minus)) + GWI_BB(gwi_oper_end(gwi, "*", float_int_mul)) + GWI_BB(gwi_oper_end(gwi, "/", float_int_div)) + GWI_BB(gwi_oper_ini(gwi, "float", "int", "int")) + GWI_BB(gwi_oper_end(gwi, "&&", float_int_and)) + GWI_BB(gwi_oper_end(gwi, "||", float_int_or)) + GWI_BB(gwi_oper_end(gwi, "==", float_int_eq)) + GWI_BB(gwi_oper_end(gwi, "!=", float_int_neq)) + GWI_BB(gwi_oper_end(gwi, ">", float_int_gt)) + GWI_BB(gwi_oper_end(gwi, ">=", float_int_ge)) + GWI_BB(gwi_oper_end(gwi, "<", float_int_lt)) + GWI_BB(gwi_oper_end(gwi, "<=", float_int_le)) CHECK_FI("=>", rassign, r_assign) CHECK_FI("+=>", rassign, r_plus) CHECK_FI("-=>", rassign, r_minus) CHECK_FI("*=>", rassign, r_mul) CHECK_FI("/=>", rassign, r_div) - CHECK_BB(gwi_oper_emi(gwi, opem_f2i)) + GWI_BB(gwi_oper_emi(gwi, opem_f2i)) _CHECK_OP("$", basic_cast, CastF2I) _CHECK_OP("@implicit", implicit_f2i, CastF2I) return GW_OK; } static GWION_IMPORT(dur) { - CHECK_BB(gwi_oper_ini(gwi, "dur", "dur", "dur")) + GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "dur")) CHECK_FF("=>", rassign, r_assign) - CHECK_BB(gwi_oper_end(gwi, "+", FloatPlus)) - CHECK_BB(gwi_oper_end(gwi, "-", FloatMinus)) - CHECK_BB(gwi_oper_end(gwi, "*", FloatTimes)) - CHECK_BB(gwi_oper_ini(gwi, "dur", "dur", "float")) - CHECK_BB(gwi_oper_end(gwi, "/", FloatDivide)) + GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) + GWI_BB(gwi_oper_end(gwi, "-", FloatMinus)) + GWI_BB(gwi_oper_end(gwi, "*", FloatTimes)) + GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "float")) + GWI_BB(gwi_oper_end(gwi, "/", FloatDivide)) - CHECK_BB(gwi_oper_ini(gwi, "dur", "dur", "int")) - CHECK_BB(gwi_oper_end(gwi, ">", float_gt)) - CHECK_BB(gwi_oper_end(gwi, ">=", float_ge)) - CHECK_BB(gwi_oper_end(gwi, "<", float_lt)) + GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "int")) + GWI_BB(gwi_oper_end(gwi, ">", float_gt)) + GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) + GWI_BB(gwi_oper_end(gwi, "<", float_lt)) return gwi_oper_end(gwi, "<=", float_le); } static GWION_IMPORT(time) { - CHECK_BB(gwi_oper_ini(gwi, "time", "time", "time")) + GWI_BB(gwi_oper_ini(gwi, "time", "time", "time")) CHECK_FF("=>", rassign, r_assign) - CHECK_BB(gwi_oper_ini(gwi, "time", "dur", "time")) - CHECK_BB(gwi_oper_end(gwi, "+", FloatPlus)) - CHECK_BB(gwi_oper_ini(gwi, "dur", "time", "time")) + GWI_BB(gwi_oper_ini(gwi, "time", "dur", "time")) + GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) + GWI_BB(gwi_oper_ini(gwi, "dur", "time", "time")) CHECK_FF("=>", rassign, r_assign) - CHECK_BB(gwi_oper_end(gwi, "+", FloatPlus)) - CHECK_BB(gwi_oper_ini(gwi, "dur", "@now", "time")) + GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) + GWI_BB(gwi_oper_ini(gwi, "dur", "@now", "time")) _CHECK_OP("=>", rhs_emit_var, Time_Advance) - CHECK_BB(gwi_oper_ini(gwi, "time", "time", "int")) - CHECK_BB(gwi_oper_end(gwi, ">", float_gt)) - CHECK_BB(gwi_oper_end(gwi, ">=", float_ge)) - CHECK_BB(gwi_oper_end(gwi, "<", float_lt)) + GWI_BB(gwi_oper_ini(gwi, "time", "time", "int")) + GWI_BB(gwi_oper_end(gwi, ">", float_gt)) + GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) + GWI_BB(gwi_oper_end(gwi, "<", float_lt)) return gwi_oper_end(gwi, "<=", float_le); } static GWION_IMPORT(float) { - CHECK_BB(gwi_oper_ini(gwi, "float", "float", "float")) - CHECK_BB(gwi_oper_end(gwi, "+", FloatPlus)) - CHECK_BB(gwi_oper_end(gwi, "-", FloatMinus)) - CHECK_BB(gwi_oper_end(gwi, "*", FloatTimes)) - CHECK_BB(gwi_oper_end(gwi, "/", FloatDivide)) + GWI_BB(gwi_oper_ini(gwi, "float", "float", "float")) + GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) + GWI_BB(gwi_oper_end(gwi, "-", FloatMinus)) + GWI_BB(gwi_oper_end(gwi, "*", FloatTimes)) + GWI_BB(gwi_oper_end(gwi, "/", FloatDivide)) CHECK_FF("=>", rassign, r_assign) CHECK_FF("+=>", rassign, r_plus) CHECK_FF("-=>", rassign, r_minus) CHECK_FF("*=>", rassign, r_mul) CHECK_FF("/=>", rassign, r_div) - CHECK_BB(gwi_oper_ini(gwi, "float", "float", "int")) - CHECK_BB(gwi_oper_end(gwi, "&&", float_and)) - CHECK_BB(gwi_oper_end(gwi, "||", float_or)) - CHECK_BB(gwi_oper_end(gwi, "==", float_eq)) - CHECK_BB(gwi_oper_end(gwi, "!=", float_neq)) - CHECK_BB(gwi_oper_end(gwi, ">", float_gt)) - CHECK_BB(gwi_oper_end(gwi, ">=", float_ge)) - CHECK_BB(gwi_oper_end(gwi, "<", float_lt)) - CHECK_BB(gwi_oper_end(gwi, "<=", float_le)) - CHECK_BB(gwi_oper_ini(gwi, NULL, "float", "float")) + GWI_BB(gwi_oper_ini(gwi, "float", "float", "int")) + GWI_BB(gwi_oper_end(gwi, "&&", float_and)) + GWI_BB(gwi_oper_end(gwi, "||", float_or)) + GWI_BB(gwi_oper_end(gwi, "==", float_eq)) + GWI_BB(gwi_oper_end(gwi, "!=", float_neq)) + GWI_BB(gwi_oper_end(gwi, ">", float_gt)) + GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) + GWI_BB(gwi_oper_end(gwi, "<", float_lt)) + GWI_BB(gwi_oper_end(gwi, "<=", float_le)) + GWI_BB(gwi_oper_ini(gwi, NULL, "float", "float")) CHECK_FF("-", unary_meta, negate) - CHECK_BB(gwi_oper_ini(gwi, NULL, "float", "int")) + GWI_BB(gwi_oper_ini(gwi, NULL, "float", "int")) CHECK_FF("!", unary_meta2_uniq, not) - CHECK_BB(gwi_oper_ini(gwi, NULL, "time", "int")) + GWI_BB(gwi_oper_ini(gwi, NULL, "time", "int")) CHECK_FF("!", unary_meta2_uniq, not) - CHECK_BB(gwi_oper_ini(gwi, NULL, "dur", "int")) + GWI_BB(gwi_oper_ini(gwi, NULL, "dur", "int")) CHECK_FF("!", unary_meta2_uniq, not) - CHECK_BB(gwi_oper_ini(gwi, "int", "dur", "dur")) - CHECK_BB(gwi_oper_end(gwi, "::", int_float_mul)) - CHECK_BB(gwi_oper_ini(gwi, "float", "dur", "dur")) - CHECK_BB(gwi_oper_end(gwi, "::", FloatTimes)) + GWI_BB(gwi_oper_ini(gwi, "int", "dur", "dur")) + GWI_BB(gwi_oper_end(gwi, "::", int_float_mul)) + GWI_BB(gwi_oper_ini(gwi, "float", "dur", "dur")) + GWI_BB(gwi_oper_end(gwi, "::", FloatTimes)) return GW_OK; } GWION_IMPORT(prim) { - CHECK_BB(import_int(gwi)) - CHECK_BB(import_float(gwi)) - CHECK_BB(import_intfloat(gwi)) - CHECK_BB(import_floatint(gwi)) - CHECK_BB(import_dur(gwi)) - CHECK_BB(import_time(gwi)) + GWI_BB(import_int(gwi)) + GWI_BB(import_float(gwi)) + GWI_BB(import_intfloat(gwi)) + GWI_BB(import_floatint(gwi)) + GWI_BB(import_dur(gwi)) + GWI_BB(import_time(gwi)) return import_values(gwi); } diff --git a/src/lib/ptr.c b/src/lib/ptr.c index 6a5152e3..117ff5d4 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -98,25 +98,25 @@ static OP_EMIT(opem_ptr_deref) { GWION_IMPORT(ptr) { const m_str list[] = { "A" }; - CHECK_OB((t_ptr = gwi_mk_type(gwi, "Ptr", SZ_INT, t_object))) - CHECK_BB(gwi_tmpl_ini(gwi, 1, list)) - CHECK_BB(gwi_class_ini(gwi, t_ptr, NULL, NULL)) - CHECK_BB(gwi_tmpl_end(gwi)) - CHECK_BB(gwi_item_ini(gwi, "int", "@val")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) - CHECK_BB(gwi_class_end(gwi)) + t_ptr = gwi_mk_type(gwi, "Ptr", SZ_INT, t_object); + GWI_BB(gwi_tmpl_ini(gwi, 1, list)) + GWI_BB(gwi_class_ini(gwi, t_ptr, NULL, NULL)) + GWI_BB(gwi_tmpl_end(gwi)) + GWI_BB(gwi_item_ini(gwi, "int", "@val")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) + GWI_BB(gwi_class_end(gwi)) t_ptr->nspc->info->offset = SZ_INT; - CHECK_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Ptr", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_ptr_assign)) - CHECK_BB(gwi_oper_end(gwi, ":=>", instr_ptr_assign)) - CHECK_BB(gwi_oper_add(gwi, opck_implicit_ptr)) - CHECK_BB(gwi_oper_end(gwi, "@implicit", Cast2Ptr)) - CHECK_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Ptr", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_ptr_cast)) - CHECK_BB(gwi_oper_end(gwi, "$", Cast2Ptr)) - CHECK_BB(gwi_oper_ini(gwi, NULL, "Ptr", NULL)) - CHECK_BB(gwi_oper_add(gwi, opck_ptr_deref)) - CHECK_BB(gwi_oper_emi(gwi, opem_ptr_deref)) - CHECK_BB(gwi_oper_end(gwi, "*", instr_ptr_deref)) + GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Ptr", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_ptr_assign)) + GWI_BB(gwi_oper_end(gwi, ":=>", instr_ptr_assign)) + GWI_BB(gwi_oper_add(gwi, opck_implicit_ptr)) + GWI_BB(gwi_oper_end(gwi, "@implicit", Cast2Ptr)) + GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Ptr", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_ptr_cast)) + GWI_BB(gwi_oper_end(gwi, "$", Cast2Ptr)) + GWI_BB(gwi_oper_ini(gwi, NULL, "Ptr", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_ptr_deref)) + GWI_BB(gwi_oper_emi(gwi, opem_ptr_deref)) + GWI_BB(gwi_oper_end(gwi, "*", instr_ptr_deref)) return GW_OK; } diff --git a/src/lib/shred.c b/src/lib/shred.c index 41a6a722..9aa6783e 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -228,97 +228,97 @@ void fork_launch(const VM* vm, const M_Object o, const m_uint sz) { #include "nspc.h" GWION_IMPORT(shred) { - CHECK_OB((t_shred = gwi_mk_type(gwi, "Shred", SZ_INT, t_object))) - CHECK_BB(gwi_class_ini(gwi, t_shred, NULL, shred_dtor)) + GWI_OB((t_shred = gwi_mk_type(gwi, "Shred", SZ_INT, t_object))) + GWI_BB(gwi_class_ini(gwi, t_shred, NULL, shred_dtor)) gwi_item_ini(gwi, "int", "@me"); - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) gwi_item_ini(gwi, "int", "cancel"); - CHECK_BB((o_shred_cancel = gwi_item_end(gwi, 0, NULL))) + GWI_BB((o_shred_cancel = gwi_item_end(gwi, 0, NULL))) gwi_func_ini(gwi, "void", "exit", gw_shred_exit); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "int", "running", vm_shred_is_running); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "int", "done", vm_shred_is_done); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "int", "id", vm_shred_id); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "Shred", "fromId", vm_shred_from_id); gwi_func_arg(gwi, "int", "id"); - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) gwi_func_ini(gwi, "void", "yield", shred_yield); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "int", "args", shred_args); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "arg", shred_arg); gwi_func_arg(gwi, "int", "n"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "name", shred_name); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "path", shred_path); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "dir", shred_dir); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "code_name", shred_code_name); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "code_path", shred_code_path); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "string", "code_dir", shred_code_dir); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "set_cancel", shred_cancel); gwi_func_arg(gwi, "int", "n"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "test_cancel", shred_test_cancel); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "lock", shred_lock); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "unlock", shred_unlock); - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) gwi_item_ini(gwi, "Shred", "me"); gwi_item_end(gwi, ae_flag_const, NULL); SET_FLAG((t_shred), abstract); - CHECK_OB((t_fork = gwi_mk_type(gwi, "Fork", SZ_INT, t_shred))) - CHECK_BB(gwi_class_ini(gwi, t_fork, NULL, fork_dtor)) + GWI_OB((t_fork = gwi_mk_type(gwi, "Fork", SZ_INT, t_shred))) + GWI_BB(gwi_class_ini(gwi, t_fork, NULL, fork_dtor)) gwi_item_ini(gwi, "int", "@thread"); - CHECK_BB((o_fork_thread = gwi_item_end(gwi, ae_flag_const, NULL))) + GWI_BB((o_fork_thread = gwi_item_end(gwi, ae_flag_const, NULL))) gwi_item_ini(gwi, "int", "is_done"); - CHECK_BB((o_fork_done = gwi_item_end(gwi, ae_flag_const, NULL))) + GWI_BB((o_fork_done = gwi_item_end(gwi, ae_flag_const, NULL))) gwi_item_ini(gwi, "Event", "ev"); - CHECK_BB((o_fork_ev = gwi_item_end(gwi, ae_flag_const, NULL))) + GWI_BB((o_fork_ev = gwi_item_end(gwi, ae_flag_const, NULL))) gwi_item_ini(gwi, "int", "retsize"); - CHECK_BB((o_fork_retsize = gwi_item_end(gwi, ae_flag_const, NULL))) + GWI_BB((o_fork_retsize = gwi_item_end(gwi, ae_flag_const, NULL))) gwi_item_ini(gwi, "int", "@orig"); - CHECK_BB((o_fork_orig = gwi_item_end(gwi, ae_flag_const, NULL))) + GWI_BB((o_fork_orig = gwi_item_end(gwi, ae_flag_const, NULL))) o_fork_retval = t_fork->nspc->info->offset; - CHECK_BB(gwi_union_ini(gwi, NULL)) - CHECK_BB(gwi_union_add(gwi, "int", "i")) - CHECK_BB(gwi_union_add(gwi, "float", "f")) - CHECK_BB(gwi_union_add(gwi, "Vec3", "v")) - CHECK_BB(gwi_union_add(gwi, "Vec4", "w")) - CHECK_BB(gwi_union_add(gwi, "VarObject", "o")) - CHECK_OB(gwi_union_end(gwi, ae_flag_const)) + GWI_BB(gwi_union_ini(gwi, NULL)) + GWI_BB(gwi_union_add(gwi, "int", "i")) + GWI_BB(gwi_union_add(gwi, "float", "f")) + GWI_BB(gwi_union_add(gwi, "Vec3", "v")) + GWI_BB(gwi_union_add(gwi, "Vec4", "w")) + GWI_BB(gwi_union_add(gwi, "VarObject", "o")) + GWI_OB(gwi_union_end(gwi, ae_flag_const)) gwi_func_ini(gwi, "int", "join", fork_join); - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) SET_FLAG((t_fork), abstract); gwi_reserve(gwi, "me"); return GW_OK; diff --git a/src/lib/string.c b/src/lib/string.c index 578e7108..09b29cc7 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -171,78 +171,78 @@ static CTOR(string_ctor) { GWION_IMPORT(string) { t_string = gwi_mk_type(gwi, "string", SZ_INT, t_object); - CHECK_BB(gwi_class_ini(gwi, t_string, string_ctor, NULL)) + GWI_BB(gwi_class_ini(gwi, t_string, string_ctor, NULL)) gwi_item_ini(gwi, "int", "@data"); - CHECK_BB(gwi_item_end(gwi, ae_flag_const, NULL)) - CHECK_BB(gwi_class_end(gwi)) - - CHECK_BB(gwi_oper_ini(gwi, "string", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", String_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "string", "string", "int")) - CHECK_BB(gwi_oper_end(gwi, "==", String_eq)) - CHECK_BB(gwi_oper_end(gwi, "!=", String_neq)) - - CHECK_BB(gwi_oper_ini(gwi, "int", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Int_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Int_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Int_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "float", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Float_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Float_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Float_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "complex", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Complex_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Complex_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Complex_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "polar", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Polar_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Polar_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Polar_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi,"Vec3", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Vec3_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Vec3_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Vec3_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "Vec4", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Vec4_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Vec4_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Vec4_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "Object", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Object_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Object_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Object_String_Plus)) - - CHECK_BB(gwi_oper_ini(gwi, "@null", "string", "string")) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "=>", Object_String_Assign)) - CHECK_BB(gwi_oper_end(gwi, "+", Object_String)) - CHECK_BB(gwi_oper_add(gwi, opck_const_rhs)) - CHECK_BB(gwi_oper_end(gwi, "+=>", Object_String_Plus)) + GWI_BB(gwi_item_end(gwi, ae_flag_const, NULL)) + GWI_BB(gwi_class_end(gwi)) + + GWI_BB(gwi_oper_ini(gwi, "string", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", String_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "string", "string", "int")) + GWI_BB(gwi_oper_end(gwi, "==", String_eq)) + GWI_BB(gwi_oper_end(gwi, "!=", String_neq)) + + GWI_BB(gwi_oper_ini(gwi, "int", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Int_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Int_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Int_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "float", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Float_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Float_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Float_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "complex", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Complex_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Complex_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Complex_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "polar", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Polar_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Polar_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Polar_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi,"Vec3", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Vec3_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Vec3_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Vec3_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "Vec4", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Vec4_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Vec4_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Vec4_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "Object", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Object_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Object_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Object_String_Plus)) + + GWI_BB(gwi_oper_ini(gwi, "@null", "string", "string")) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "=>", Object_String_Assign)) + GWI_BB(gwi_oper_end(gwi, "+", Object_String)) + GWI_BB(gwi_oper_add(gwi, opck_const_rhs)) + GWI_BB(gwi_oper_end(gwi, "+=>", Object_String_Plus)) gwi_item_ini(gwi, "string", "__func__"); gwi_item_end(gwi, ae_flag_const, NULL); diff --git a/src/lib/ugen.c b/src/lib/ugen.c index b947182c..7b2250e9 100644 --- a/src/lib/ugen.c +++ b/src/lib/ugen.c @@ -335,26 +335,26 @@ static OP_CHECK(opck_chuck_ugen) { GWION_IMPORT(ugen) { t_ugen = gwi_mk_type(gwi, "UGen", SZ_INT, t_object); - CHECK_BB(gwi_class_ini(gwi, t_ugen, ugen_ctor, ugen_dtor)) - CHECK_BB(gwi_item_ini(gwi, "int", "@ugen")) - CHECK_BB(gwi_item_end(gwi, ae_flag_member, NULL)) + GWI_BB(gwi_class_ini(gwi, t_ugen, ugen_ctor, ugen_dtor)) + GWI_BB(gwi_item_ini(gwi, "int", "@ugen")) + GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL)) - CHECK_BB(gwi_func_ini(gwi, "UGen", "chan", ugen_channel)) - CHECK_BB(gwi_func_arg(gwi, "int", "arg0")) - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "UGen", "chan", ugen_channel)) + GWI_BB(gwi_func_arg(gwi, "int", "arg0")) + GWI_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_func_ini(gwi, "int", "op", ugen_get_op)) - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "int", "op", ugen_get_op)) + GWI_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_func_ini(gwi, "int", "op", ugen_set_op)) - CHECK_BB(gwi_func_arg(gwi, "int", "arg0")) - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "int", "op", ugen_set_op)) + GWI_BB(gwi_func_arg(gwi, "int", "arg0")) + GWI_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_func_ini(gwi, "float", "last", ugen_get_last)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_func_ini(gwi, "float", "last", ugen_get_last)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "UGen", "UGen", "UGen")) + GWI_BB(gwi_oper_ini(gwi, "UGen", "UGen", "UGen")) _CHECK_OP("=>", chuck_ugen, UgenConnect) _CHECK_OP("=<", chuck_ugen, UgenDisconnect) _CHECK_OP(":=>", chuck_ugen, TrigConnect) diff --git a/src/lib/vararg.c b/src/lib/vararg.c index b5c5cc2b..dc7a68c3 100644 --- a/src/lib/vararg.c +++ b/src/lib/vararg.c @@ -83,35 +83,35 @@ static FREEARG(freearg_vararg) { } GWION_IMPORT(vararg) { - CHECK_OB((t_vararg = gwi_mk_type(gwi, "@Vararg", SZ_INT, t_object))) + GWI_OB((t_vararg = gwi_mk_type(gwi, "@Vararg", SZ_INT, t_object))) const Type t_varobj = gwi_mk_type(gwi, "VarObject", SZ_INT, t_vararg); - CHECK_OB(t_varobj) + GWI_OB(t_varobj) SET_FLAG(t_varobj, abstract); const Type t_varloop = gwi_mk_type(gwi, "@VarLoop", SZ_INT, NULL); - CHECK_OB(t_varloop) - CHECK_BB(gwi_add_type(gwi, t_varobj)) - CHECK_BB(gwi_add_type(gwi, t_varloop)) - CHECK_BB(gwi_class_ini(gwi, t_vararg, NULL, NULL)) - CHECK_BB(gwi_union_ini(gwi, NULL)) - CHECK_BB(gwi_union_add(gwi, "@VarLoop", "start")) - CHECK_BB(gwi_union_add(gwi, "@VarLoop", "end")) - CHECK_BB(gwi_union_add(gwi, "int", "i")) - CHECK_BB(gwi_union_add(gwi, "float", "f")) - CHECK_BB(gwi_union_add(gwi, "time", "t")) - CHECK_BB(gwi_union_add(gwi, "dur", "d")) - CHECK_BB(gwi_union_add(gwi, "complex", "c")) - CHECK_BB(gwi_union_add(gwi, "polar", "p")) - CHECK_BB(gwi_union_add(gwi, "Vec3", "v3")) - CHECK_BB(gwi_union_add(gwi, "Vec4", "v4")) - CHECK_BB(gwi_union_add(gwi, "VarObject", "o")) - CHECK_OB(gwi_union_end(gwi, ae_flag_const)) - CHECK_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "VarObject", "Object", NULL)) - CHECK_BB(gwi_oper_add(gwi, at_varobj)) - CHECK_BB(gwi_oper_end(gwi, "@=>", VarargAssign)) - CHECK_BB(gwi_oper_ini(gwi, "Object", "VarObject", NULL)) - CHECK_BB(gwi_oper_add(gwi, at_varobj)) - CHECK_BB(gwi_oper_end(gwi, "@=>", VarargAssign)) + GWI_OB(t_varloop) + GWI_BB(gwi_add_type(gwi, t_varobj)) + GWI_BB(gwi_add_type(gwi, t_varloop)) + GWI_BB(gwi_class_ini(gwi, t_vararg, NULL, NULL)) + GWI_BB(gwi_union_ini(gwi, NULL)) + GWI_BB(gwi_union_add(gwi, "@VarLoop", "start")) + GWI_BB(gwi_union_add(gwi, "@VarLoop", "end")) + GWI_BB(gwi_union_add(gwi, "int", "i")) + GWI_BB(gwi_union_add(gwi, "float", "f")) + GWI_BB(gwi_union_add(gwi, "time", "t")) + GWI_BB(gwi_union_add(gwi, "dur", "d")) + GWI_BB(gwi_union_add(gwi, "complex", "c")) + GWI_BB(gwi_union_add(gwi, "polar", "p")) + GWI_BB(gwi_union_add(gwi, "Vec3", "v3")) + GWI_BB(gwi_union_add(gwi, "Vec4", "v4")) + GWI_BB(gwi_union_add(gwi, "VarObject", "o")) + GWI_OB(gwi_union_end(gwi, ae_flag_const)) + GWI_BB(gwi_class_end(gwi)) + GWI_BB(gwi_oper_ini(gwi, "VarObject", "Object", NULL)) + GWI_BB(gwi_oper_add(gwi, at_varobj)) + GWI_BB(gwi_oper_end(gwi, "@=>", VarargAssign)) + GWI_BB(gwi_oper_ini(gwi, "Object", "VarObject", NULL)) + GWI_BB(gwi_oper_add(gwi, at_varobj)) + GWI_BB(gwi_oper_end(gwi, "@=>", VarargAssign)) register_freearg(gwi, VarargIni, freearg_vararg); gwi_reserve(gwi, "vararg"); return GW_OK; diff --git a/src/lib/vec.c b/src/lib/vec.c index 1bf4a484..6fd7ad63 100644 --- a/src/lib/vec.c +++ b/src/lib/vec.c @@ -158,61 +158,61 @@ static void vecx_base(const Gwi gwi) { } GWION_IMPORT(vec3) { - CHECK_BB(gwi_class_ini(gwi, t_vec3, NULL, NULL)) + GWI_BB(gwi_class_ini(gwi, t_vec3, NULL, NULL)) vecx_base(gwi); gwi_func_ini(gwi, "void", "set", vec3_set); gwi_func_arg(gwi, "float", "x"); gwi_func_arg(gwi, "float", "y"); gwi_func_arg(gwi, "float", "z"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "setAll", vec3_setAll); gwi_func_arg(gwi, "float", "x"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "magnitude", vec3_magnitude); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "normalize", vec3_normalize); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "interp", vec3_interp); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "interp", vec3_float); gwi_func_arg(gwi, "float", "delta"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "float", "interp", vec3_dur); gwi_func_arg(gwi, "dur", "delta"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "update", vec3_update); gwi_func_arg(gwi, "float", "goal"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "update", vec3_update_slew); gwi_func_arg(gwi, "float", "goal"); gwi_func_arg(gwi, "float", "slew"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "supdate", vec3_update_set); gwi_func_arg(gwi, "float", "goalAndValue"); - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_end(gwi, 0)) gwi_func_ini(gwi, "void", "supdate", vec3_update_set_slew); gwi_func_arg(gwi, "float", "goalAndValue"); gwi_func_arg(gwi, "float", "slew"); - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) - CHECK_BB(gwi_oper_ini(gwi, "Vec3", "Vec3", "Vec3")) - CHECK_BB(gwi_oper_end(gwi, "+", Vec3Add)) - CHECK_BB(gwi_oper_end(gwi, "-", Vec3Sub)) - CHECK_BB(gwi_oper_end(gwi, "*", Vec3Mul)) - CHECK_BB(gwi_oper_end(gwi, "/", Vec3Div)) - CHECK_BB(gwi_oper_add(gwi, opck_rassign)) - CHECK_BB(gwi_oper_end(gwi, "=>", Vec3RAssign)) - CHECK_BB(gwi_oper_ini(gwi, "Vec3", "float", "Vec3")) - CHECK_BB(gwi_oper_end(gwi, "+", Vec3AddFloat)) - CHECK_BB(gwi_oper_end(gwi, "-", Vec3SubFloat)) - CHECK_BB(gwi_oper_end(gwi, "*", Vec3MulFloat)) - CHECK_BB(gwi_oper_end(gwi, "/", Vec3DivFloat)) - CHECK_BB(gwi_oper_ini(gwi, "float", "Vec3", "Vec3")) - CHECK_BB(gwi_oper_end(gwi, "+", FloatAddVec3)) - CHECK_BB(gwi_oper_end(gwi, "-", FloatSubVec3)) - CHECK_BB(gwi_oper_end(gwi, "*", FloatMulVec3)) - CHECK_BB(gwi_oper_end(gwi, "/", FloatDivVec3)) + GWI_BB(gwi_oper_ini(gwi, "Vec3", "Vec3", "Vec3")) + GWI_BB(gwi_oper_end(gwi, "+", Vec3Add)) + GWI_BB(gwi_oper_end(gwi, "-", Vec3Sub)) + GWI_BB(gwi_oper_end(gwi, "*", Vec3Mul)) + GWI_BB(gwi_oper_end(gwi, "/", Vec3Div)) + GWI_BB(gwi_oper_add(gwi, opck_rassign)) + GWI_BB(gwi_oper_end(gwi, "=>", Vec3RAssign)) + GWI_BB(gwi_oper_ini(gwi, "Vec3", "float", "Vec3")) + GWI_BB(gwi_oper_end(gwi, "+", Vec3AddFloat)) + GWI_BB(gwi_oper_end(gwi, "-", Vec3SubFloat)) + GWI_BB(gwi_oper_end(gwi, "*", Vec3MulFloat)) + GWI_BB(gwi_oper_end(gwi, "/", Vec3DivFloat)) + GWI_BB(gwi_oper_ini(gwi, "float", "Vec3", "Vec3")) + GWI_BB(gwi_oper_end(gwi, "+", FloatAddVec3)) + GWI_BB(gwi_oper_end(gwi, "-", FloatSubVec3)) + GWI_BB(gwi_oper_end(gwi, "*", FloatMulVec3)) + GWI_BB(gwi_oper_end(gwi, "/", FloatDivVec3)) return GW_OK; } -- 2.43.0