From 51d35b6e03e4f9de1fd46981a2778583dd0eef36 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 23 May 2019 10:19:20 +0200 Subject: [PATCH] :shirt: Improve lib --- src/lib/array.c | 1 + src/lib/object.c | 2 +- src/lib/opfunc.c | 3 ++- src/lib/string.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/array.c b/src/lib/array.c index 2b421af3..3421c361 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -13,6 +13,7 @@ #include "emit.h" #include "import.h" #include "operator.h" +#include "traverse.h" #include "parse.h" struct M_Vector_ { diff --git a/src/lib/object.c b/src/lib/object.c index 3a04f52b..6ac47a7d 100644 --- a/src/lib/object.c +++ b/src/lib/object.c @@ -125,7 +125,7 @@ static inline Type new_force_type(MemPool p, const Type t, const Symbol sym) { static Type get_force_type(const Env env, const Type t) { const size_t len = strlen(t->name); - char name[len + STRLEN_FORCE + 1]; + char name[len + STRLEN_FORCE + 2]; strcpy(name, t->name); strcpy(name + len, STR_FORCE); const Symbol sym = insert_symbol(env->gwion->st, name); diff --git a/src/lib/opfunc.c b/src/lib/opfunc.c index 18f6293f..9d02745f 100644 --- a/src/lib/opfunc.c +++ b/src/lib/opfunc.c @@ -9,6 +9,7 @@ #include "object.h" #include "import.h" #include "emit.h" +#include "traverse.h" #include "parse.h" static inline m_str access(ae_Exp_Meta meta) { @@ -64,7 +65,7 @@ OP_CHECK(opck_unary_meta2_uniq) { const Exp_Unary* unary = (Exp_Unary*)data; CHECK_OO(opck_unary_meta2(env, data)) if(unary->exp->next) - ERR_N(stmt_self(unary)->pos, "fuck!!") + ERR_N(exp_self(unary)->pos, "fuck!!") return t_int; } diff --git a/src/lib/string.c b/src/lib/string.c index d979ff12..f65c4d1f 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -127,7 +127,7 @@ describe_string(Vec4, m_vec4, SZ_VEC4, num_digit((m_uint)lhs.y) + num_digit((m_uint)lhs.z) + num_digit((m_uint)lhs.w),, "@(%f, %f, %f, %f)%s", lhs.x, lhs.y, lhs.z, lhs.w, rhs ? STRING(rhs) : "") describe_string(Object, M_Object, SZ_INT, - 11 + (rhs ? strlen(STRING(rhs)) : 0), release(lhs, shred), + 16 + (rhs ? strlen(STRING(rhs)) : 0), release(lhs, shred), "%p%s", (void*)lhs, rhs ? STRING(rhs) : "") -- 2.43.0