From: fennecdjay Date: Mon, 23 Sep 2019 14:45:24 +0000 (+0200) Subject: :shirt: Remove compiler warnings X-Git-Tag: nightly~2212^2~5 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2a6ce4c14f79dffc389af94c18c525e4b2f03a96;p=gwion.git :shirt: Remove compiler warnings --- diff --git a/include/specialid.h b/include/specialid.h index 13fe0e5f..3f92935c 100644 --- a/include/specialid.h +++ b/include/specialid.h @@ -3,8 +3,8 @@ //typedef struct SpecialId_* SpecialId; struct SpecialId_; -typedef Type (*idck)(const Env, Exp_Primary*); -typedef Instr (*idem)(const Emitter, Exp_Primary*); +typedef Type (*idck)(const Env, const Exp_Primary*); +typedef Instr (*idem)(const Emitter, const Exp_Primary*); struct SpecialId_ { Type type; @@ -14,8 +14,8 @@ struct SpecialId_ { m_bool is_const; }; -#define ID_CHECK(a) ANN Type a(const Env env NUSED, Exp_Primary* prim NUSED) -#define ID_EMIT(a) ANN Instr a(const Emitter emit NUSED, Exp_Primary* prim NUSED) +#define ID_CHECK(a) ANN Type a(const Env env NUSED, const Exp_Primary* prim NUSED) +#define ID_EMIT(a) ANN Instr a(const Emitter emit NUSED, const Exp_Primary* prim NUSED) ANN static inline Type specialid_type(const Env env, struct SpecialId_ *spid, const Exp_Primary* prim) { diff --git a/src/gwiondata.c b/src/gwiondata.c index 11306a63..a8dc8468 100644 --- a/src/gwiondata.c +++ b/src/gwiondata.c @@ -6,6 +6,7 @@ #include "vm.h" #include "instr.h" #include "gwion.h" +#include "emit.h" #include "specialid.h" ANN GwionData* new_gwiondata(MemPool mp) { diff --git a/src/lib/shred.c b/src/lib/shred.c index da411adf..49a64918 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -12,6 +12,7 @@ #include "gwion.h" #include "operator.h" #include "import.h" +#include "emit.h" #include "specialid.h" static m_int o_fork_thread, o_shred_cancel, o_fork_done, o_fork_ev, o_fork_retsize, o_fork_retval, diff --git a/src/lib/string.c b/src/lib/string.c index fbb3ecba..a0f08b87 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -13,6 +13,7 @@ #include "gwion.h" #include "operator.h" #include "import.h" +#include "emit.h" #include "specialid.h" #include "func.h" @@ -173,10 +174,10 @@ static CTOR(string_ctor) { ANN Type prim_str(const Env, Exp_Primary *const); ID_CHECK(check_funcpp) { - prim->primary_type = ae_primary_str; - prim->d.str = env->func ? env->func->name : env->class_def ? + ((Exp_Primary*)prim)->primary_type = ae_primary_str; + ((Exp_Primary*)prim)->d.str = env->func ? env->func->name : env->class_def ? env->class_def->name : env->name; - return prim_str(env, prim); + return prim_str(env, (Exp_Primary * const)prim); } GWION_IMPORT(string) { diff --git a/src/parse/check.c b/src/parse/check.c index 9c8881bc..8f8389bf 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -20,6 +20,7 @@ #include "match.h" #include "cpy_ast.h" #include "tuple.h" +#include "emit.h" #include "specialid.h" ANN static Type check_exp(const Env env, Exp exp);