diff --git a/src/builtins/arithm.c b/src/builtins/arithm.c index 5d8f26af..d41676bd 100644 --- a/src/builtins/arithm.c +++ b/src/builtins/arithm.c @@ -6,7 +6,7 @@ #include static inline B arith_recm(FC1 f, B x) { - B fx = getFillQ(x); + B fx = getFillR(x); B r = eachm_fn(bi_N, x, f); return withFill(r, fx); } diff --git a/src/builtins/cells.c b/src/builtins/cells.c index d43801f3..bbb7287a 100644 --- a/src/builtins/cells.c +++ b/src/builtins/cells.c @@ -61,11 +61,9 @@ B insert_base(B f, B x, usz xia, bool has_w, B w) { i32 fullCellFills = 2*CATCH_ERRORS; i32 cellFillErrored = 0; #define DO_CELL_CATCH (fullCellFills==2) - #define getFillQ2 (fullCellFills? getFillR : getFillQ) #define SET_FILL_ERRORED cellFillErrored = 1 #else #define DO_CELL_CATCH CATCH_ERRORS - #define getFillQ2 getFillQ #define SET_FILL_ERRORED #endif @@ -261,7 +259,7 @@ static NOINLINE B transp_cells(ur ax, ur k, B x) { // helpers static NOINLINE B to_fill_cell(B x, ur k, u32 chr) { // consumes x - B xf = getFillQ2(x); + B xf = getFillR(x); if (noFill(xf)) xf = m_f64(0); ur cr = RNK(x)-k; usz* sh = SH(x)+k; @@ -279,7 +277,7 @@ static NOINLINE B to_fill_cell(B x, ur k, u32 chr) { // consumes x static NOINLINE B merge_fill_result(B rc, ur k, usz* sh, u32 chr) { u64 rr = k; if (isArr(rc)) rr+= RNK(rc); if (rr>UR_MAX) thrF("%c: Result rank too large", chr); - Arr* r = m_fillarrpEmpty(getFillQ2(rc)); + Arr* r = m_fillarrpEmpty(getFillR(rc)); usz* rsh = arr_shAlloc(r, rr); if (rr>1) { shcpy(rsh, sh, k); diff --git a/src/builtins/fns.c b/src/builtins/fns.c index 79fd7a63..828a3642 100644 --- a/src/builtins/fns.c +++ b/src/builtins/fns.c @@ -143,7 +143,7 @@ B ud_c2(B t, B w, B x) { for (usz i=wr; ia, n); r = withFill(taga(r0), xf); diff --git a/src/builtins/group.c b/src/builtins/group.c index 2a3c1fd5..2eb06996 100644 --- a/src/builtins/group.c +++ b/src/builtins/group.c @@ -84,7 +84,7 @@ static B group_simple(B w, B x, ur xr, usz wia, usz xn, usz* xsh, u8 we) { Arr* r = m_fillarr0p(ria); B* rp = fillarr_ptr(r); - B xf = getFillQ(x); + B xf = getFillR(x); Arr* rf = m_fillarrpEmpty(xf); if (xr==1) arr_shVec(rf); else arr_shChangeLen(rf, xr, xsh, 0); @@ -297,8 +297,7 @@ B group_c2(B t, B w, B x) { for (usz i = 0; i < xn; i++) len[o2i64G(GetU(w, i))]++; Arr* r = m_fillarr0p(ria); - B xf = getFillQ(x); - incBy(xf, ria); + B xf = incBy(getFillN(x), ria+1); B* rp = fillarr_ptr(r); for (usz i = 0; i < ria; i++) { Arr* c = m_fillarrp(len[i]); diff --git a/src/builtins/internal.c b/src/builtins/internal.c index 6b6b121c..ddf04c52 100644 --- a/src/builtins/internal.c +++ b/src/builtins/internal.c @@ -186,7 +186,7 @@ B variation_c2(B t, B w, B x) { else if (u8_get(&wp, wpE, "h" )) res = taga(cpyHArr (incG(x))); else if (u8_get(&wp, wpE, "f")) { Arr* r = m_fillarrp(xia); - fillarr_setFill(r, getFillQ(x)); + fillarr_setFill(r, getFillR(x)); arr_shCopy(r, x); COPY_TO(fillarr_ptr(r), el_B, 0, x, 0, xia); NOGC_E; @@ -251,7 +251,7 @@ static B unshare(B x) { } case t_fillarr: case t_fillslice: { Arr* r = arr_shCopy(m_fillarr0p(xia), x); - fillarr_setFill(r, unshare(getFillQ(x))); + fillarr_setFill(r, unshare(getFillR(x))); B* rp = fillarr_ptr(r); B* xp = fillarr_ptr(a(x)); for (usz i = 0; i < xia; i++) rp[i] = unshare(xp[i]); diff --git a/src/builtins/md1.c b/src/builtins/md1.c index 6856d841..274b565f 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -39,7 +39,7 @@ static NOINLINE B homFil2(B f, B r, B wf, B xf) { B each_c1(Md1D* d, B x) { B f = d->f; B r, xf; - if (EACH_FILLS) xf = getFillQ(x); + if (EACH_FILLS) xf = getFillR(x); if (isAtm(x)) r = m_hunit(c1(f, x)); else if (isFun(f)) r = eachm_fn(f, x, c(Fun,f)->c1); @@ -103,8 +103,8 @@ B tbl_c2(Md1D* d, B w, B x) { B f = d->f; } B wf, xf; if (EACH_FILLS) { - assert(isArr(w)); wf=getFillQ(w); - assert(isArr(x)); xf=getFillQ(x); + assert(isArr(w)); wf=getFillR(w); + assert(isArr(x)); xf=getFillR(x); decG(w); decG(x); return homFil2(f, r, wf, xf); } else { @@ -120,8 +120,8 @@ static B eachd(B f, B w, B x) { B each_c2(Md1D* d, B w, B x) { B f = d->f; if (!EACH_FILLS) return eachd(f, w, x); - B wf = getFillQ(w); - B xf = getFillQ(x); + B wf = getFillR(w); + B xf = getFillR(x); return homFil2(f, eachd(f, w, x), wf, xf); } diff --git a/src/builtins/scan.c b/src/builtins/scan.c index 248b855f..832eb8b5 100644 --- a/src/builtins/scan.c +++ b/src/builtins/scan.c @@ -213,7 +213,7 @@ B scan_c1(Md1D* d, B x) { B f = d->f; } base:; SLOW2("𝕎` 𝕩", f, x); - B xf = getFillQ(x); + B xf = getFillR(x); bool reuse = TY(x)==t_harr && reusable(x); HArr_p r = reuse? harr_parts(REUSE(x)) : m_harr0c(x); @@ -277,7 +277,7 @@ B scan_c2(Md1D* d, B w, B x) { B f = d->f; } base:; SLOW3("𝕨 F` 𝕩", w, x, f); - B wf = getFillQ(w); + B wf = getFillR(w); bool reuse = (TY(x)==t_harr && reusable(x)) | !ia; usz i = 0; diff --git a/src/builtins/select.c b/src/builtins/select.c index 6d611f7c..02707911 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -163,7 +163,7 @@ B select_c2(B t, B w, B x) { goto setsh; } - B xf = getFillQ(x); + B xf = getFillR(x); usz xn = *SH(x); if (xn==0) goto base; usz csz = arr_csz(x); diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 6f6e7cbf..47304b97 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -5,7 +5,7 @@ #include "../builtins.h" NOINLINE Arr* emptyArr(B x, ur xr) { - B xf = getFillQ(x); + B xf = getFillR(x); if (xr==1) { if (isF64(xf)) return a(emptyIVec()); if (noFill(xf)) return a(emptyHVec()); @@ -251,12 +251,12 @@ B shape_c2(B t, B w, B x) { if (bi == 1) { memset(rp, rp[0], bf); bi=bf; } } else { if (TI(x,elType) == el_B) { - B xf = getFillQ(x); MAKE_MUT_INIT(m, nia, el_B); MUTG_INIT(m); i64 div = nia/xia; i64 mod = nia%xia; for (i64 i = 0; i < div; i++) mut_copyG(m, i*xia, x, 0, xia); mut_copyG(m, div*xia, x, 0, mod); + B xf = getFillR(x); decG(x); return withFill(taga(arr_shSetUO(mut_fp(m), nr, sh)), xf); } @@ -682,7 +682,6 @@ B join_c1(B t, B x) { } ur ir = RNK(xf); if (iria = wsum; // Shape-setting code at end of compress expects this } } else { // Bits @@ -492,7 +492,7 @@ static B compress(B w, B x, usz wia, u8 xl, u8 xt) { case 6: if (TI(x,elType)!=el_B) { BLOCK_OR_GROUPED(u64) } else { - B xf = getFillQ(x); + B xf = getFillR(x); B* xp = arr_bptr(x); if (xp!=NULL) { COMPRESS_BLOCK_PREP(B, HArr_p rh = m_harrUv(wsum); B *rp = rh.a;); @@ -684,7 +684,7 @@ B slash_c2(B t, B w, B x) { if (RARE(TI(x,elType)==el_B)) { // Slow case arrW_base: SLOW2("𝕨/𝕩", w, x); - B xf = getFillQ(x); + B xf = getFillR(x); usz csz = arr_csz(x); MAKE_MUT_INIT(r0, s*csz, TI(x,elType)); MUTG_INIT(r0); SGetU(w) @@ -765,7 +765,7 @@ B slash_c2(B t, B w, B x) { if (xlen == 0) return x; usz s = xlen * wv; if (xl>6 || (xl<3 && xl!=0) || TI(x,elType)==el_B) { - B xf = getFillQ(x); + B xf = getFillR(x); if (xr!=1) { MAKE_MUT_INIT(r0, IA(x) * wv, TI(x,elType)); MUTG_INIT(r0); usz csz = arr_csz(x); diff --git a/src/builtins/squeeze.c b/src/builtins/squeeze.c index f8c63592..6809af18 100644 --- a/src/builtins/squeeze.c +++ b/src/builtins/squeeze.c @@ -186,7 +186,7 @@ B squeeze_deep(B x) { usz ia = IA(x); M_HARR(r, ia) B* xp = arr_bptr(x); - B xf = getFillQ(x); + B xf = getFillR(x); if (xp!=NULL) { for (usz i=0; i UR_MAX) thrM(">: Result rank too large"); usz* rsh = arr_shAlloc(r, xr+xfr); if (rsh) { diff --git a/src/utils/each.c b/src/utils/each.c index 57d50103..8c6c5239 100644 --- a/src/utils/each.c +++ b/src/utils/each.c @@ -118,9 +118,9 @@ B eachm_fn(B fo, B x, FC1 f) { #if CATCH_ERRORS B arith_recd(FC2 f, B w, B x) { - B fx = getFillQ(x); + B fx = getFillR(x); if (noFill(fx)) return eachd_fn(bi_N, w, x, f); - B fw = getFillQ(w); + B fw = getFillR(w); B r = eachd_fn(bi_N, w, x, f); if (noFill(fw)) { dec(fx); return r; } if (CATCH) { freeThrown(); return r; }