Skip to content

Commit dc93193

Browse files
committed
Merge pull request adafruit#674 from marcusva/fbsd-patches
Build patches for FreeBSD (as discussed in the former pull request adafruit#666)
2 parents c61be8e + 585a339 commit dc93193

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

unix/modos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) {
5252

5353
mp_obj_tuple_t *t = mp_obj_new_tuple(10, NULL);
5454
t->items[0] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_mode);
55-
t->items[1] = MP_OBJ_NEW_SMALL_INT(sb.st_ino);
55+
t->items[1] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_ino);
5656
t->items[2] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_dev);
5757
t->items[3] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_nlink);
5858
t->items[4] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_uid);

unix/modtime.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ void msec_sleep_tv(struct timeval *tv) {
5555
#define MP_CLOCKS_PER_SEC CLOCKS_PER_SEC
5656
#endif
5757

58-
#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX
59-
#define CLOCK_DIV 1000.0
60-
#elif defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000) // WIN32
61-
#define CLOCK_DIV 1.0
58+
#if defined(MP_CLOCKS_PER_SEC)
59+
#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0)
6260
#else
6361
#error Unsupported clock() implementation
6462
#endif

0 commit comments

Comments
 (0)