diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index b5dceba0..fc8ebcdf 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -173,14 +173,14 @@ B select_c2(B t, B w, B x) { if ((usz)c >= cam) { mut_pfree(r, i*csz); thrF("โŠ: Indexing out-of-bounds (%RโˆŠ๐•จ, %sโ‰กโ‰ ๐•ฉ)", cw, cam); } mut_copy(r, i*csz, x, csz*(usz)c, csz); } - B rb = mut_fp(r); - usz* rsh = arr_shAllocR(rb, rr); + Arr* ra = mut_fp(r); + usz* rsh = arrP_shAllocR(ra, rr); if (rsh) { memcpy(rsh , a(w)->sh , wr *sizeof(usz)); memcpy(rsh+wr, a(x)->sh+1, (xr-1)*sizeof(usz)); } dec(w); dec(x); - return withFill(rb,xf); + return withFill(taga(ra),xf); } base: dec(xf); @@ -432,14 +432,14 @@ B join_c1(B t, B x) { ri+= cia; } assert(ri==cam*csz); - B rb = mut_fp(r); - usz* sh = arr_shAllocR(rb, ir); + Arr* ra = mut_fp(r); + usz* sh = arrP_shAllocR(ra, ir); if (sh) { sh[0] = cam; memcpy(sh+1, x0sh+1, sizeof(usz)*(ir-1)); } dec(x); - return SFNS_FILLS? qWithFill(rb, rf) : rb; + return SFNS_FILLS? qWithFill(taga(ra), rf) : taga(ra); } return c1(rt_join, x); } @@ -470,8 +470,8 @@ B join_c2(B t, B w, B x) { mut_to(r, el_or(TI(w).elType, TI(x).elType)); mut_copy(r, 0, w, 0, wia); mut_copy(r, wia, x, 0, xia); - B rb = mut_fp(r); - usz* sh = arr_shAllocR(rb, c); + Arr* ra = mut_fp(r); + usz* sh = arrP_shAllocR(ra, c); if (sh) { for (i32 i = 1; i < c; i++) { usz s = xsh[i+xr-c]; @@ -481,7 +481,7 @@ B join_c2(B t, B w, B x) { sh[0] = (wr==c? wsh[0] : 1) + (xr==c? xsh[0] : 1); } dec(w); dec(x); - return qWithFill(rb, f); + return qWithFill(taga(ra), f); } @@ -516,13 +516,13 @@ B couple_c2(B t, B w, B x) { MAKE_MUT(r, ia*2); mut_copy(r, 0, w, 0, ia); mut_copy(r, ia, x, 0, ia); - B rb = mut_fp(r); - usz* sh = arr_shAllocR(rb, wr+1); + Arr* ra = mut_fp(r); + usz* sh = arrP_shAllocR(ra, wr+1); if (sh) { sh[0]=2; memcpy(sh+1, a(w)->sh, wr*sizeof(usz)); } - if (!SFNS_FILLS) { dec(w); dec(x); return rb; } + if (!SFNS_FILLS) { dec(w); dec(x); return taga(ra); } B rf = fill_both(w, x); dec(w); dec(x); - return qWithFill(rb, rf); + return qWithFill(taga(ra), rf); } diff --git a/src/core/stuff.c b/src/core/stuff.c index 946e5963..ba3d3052 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -451,14 +451,14 @@ B bqn_merge(B x) { // consumes if (!noFill(fill)) fill = fill_or(fill, getFillQ(c)); rp+= elIA; } - B rb = mut_fp(r); - usz* rsh = arr_shAllocR(rb, xr+elR); + Arr* ra = mut_fp(r); + usz* rsh = arrP_shAllocR(ra, xr+elR); if (rsh) { memcpy (rsh , a(x)->sh, xr *sizeof(usz)); if (elSh)memcpy(rsh+xr, elSh, elR*sizeof(usz)); } dec(x); - return withFill(rb,fill); + return withFill(taga(ra),fill); } #ifdef ALLOC_STAT diff --git a/src/utils/mut.h b/src/utils/mut.h index 3ec71028..19c32bea 100644 --- a/src/utils/mut.h +++ b/src/utils/mut.h @@ -52,9 +52,6 @@ static B mut_fv(Mut* m) { assert(m->type!=el_MAX); srnk(r, 1); return r; } -static B mut_fp(Mut* m) { assert(m->type!=el_MAX); // has ia set - return taga(m->val); -} static B mut_fc(Mut* m, B x) { assert(m->type!=el_MAX); B r = taga(m->val); arr_shCopy(r, x); @@ -66,6 +63,9 @@ static B mut_fcd(Mut* m, B x) { assert(m->type!=el_MAX); dec(x); return r; } +static Arr* mut_fp(Mut* m) { assert(m->type!=el_MAX); // has ia set + return m->val; +} static u8 el_or(u8 a, u8 b) { #define M(X) if(b==X) return a>X?a:X;