summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authoririri <iri@konnichiwastevenspielbergde.su>2018-08-11 19:11:19 -0700
committerOri Bernstein <ori@eigenstate.org>2018-08-14 22:34:01 -0700
commit1db9bc54f99b5489d34b7c048fe3909b0279a317 (patch)
treea157381448158d43b059fb37b35e23d86074f26a /lib/std
parent2cd9927f90410e345fab398fe2573fe6971ef3b0 (diff)
downloadmc-1db9bc54f99b5489d34b7c048fe3909b0279a317.tar.gz
Make timespec/timeval struct members signed to simplify arithmetic.
Every single conversion except for one for OS X is uint64 to int64.
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/syswrap+posixy.myr2
-rw-r--r--lib/std/syswrap-ss+freebsd.myr4
-rw-r--r--lib/std/syswrap-ss+linux.myr4
-rw-r--r--lib/std/syswrap-ss+netbsd.myr4
-rw-r--r--lib/std/syswrap-ss+openbsd.myr4
-rw-r--r--lib/std/syswrap-ss+osx.myr4
6 files changed, 11 insertions, 11 deletions
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index b3b9baa..41c6e89 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -139,7 +139,7 @@ const curtime = {
if sys.clock_gettime(`sys.Clockrealtime, &tm) == 0
sec = tm.sec
- nsec = (tm.nsec : uint64)
+ nsec = tm.nsec
-> ((sec*1_000_000 + nsec/1000) : time)
else
-> -1
diff --git a/lib/std/syswrap-ss+freebsd.myr b/lib/std/syswrap-ss+freebsd.myr
index f445d17..0cad82a 100644
--- a/lib/std/syswrap-ss+freebsd.myr
+++ b/lib/std/syswrap-ss+freebsd.myr
@@ -16,8 +16,8 @@ const nanosleep = {nsecs
var req, rem
var s, ns
- s = nsecs / 1_000_000_000
- ns = nsecs % 1_000_000_000
+ s = (nsecs / 1_000_000_000 : int64)
+ ns = (nsecs % 1_000_000_000 : int64)
req = [.sec = s, .nsec = ns]
-> (sys.nanosleep(&req, &rem) : errno)
diff --git a/lib/std/syswrap-ss+linux.myr b/lib/std/syswrap-ss+linux.myr
index c4b7795..760a7db 100644
--- a/lib/std/syswrap-ss+linux.myr
+++ b/lib/std/syswrap-ss+linux.myr
@@ -13,8 +13,8 @@ const nanosleep = {nsecs
var req, rem
var s, ns
- s = nsecs / 1_000_000_000
- ns = nsecs % 1_000_000_000
+ s = (nsecs / 1_000_000_000 : int64)
+ ns = (nsecs % 1_000_000_000 : int64)
req = [.sec = s, .nsec = ns]
-> (sys.nanosleep(&req, &rem) : errno)
diff --git a/lib/std/syswrap-ss+netbsd.myr b/lib/std/syswrap-ss+netbsd.myr
index 42605ab..0f4ed65 100644
--- a/lib/std/syswrap-ss+netbsd.myr
+++ b/lib/std/syswrap-ss+netbsd.myr
@@ -22,8 +22,8 @@ const nanosleep = {nsecs
var req, rem
var s, ns
- s = nsecs / 1_000_000_000
- ns = nsecs % 1_000_000_000
+ s = (nsecs / 1_000_000_000 : int64)
+ ns = (nsecs % 1_000_000_000 : int64)
req = [.sec = s, .nsec = ns]
-> (sys.nanosleep(&req, &rem) : errno)
diff --git a/lib/std/syswrap-ss+openbsd.myr b/lib/std/syswrap-ss+openbsd.myr
index 42605ab..0f4ed65 100644
--- a/lib/std/syswrap-ss+openbsd.myr
+++ b/lib/std/syswrap-ss+openbsd.myr
@@ -22,8 +22,8 @@ const nanosleep = {nsecs
var req, rem
var s, ns
- s = nsecs / 1_000_000_000
- ns = nsecs % 1_000_000_000
+ s = (nsecs / 1_000_000_000 : int64)
+ ns = (nsecs % 1_000_000_000 : int64)
req = [.sec = s, .nsec = ns]
-> (sys.nanosleep(&req, &rem) : errno)
diff --git a/lib/std/syswrap-ss+osx.myr b/lib/std/syswrap-ss+osx.myr
index a773949..53a1db1 100644
--- a/lib/std/syswrap-ss+osx.myr
+++ b/lib/std/syswrap-ss+osx.myr
@@ -17,8 +17,8 @@ extern const put : (fmt : byte[:], args : ... -> int64)
const nanosleep = {nsecs
var s, us
- s = nsecs / 1_000_000_000
- us = (nsecs % 1_000_000_000 / 1000 : uint32)
+ s = (nsecs / 1_000_000_000 : int64)
+ us = (nsecs % 1_000_000_000 / 1000 : int32)
-> (sys.select( \
0, \
(0 : sys.fdset#), \