From ea5abeff1824fcde3a3713430c413270231dafde Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 4 Apr 2022 21:29:37 +0300 Subject: [PATCH] simpler o2bu --- src/h.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/h.h b/src/h.h index 158a0294..95a1fba7 100644 --- a/src/h.h +++ b/src/h.h @@ -411,7 +411,7 @@ static usz o2su (B x) { return (usz)x.f; } static f64 o2fu (B x) { return x.f; } static i64 o2i64u(B x) { return (i64)x.f; } static bool o2b (B x) { i32 t=(i32)x.f; if(t!=x.f || t!=0&t!=1)thrM("Expected boolean"); return t; } -static bool o2bu (B x) { return o2s(x); } +static bool o2bu (B x) { return (x.u<<1) != 0; } static bool q_bit(B x) { return isNum(x) & (x.f==0 | x.f==1); } static bool q_c8 (B x) { return isC32(x) && ((u32)x.u) == ((u8 )x.u); } static bool q_c16(B x) { return isC32(x) && ((u32)x.u) == ((u16)x.u); }