fixes for usz==u64
This commit is contained in:
parent
1d13a1ef07
commit
17a3ed150d
@ -793,7 +793,7 @@ B group_c2(B t, B w, B x) {
|
||||
if (ria<-1) thrM("⊔: 𝕨 can't contain elements less than ¯1");
|
||||
ria--;
|
||||
for (usz i = 0; i < xia; i++) if (wp[i]>ria) ria = wp[i];
|
||||
if (ria>USZ_MAX-1) thrOOM();
|
||||
if (ria > (i64)(USZ_MAX-1)) thrOOM();
|
||||
ria++;
|
||||
TALLOC(i32, lenO, ria+1); i32* len = lenO+1;
|
||||
TALLOC(i32, pos, ria);
|
||||
@ -854,7 +854,7 @@ B group_c2(B t, B w, B x) {
|
||||
if (c>ria) ria = c;
|
||||
if (c<-1) thrM("⊔: 𝕨 can't contain elements less than ¯1");
|
||||
}
|
||||
if (ria>USZ_MAX-1) thrOOM();
|
||||
if (ria > (i64)(USZ_MAX-1)) thrOOM();
|
||||
ria++;
|
||||
TALLOC(i32, lenO, ria+1); i32* len = lenO+1;
|
||||
TALLOC(i32, pos, ria);
|
||||
|
||||
@ -110,7 +110,7 @@ B grLen_both(i64 ria, B x) {
|
||||
i64 c = o2i64u(xgetU(x, i));
|
||||
if (c>ria) ria = c;
|
||||
}
|
||||
if (ria>USZ_MAX-1) thrOOM();
|
||||
if (ria > (i64)(USZ_MAX-1)) thrOOM();
|
||||
ria++;
|
||||
i32* rp; B r = m_i32arrv(&rp, ria);
|
||||
for (usz i = 0; i < ria; i++) rp[i] = 0;
|
||||
|
||||
6
src/h.h
6
src/h.h
@ -117,9 +117,11 @@
|
||||
#define N64u "%"SCNu64
|
||||
|
||||
typedef u32 usz;
|
||||
typedef u8 ur;
|
||||
#define USZ_MAX ((u32)((1LL<<32)-1))
|
||||
#define UR_MAX 255
|
||||
// typedef u64 usz;
|
||||
// #define USZ_MAX ((u64)(1ULL<<48))
|
||||
typedef u8 ur;
|
||||
#define UR_MAX 255
|
||||
|
||||
#define CTR_FOR(F)
|
||||
#define CTR_PRINT(N) if(N) printf(#N ": "N64u"\n", N);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user