diff --git a/src/builtins/select.c b/src/builtins/select.c index 6d4d4adf..db080f66 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -987,8 +987,8 @@ B select_ucw(B t, B o, B w, B x) { } else { rep = c1(o, C2(select, incG(w), incG(x))); } - usz xr = RNK(x); - usz wr = RNK(w); + ur xr = RNK(x); + ur wr = RNK(w); bool ok = isArr(rep) && xr+wr == RNK(rep)+1 && eqShPart(SH(w),SH(rep),wr) && eqShPart(SH(x)+1,SH(rep)+wr,xr-1); if (!ok) thrF("π”½βŒΎ(a⊸⊏)𝕩: 𝔽 must return an array with the same shape as its input (%H ≑ shape of a, %2H ≑ shape of βŠπ•©, %H ≑ shape of result of 𝔽)", w, xr-1, SH(x)+1, rep); usz csz = arr_csz(x); diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 2ebd8302..a5871c49 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -370,10 +370,10 @@ static NOINLINE void checkIndexList(B w, ur xr) { } // calculate index into variable RES; reads xsh, defines i for GET -#define PICK_IDX(RES, GET, RNK, OOB) \ - usz RES = 0; \ - for (usz i=0, rnk_=(RNK); i < rnk_; i++) { \ - c = c*xsh[i] + WRAP(GET, xsh[i], OOB); \ +#define PICK_IDX(RES, GET, RNK, OOB) \ + usz RES = 0; \ + for (ux i=0, rnk_=(RNK); i < rnk_; i++) { \ + c = c*xsh[i] + WRAP(GET, xsh[i], OOB); \ } static i64 pick_convFloat(f64 f) { @@ -844,7 +844,7 @@ B join_c1(B t, B x) { for (usz i=0; i1) thrF("βˆΎπ•©: Item ranks along an axis can differ by at most one (contained ranks %i and %i along axis %i)", ll[i], r1, a); + if (rd>1) thrF("βˆΎπ•©: Item ranks along an axis can differ by at most one (contained ranks %s and %i along axis %i)", ll[i], r1, a); ll[i] = -1; } else { B c = GetU(x, i*step); @@ -1298,7 +1298,7 @@ B reverse_c2(B t, B w, B x) { } -static usz pick_oneIndex(B w, usz xr, usz* xsh) { // throws if guaranteed bad; returns USZ_MAX if not a plain index +static usz pick_oneIndex(B w, ur xr, usz* xsh) { // throws if guaranteed bad; returns USZ_MAX if not a plain index assert(xr!=0); if (RARE(isAtm(w) || IA(w)!=xr || RNK(w)!=1)) return USZ_MAX; switch(TI(w,elType)) { default: UD; diff --git a/src/utils/mut.c b/src/utils/mut.c index 2109d1b6..44dea6f9 100644 --- a/src/utils/mut.c +++ b/src/utils/mut.c @@ -569,7 +569,7 @@ Arr* apd_sh_err(ApdMut* m, u32 ty) { Arr* apd_rnk_err(ApdMut* m, u32 ty) { ur er = RNK(m->failEl); // if it were atom, rank couldn't overflow decG(m->failEl); - thrF("%U: Result rank too large (%i ≑ =𝕩, %s ≑ =%U)", apd_ty_base(ty), m->rr0, er, ty==1? "βŠ‘π•©" : "𝔽v"); + thrF("%U: Result rank too large (%i ≑ =𝕩, %i ≑ =%U)", apd_ty_base(ty), m->rr0, er, ty==1? "βŠ‘π•©" : "𝔽v"); } NOINLINE void apd_sh_fail(ApdMut* m, B x, u8 mode) { if (mode<=1) m->cr = mode;