diff --git a/core/shared/platform/common/math/math.c b/core/shared/platform/common/math/math.c index ac0c40221..3c0171570 100644 --- a/core/shared/platform/common/math/math.c +++ b/core/shared/platform/common/math/math.c @@ -851,7 +851,7 @@ freebsd_floor(double x) i0 += 1; else { j = i1 + (1 << (52 - j0)); - if (j < i1) + if (j < (u_int32_t)i1) i0 += 1; /* got a carry */ i1 = j; } @@ -913,7 +913,7 @@ freebsd_ceil(double x) i0 += 1; else { j = i1 + (1 << (52 - j0)); - if (j < i1) + if (j < (u_int32_t)i1) i0 += 1; /* got a carry */ i1 = j; } @@ -1345,7 +1345,7 @@ freebsd_pow(double x, double y) k = (iy >> 20) - 0x3ff; /* exponent */ if (k > 20) { j = ly >> (52 - k); - if ((j << (52 - k)) == ly) + if (((u_int32_t)(j << (52 - k))) == ly) yisint = 2 - (j & 1); } else if (ly == 0) { diff --git a/core/shared/platform/zephyr/platform_internal.h b/core/shared/platform/zephyr/platform_internal.h index d5f0c80d8..134b5c2b5 100644 --- a/core/shared/platform/zephyr/platform_internal.h +++ b/core/shared/platform/zephyr/platform_internal.h @@ -290,7 +290,9 @@ typedef struct timespec os_timespec; #define CLOCK_REALTIME 1 #endif +#ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 4 +#endif static inline int os_sched_yield(void)