clean up gcc warnings

This commit is contained in:
dzaima 2023-01-25 17:16:24 +02:00
parent a262bdf1a3
commit e231d36471
5 changed files with 11 additions and 10 deletions

View File

@ -377,7 +377,7 @@ B rank_c2(Md2D* d, B w, B x) { B f = d->f; B g = d->g;
usz cam = shProd(xsh, 0, k);
if (cam == 0) return rank2_empty(f, w, 0, x, k);
usz csz = shProd(xsh, k, xr);
ShArr* csh;
ShArr* csh ONLY_GCC(=0);
if (xc>1) { csh=m_shArr(xc); shcpy(csh->a, xsh+k, xc); }
BSS2A slice = TI(x,slice);
@ -403,7 +403,7 @@ B rank_c2(Md2D* d, B w, B x) { B f = d->f; B g = d->g;
usz cam = shProd(wsh, 0, k);
if (cam == 0) return rank2_empty(f, w, k, x, 0);
usz csz = shProd(wsh, k, wr);
ShArr* csh;
ShArr* csh ONLY_GCC(=0);
if (wc>1) { csh=m_shArr(wc); shcpy(csh->a, wsh+k, wc); }
BSS2A slice = TI(w,slice);
@ -439,8 +439,8 @@ B rank_c2(Md2D* d, B w, B x) { B f = d->f; B g = d->g;
usz wsz = shProd(wsh, wk, wr);
usz xsz = shProd(xsh, xk, xr);
ShArr* wcs; if (wc>1) { wcs=m_shArr(wc); shcpy(wcs->a, wsh+wk, wc); }
ShArr* xcs; if (xc>1) { xcs=m_shArr(xc); shcpy(xcs->a, xsh+xk, xc); }
ShArr* wcs ONLY_GCC(=0); if (wc>1) { wcs=m_shArr(wc); shcpy(wcs->a, wsh+wk, wc); }
ShArr* xcs ONLY_GCC(=0); if (xc>1) { xcs=m_shArr(xc); shcpy(xcs->a, xsh+xk, xc); }
BSS2A wslice = TI(w,slice);
BSS2A xslice = TI(x,slice);

View File

@ -173,7 +173,7 @@ B shape_c2(B t, B w, B x) {
} else {
SGetU(w)
i32 unkPos = -1;
i32 unkInd ONLY_GCC(= 0);
i32 unkInd ONLY_GCC(=0);
bool bad=false, good=false;
for (i32 i = 0; i < nr; i++) {
B c = GetU(w, i);
@ -546,6 +546,7 @@ NOINLINE B takedrop_highrank(bool take, B w, B x) {
usz ri=0, xi=0; // index of first copy
usz xSkip, rSkip; // amount to skip forward by
usz cellWrite = 0; // batch write cell size
ONLY_GCC(xSkip=rSkip=USZ_MAX/2;)
for (usz i=rr; i-->0; ) {
usz xshc = i<rr-xr? 1 : xsh[i-(rr-xr)];
usz rshc = rsh->a[i];
@ -625,7 +626,7 @@ NOINLINE B takedrop_highrank(bool take, B w, B x) {
i64 wv = o2i64(w); \
i64 n = wv; \
ur xr = RNK(x); \
usz csz=1; usz* xsh; \
usz csz=1; usz* xsh ONLY_GCC(=0); \
if (xr>1) { \
csz = arr_csz(x); \
xsh = SH(x); \

View File

@ -631,7 +631,7 @@ B slash_c1(B t, B x) {
B slash_c2(B t, B w, B x) {
i32 wv = -1;
usz wia ONLY_GCC(= 0);
usz wia ONLY_GCC(=0);
if (isArr(w)) {
if (depth(w)>1) goto base;
ur wr = RNK(w);

View File

@ -939,9 +939,9 @@ void ffi_init() {
switch (id) { default: err("bad id");
case 0: {
char* s = toCStr(x);
chdir(s);
i32 r = chdir(s);
freeCStr(s);
return x;
return m_f64(r);
}
case 1: {
dec(x);

View File

@ -96,7 +96,7 @@ B eachm_fn(B fo, B x, BB2B f) {
void* xp = tyany_ptr(x);
switch(TI(x,elType)) { default: UD;
case el_B: { SGet(x);
for (; i<ia; i++) HARR_ADD(r, i, f(fo, Get(x,i))); break; }
{ for (; i<ia; i++) HARR_ADD(r, i, f(fo, Get(x,i))); } break; }
case el_bit: for (; i<ia; i++) HARR_ADD(r, i, f(fo, m_i32(bitp_get(xp,i)))); break;
case el_i8: for (; i<ia; i++) HARR_ADD(r, i, f(fo, m_i32(((i8* )xp)[i]))); break;
case el_i16: for (; i<ia; i++) HARR_ADD(r, i, f(fo, m_i32(((i16*)xp)[i]))); break;