]> Nishi Git Mirror - gwion.git/commitdiff
:art: Fix compiler warnings
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 17 Feb 2019 14:33:16 +0000 (15:33 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 17 Feb 2019 14:33:16 +0000 (15:33 +0100)
src/emit/emit.c
src/lib/instr.c
src/parse/check.c
src/parse/scan2.c
src/vm/vm.c

index e5e5a6ae54bdc0e6d0fd585edbe3ea880bfbed68..3cd48b7ecec2cdc0daef1bf708221799d48b5fd7 100644 (file)
@@ -272,7 +272,7 @@ ANN static m_bool emit_symbol_builtin(const Emitter emit, const Exp_Primary* pri
     } else if(v->d.ptr)
       memcpy(&instr->m_val, v->d.ptr, v->type->size);
     else
-      instr->m_val = v->d.ptr;
+      instr->m_val = (m_uint)v->d.ptr;
     instr->m_val2 = size;
   }
   return GW_OK;
index 04f70ac03d0870b6cc5bdfbde142a0c1eebd375e..7f111921d5d33d54b4bc038d8f6f5e2f58cf31cc 100644 (file)
@@ -117,14 +117,13 @@ INSTR(DotTmpl) {
     char str[instr->m_val2 + strlen(t->name) + 1];
     strcpy(str, name);
     strcpy(str + instr->m_val2, t->name);
-    const Value value = nspc_lookup_value1(t->nspc, insert_symbol(str));
     const Func f = nspc_lookup_func1(t->nspc, insert_symbol(str));
     if(f) {
       if(!f->code) {
-      const Emitter emit = shred->info->vm->gwion->emit;
-emit->env->name = "runtime";
-  const Value v = f->value_ref;
-m_str start = strchr(name, '<');
+        const Emitter emit = shred->info->vm->gwion->emit;
+        emit->env->name = "runtime";
+        const Value v = f->value_ref;
+        m_str start = strchr(name, '<');
 m_str end = strchr(name, '@');
 char c[instr->m_val2];
 strcpy(c, start + 1);
index fc809229f020c308a04f639185d84aa2b9fe7cdc..b6ef1b57be0c6bb03f612606d8447f06d4e4ae1b 100644 (file)
@@ -442,9 +442,9 @@ ANN Func find_template_match(const Env env, const Value value, const Exp_Call* e
    Value v = nspc_lookup_value1(t->nspc, value->d.func_ref->def->name);
    if(!v)
      goto next;
-     const Func f = _find_template_match(env, v, exp);
-     if(f)
-       return f;
+   const Func f = _find_template_match(env, v, exp);
+   if(f)
+     return f;
    next:
      t = t->parent;
   }
index 05753c153f0e859fd703a6ac131d8322789bda19..7ab64c34fd8ab2639132811db57d309ec15055b8 100644 (file)
@@ -494,10 +494,10 @@ ANN m_bool scan2_func_def(const Env env, const Func_Def f) { GWDEBUG_EXE
     const Symbol sym  = func_symbol(env->curr->name, func_name, NULL, overload ? ++overload->offset : 0);
     func_name = s_name(sym);
   } else {
-if(f->func)
-  func_name = f->func->name;
-else
-    func_name = func_tmpl_name(env, f);
+    if(f->func)
+      func_name = f->func->name;
+    else
+      func_name = func_tmpl_name(env, f);
     const Func func = nspc_lookup_func1(env->curr, insert_symbol(func_name));
     if(func) {
       f->ret_type = type_decl_resolve(env, f->td);
index c43f0fc8d600d1bc2e8449303872f729e8322363..ec67d591ea37a208ecd289134e0f06481cf06871 100644 (file)
@@ -19,6 +19,7 @@
 #include "map_private.h"
 
 #include "value.h"
+#include "gack.h"
 
 
 static inline uint64_t splitmix64_stateless(uint64_t index) {
@@ -309,7 +310,7 @@ regpushother:
   reg += instr->m_val2;
   DISPATCH();
 regpushaddr:
-  *(m_bit**)reg =  &instr->m_val;
+  *(m_uint**)reg =  &instr->m_val;
   reg += SZ_INT;
   DISPATCH()
 regpushmem: