From d4d4521e52f5066a03c36caf9b838937f03ae2ef Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 20 Jul 2021 22:09:59 +0300 Subject: [PATCH] more fixing of warnings --- src/core.h | 2 +- src/core/stuff.h | 2 -- src/utils/mut.h | 2 +- src/vm.h | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core.h b/src/core.h index b1808bfe..b4c81187 100644 --- a/src/core.h +++ b/src/core.h @@ -47,7 +47,7 @@ static i64 isum(B x) { // doesn't consume; may error; TODO error on overflow for (usz i = 0; i < xia; i++) r+= p[i]; } else if (xe==el_f64) { f64* p = f64any_ptr(x); - for (usz i = 0; i < xia; i++) { if(p[i]!=(f64)p[i]) thrM("Expected integer"); r+= p[i]; } + for (usz i = 0; i < xia; i++) { if(p[i]!=(i64)p[i]) thrM("Expected integer"); r+= p[i]; } } else { BS2B xgetU = TI(x,getU); for (usz i = 0; i < xia; i++) r+= o2i64(xgetU(x,i)); diff --git a/src/core/stuff.h b/src/core/stuff.h index 7bc5516d..34faa7d0 100644 --- a/src/core/stuff.h +++ b/src/core/stuff.h @@ -118,8 +118,6 @@ char* format_pm2(u8 u); bool isPureFn(B x); // doesn't consume B bqn_merge(B x); // consumes B bqn_squeeze(B x); // consumes -B rtUnder_c1(B f, B g, B x); -B rtUnder_cw(B f, B g, B w, B x); B def_getU(B x, usz n); B def_fn_uc1(B t, B o, B x); B def_fn_ucw(B t, B o, B w, B x); diff --git a/src/utils/mut.h b/src/utils/mut.h index 4637971c..3d65fd32 100644 --- a/src/utils/mut.h +++ b/src/utils/mut.h @@ -134,7 +134,7 @@ static B mut_getU(Mut* m, usz ms) { switch(m->type) { default: UD; case el_i32: return m_i32(m->ai32[ms]); case el_c32: return m_c32(m->ac32[ms]); - case el_f64: return m_c32(m->af64[ms]); + case el_f64: return m_f64(m->af64[ms]); case el_B: return m->aB[ms]; } } diff --git a/src/vm.h b/src/vm.h index b29ad064..3c447948 100644 --- a/src/vm.h +++ b/src/vm.h @@ -204,6 +204,6 @@ static inline void v_setI(Scope* sc, u32 p, B x, bool upd) { // consumes x sc->vars[p] = x; } static inline void v_set(Scope* pscs[], B s, B x, bool upd) { // doesn't consume - if (RARE(!isVar(s))) return v_setR(pscs, s, x, upd); - v_setI(pscs[(u16)(s.u>>32)], (u32)s.u, inc(x), upd); + if (RARE(!isVar(s))) v_setR(pscs, s, x, upd); + else v_setI(pscs[(u16)(s.u>>32)], (u32)s.u, inc(x), upd); }