couple more type fixes

This commit is contained in:
dzaima 2021-07-21 00:03:45 +03:00
parent 5dd7288144
commit 55f7f8ef5b
2 changed files with 3 additions and 3 deletions

View File

@ -302,7 +302,7 @@ NOINLINE i32 compareR(B w, B x) {
rc = CMP(wm, xm);
rm*= wm<xm? wm : xm;
}
for (int i = 0; i < rm; i++) {
for (u64 i = 0; i < (u64)rm; i++) {
int c = compare(wgetU(w,i), xgetU(x,i));
if (c!=0) return c;
}

View File

@ -332,7 +332,7 @@ static u64 o2u64 (B x) { if (x.f!=(f64)(u64)x.f) thrM("Expected integer"); retur
static f64 o2f (B x) { if (!isNum(x)) thrM("Expected integer"); return x.f; }
static u32 o2c (B x) { if (!isC32(x)) thrM("Expected character"); return (u32)x.u; }
static i32 o2iu (B x) { return isI32(x)? (i32)(u32)x.u : (i32)x.f; }
static i32 o2cu (B x) { return (u32)x.u; }
static u32 o2cu (B x) { return (u32)x.u; }
static usz o2su (B x) { return (usz)x.f; }
static f64 o2fu (B x) { return x.f; }
static i64 o2i64u(B x) { return (i64)x.f; }
@ -475,7 +475,7 @@ static inline u64 nsTime() {
struct timespec t;
// timespec_get(&t, TIME_UTC); // doesn't seem to exist on Android
clock_gettime(CLOCK_REALTIME, &t);
return t.tv_sec*1000000000ull + t.tv_nsec;
return (u64)(t.tv_sec*1000000000ll + t.tv_nsec);
}