random changes
This commit is contained in:
parent
70dcc25c51
commit
74fe1f1243
@ -27,7 +27,6 @@ B ne_c1(B t, B x) { B r = m_f64(isArr(x)&&rnk(x)? *a(x)->sh : 1); decR(x); retur
|
||||
|
||||
extern B rt_sortDsc;
|
||||
B or_c1(B t, B x) { return c1(rt_sortDsc, x); }
|
||||
B and_c1(B t, B x); // defined in sort.c
|
||||
|
||||
void arith_init() {
|
||||
c(BFn,bi_add)->ident = c(BFn,bi_sub)->ident = c(BFn,bi_or )->ident = c(BFn,bi_ne)->ident = c(BFn,bi_gt)->ident = m_i32(0);
|
||||
|
||||
@ -89,8 +89,9 @@ B withFill(B x, B fill) { // consumes both
|
||||
#ifdef DEBUG
|
||||
validateFill(fill);
|
||||
#endif
|
||||
if (noFill(fill) && v(x)->type!=t_fillarr && v(x)->type!=t_fillslice) return x;
|
||||
switch(v(x)->type) {
|
||||
u8 xt = v(x)->type;
|
||||
if (noFill(fill) && xt!=t_fillarr && xt!=t_fillslice) return x;
|
||||
switch(xt) {
|
||||
case t_f64arr : case t_f64slice:
|
||||
case t_i32arr : case t_i32slice: if(fill.u == m_i32(0 ).u) return x; break;
|
||||
case t_c32arr : case t_c32slice: if(fill.u == m_c32(' ').u) return x; break;
|
||||
@ -105,7 +106,7 @@ B withFill(B x, B fill) { // consumes both
|
||||
}
|
||||
usz ia = a(x)->ia;
|
||||
if (isNum(fill)) {
|
||||
if (v(x)->type==t_harr) {
|
||||
if (xt==t_harr) {
|
||||
B* xp = harr_ptr(x);
|
||||
{
|
||||
i32* rp; B r = m_i32arrc(&rp, x);
|
||||
|
||||
@ -71,7 +71,7 @@ static void decSh(Value* x) { if (prnk(x)>1) ptr_dec(shObjP(x)); }
|
||||
|
||||
// some array stuff
|
||||
|
||||
#define WRAP(X,IA,MSG) ({ i64 wV=(i64)(X); u64 iaW=(IA); if(RARE((u64)wV >= iaW)) { if(wV<0) wV+= iaW; if((u64)wV >= iaW) MSG; }; (usz)wV; })
|
||||
#define WRAP(X,IA,MSG) ({ i64 wV=(i64)(X); u64 iaW=(IA); if(RARE((u64)wV >= iaW)) { if(wV<0) wV+= iaW; if((u64)wV >= iaW) {MSG;} }; (usz)wV; })
|
||||
static void arr_shVec(B x, usz ia) {
|
||||
a(x)->ia = ia;
|
||||
srnk(x, 1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user