Skip to content

Commit 25c5d57

Browse files
fix warning sign-compare and macro-redefined on Zephyr platform (#4668)
1 parent 34c6fc9 commit 25c5d57

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/shared/platform/common/math/math.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ freebsd_floor(double x)
851851
i0 += 1;
852852
else {
853853
j = i1 + (1 << (52 - j0));
854-
if (j < i1)
854+
if (j < (u_int32_t)i1)
855855
i0 += 1; /* got a carry */
856856
i1 = j;
857857
}
@@ -913,7 +913,7 @@ freebsd_ceil(double x)
913913
i0 += 1;
914914
else {
915915
j = i1 + (1 << (52 - j0));
916-
if (j < i1)
916+
if (j < (u_int32_t)i1)
917917
i0 += 1; /* got a carry */
918918
i1 = j;
919919
}
@@ -1345,7 +1345,7 @@ freebsd_pow(double x, double y)
13451345
k = (iy >> 20) - 0x3ff; /* exponent */
13461346
if (k > 20) {
13471347
j = ly >> (52 - k);
1348-
if ((j << (52 - k)) == ly)
1348+
if (((u_int32_t)(j << (52 - k))) == ly)
13491349
yisint = 2 - (j & 1);
13501350
}
13511351
else if (ly == 0) {

core/shared/platform/zephyr/platform_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ typedef struct timespec os_timespec;
290290
#define CLOCK_REALTIME 1
291291
#endif
292292

293+
#ifndef CLOCK_MONOTONIC
293294
#define CLOCK_MONOTONIC 4
295+
#endif
294296

295297
static inline int
296298
os_sched_yield(void)

0 commit comments

Comments
 (0)