From bc3013b48b83d6b2d2afa7e66799cb0c37e2baa8 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 28 Jan 2023 12:33:16 +0000 Subject: [PATCH] Updated Toy --- Toy | 2 +- box/lib_engine.c | 3 +-- box/lib_input.c | 3 +-- box/lib_node.c | 3 +-- box/lib_runner.c | 3 +-- box/lib_standard.c | 3 +-- box/lib_timer.c | 3 +-- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Toy b/Toy index f4469fc..aeda0a0 160000 --- a/Toy +++ b/Toy @@ -1 +1 @@ -Subproject commit f4469fc53dbe593fe787061c5da4e1fee511246b +Subproject commit aeda0a0d949768c342b3bb7e275f2afdc27c643e diff --git a/box/lib_engine.c b/box/lib_engine.c index bf7c73e..bc870f5 100644 --- a/box/lib_engine.c +++ b/box/lib_engine.c @@ -192,8 +192,7 @@ int Box_hookEngine(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lit //load the dict with functions for (int i = 0; natives[i].name; i++) { Toy_Literal name = TOY_TO_STRING_LITERAL(Toy_createRefString(natives[i].name)); - Toy_Literal func = TOY_TO_FUNCTION_LITERAL((void*)natives[i].fn, 0); - func.type = TOY_LITERAL_FUNCTION_NATIVE; + Toy_Literal func = TOY_TO_FUNCTION_NATIVE_LITERAL(natives[i].fn); Toy_setLiteralDictionary(dictionary, name, func); diff --git a/box/lib_input.c b/box/lib_input.c index 881b27d..a0c05a4 100644 --- a/box/lib_input.c +++ b/box/lib_input.c @@ -95,8 +95,7 @@ int Box_hookInput(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lite //load the dict with functions for (int i = 0; natives[i].name; i++) { Toy_Literal name = TOY_TO_STRING_LITERAL(Toy_createRefString(natives[i].name)); - Toy_Literal func = TOY_TO_FUNCTION_LITERAL((void*)natives[i].fn, 0); - func.type = TOY_LITERAL_FUNCTION_NATIVE; + Toy_Literal func = TOY_TO_FUNCTION_NATIVE_LITERAL(natives[i].fn); Toy_setLiteralDictionary(dictionary, name, func); diff --git a/box/lib_node.c b/box/lib_node.c index f9ec1e5..565ebed 100644 --- a/box/lib_node.c +++ b/box/lib_node.c @@ -674,8 +674,7 @@ int Box_hookNode(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Liter //load the dict with functions for (int i = 0; natives[i].name; i++) { Toy_Literal name = TOY_TO_STRING_LITERAL(Toy_createRefString(natives[i].name)); - Toy_Literal func = TOY_TO_FUNCTION_LITERAL((void*)natives[i].fn, 0); - func.type = TOY_LITERAL_FUNCTION_NATIVE; + Toy_Literal func = TOY_TO_FUNCTION_NATIVE_LITERAL(natives[i].fn); Toy_setLiteralDictionary(dictionary, name, func); diff --git a/box/lib_runner.c b/box/lib_runner.c index ee1c5ef..6ea1eba 100644 --- a/box/lib_runner.c +++ b/box/lib_runner.c @@ -514,8 +514,7 @@ int Toy_hookRunner(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lit //load the dict with functions for (int i = 0; natives[i].name; i++) { Toy_Literal name = TOY_TO_STRING_LITERAL(Toy_createRefString(natives[i].name)); - Toy_Literal func = TOY_TO_FUNCTION_LITERAL((void*)natives[i].fn, 0); - func.type = TOY_LITERAL_FUNCTION_NATIVE; + Toy_Literal func = TOY_TO_FUNCTION_NATIVE_LITERAL(natives[i].fn); Toy_setLiteralDictionary(dictionary, name, func); diff --git a/box/lib_standard.c b/box/lib_standard.c index b253286..bb427b7 100644 --- a/box/lib_standard.c +++ b/box/lib_standard.c @@ -59,8 +59,7 @@ int Toy_hookStandard(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_L //load the dict with functions for (int i = 0; natives[i].name; i++) { Toy_Literal name = TOY_TO_STRING_LITERAL(Toy_createRefString(natives[i].name)); - Toy_Literal func = TOY_TO_FUNCTION_LITERAL((void*)natives[i].fn, 0); - func.type = TOY_LITERAL_FUNCTION_NATIVE; + Toy_Literal func = TOY_TO_FUNCTION_NATIVE_LITERAL(natives[i].fn); Toy_setLiteralDictionary(dictionary, name, func); diff --git a/box/lib_timer.c b/box/lib_timer.c index 60a4c28..f0d3194 100644 --- a/box/lib_timer.c +++ b/box/lib_timer.c @@ -376,8 +376,7 @@ int Toy_hookTimer(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lite //load the dict with functions for (int i = 0; natives[i].name; i++) { Toy_Literal name = TOY_TO_STRING_LITERAL(Toy_createRefString(natives[i].name)); - Toy_Literal func = TOY_TO_FUNCTION_LITERAL((void*)natives[i].fn, 0); - func.type = TOY_LITERAL_FUNCTION_NATIVE; + Toy_Literal func = TOY_TO_FUNCTION_NATIVE_LITERAL(natives[i].fn); Toy_setLiteralDictionary(dictionary, name, func);