summaryrefslogtreecommitdiff
path: root/lib/std/endian.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-01 21:09:50 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-11 22:16:11 -0800
commit90e26e0f687da28530b3b967df0cedf20407c071 (patch)
tree09c85ff396a5f235dbcbd5db2df911b5217bb472 /lib/std/endian.myr
parent94448201527e0c47c2924219bf1a8d0c0c2406b7 (diff)
downloadmc-90e26e0f687da28530b3b967df0cedf20407c071.tar.gz
Move to new trait syntax.
Diffstat (limited to 'lib/std/endian.myr')
-rw-r--r--lib/std/endian.myr12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/endian.myr b/lib/std/endian.myr
index 874ab71..c896dd8 100644
--- a/lib/std/endian.myr
+++ b/lib/std/endian.myr
@@ -1,16 +1,16 @@
pkg std =
- generic hosttonet : (v : @a::(integral,numeric) -> @a::(integral,numeric))
- generic nettohost : (v : @a::(integral,numeric) -> @a::(integral,numeric))
+ generic hosttonet : (v : @a -> @a) :: integral,numeric @a
+ generic nettohost : (v : @a -> @a) :: integral,numeric @a
;;
/* FIXME: we only support little endian platforms right now,
so we assume a little endian machine. FIX THIS. */
-generic hosttonet = {v : @a::(integral,numeric)
+generic hosttonet = {v : @a :: integral,numeric @a
var i
var ret
ret = 0
- for i = 0; i < sizeof(@a::(integral,numeric)); i++
+ for i = 0; i < sizeof(@a); i++
ret <<= 8
ret |= v & 0xff
v >>= 8
@@ -18,12 +18,12 @@ generic hosttonet = {v : @a::(integral,numeric)
-> ret
}
-generic nettohost = {v : @a::(integral,numeric)
+generic nettohost = {v : @a :: integral,numeric @a
var i
var ret
ret = 0
- for i = 0; i < sizeof(@a::(integral,numeric)); i++
+ for i = 0; i < sizeof(@a); i++
ret <<= 8
ret |= v & 0xff
v >>= 8