summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-06-07 13:00:35 +0100
committerDamien George <damien.p.george@gmail.com>2014-06-07 13:00:35 +0100
commitdc931934b3b73d6bb1395afab1ac2ae083c4b556 (patch)
tree87a255f091993e4eee2789d7ad5776d456217d2a
parentc61be8e1e10a8c7bac3161cae531d26a9d754825 (diff)
parent585a3394df2bbfa863af619a5ea8a1d5a7b88266 (diff)
downloadmicropython-dc931934b3b73d6bb1395afab1ac2ae083c4b556.tar.gz
micropython-dc931934b3b73d6bb1395afab1ac2ae083c4b556.zip
Merge pull request #674 from marcusva/fbsd-patches
Build patches for FreeBSD (as discussed in the former pull request #666)
-rw-r--r--unix/modos.c2
-rw-r--r--unix/modtime.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/unix/modos.c b/unix/modos.c
index a6be4bfff0..657958d04c 100644
--- a/unix/modos.c
+++ b/unix/modos.c
@@ -52,7 +52,7 @@ STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) {
mp_obj_tuple_t *t = mp_obj_new_tuple(10, NULL);
t->items[0] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_mode);
- t->items[1] = MP_OBJ_NEW_SMALL_INT(sb.st_ino);
+ t->items[1] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_ino);
t->items[2] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_dev);
t->items[3] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_nlink);
t->items[4] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_uid);
diff --git a/unix/modtime.c b/unix/modtime.c
index f957b96784..3cc09e3cd8 100644
--- a/unix/modtime.c
+++ b/unix/modtime.c
@@ -55,10 +55,8 @@ void msec_sleep_tv(struct timeval *tv) {
#define MP_CLOCKS_PER_SEC CLOCKS_PER_SEC
#endif
-#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX
-#define CLOCK_DIV 1000.0
-#elif defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000) // WIN32
-#define CLOCK_DIV 1.0
+#if defined(MP_CLOCKS_PER_SEC)
+#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0)
#else
#error Unsupported clock() implementation
#endif