From 96c68b66c566a54fcf4b899f3b47ed92ac8569ed Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 10 Sep 2021 17:59:26 +0300 Subject: [PATCH] =?UTF-8?q?typed=20=E2=8C=BE(n=E2=8A=B8=E2=8A=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sfns.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 492e0c7c..ca2de80e 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -921,19 +921,15 @@ B pick_ucw(B t, B o, B w, B x) { B arg = IGet(x, wi); B rep = c1(o, arg); if (reusable(x) && TI(x,canStore)(rep)) { - if (TI(x,elType)==el_i32) { - i32* xp = i32any_ptr(x); - xp[wi] = o2i(rep); - return x; - } else if (v(x)->type==t_harr) { + if (TI(x,elType)==el_i8 ) { i8* xp = i8any_ptr (x); xp[wi] = o2iu(rep); return x; } + else if (TI(x,elType)==el_i16) { i16* xp = i16any_ptr(x); xp[wi] = o2iu(rep); return x; } + else if (TI(x,elType)==el_i32) { i32* xp = i32any_ptr(x); xp[wi] = o2iu(rep); return x; } + else if (TI(x,elType)==el_f64) { f64* xp = f64any_ptr(x); xp[wi] = o2fu(rep); return x; } + else if (v(x)->type==t_harr) { B* xp = harr_ptr(x); dec(xp[wi]); xp[wi] = rep; return x; - } else if (TI(x,elType)==el_f64) { - f64* xp = f64any_ptr(x); - xp[wi] = o2f(rep); - return x; } else if (v(x)->type==t_fillarr) { B* xp = fillarr_ptr(a(x)); dec(xp[wi]);