summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-06-17 11:55:59 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-17 11:55:59 -0700
commit3e8c358141a5fabeec1db153a5762eb28f571a76 (patch)
tree9e0638842d6925139d64e03951648cca0197c652 /lib/std
parentcf7a20e80d1bf21c24db48d430f6603f1e82a45e (diff)
downloadmc-3e8c358141a5fabeec1db153a5762eb28f571a76.tar.gz
Fix compile.
Whee, typos.
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/putint.myr19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/std/putint.myr b/lib/std/putint.myr
index bfcd35a..c6e48e9 100644
--- a/lib/std/putint.myr
+++ b/lib/std/putint.myr
@@ -17,16 +17,22 @@ pkg std =
generic putbe8 : (buf : byte[:], v : @a::(numeric,integral) -> size)
;;
-generic puthost64 = {buf, v; -> puthost(buf, (v : uint64), 8)}
+generic puthost = {buf, val : @a::(integral, numeric)
+ iassert(buf.len >= sizeof(@a), "buffer too small")
+ memblit((buf : byte#), (&val : byte#), sizeof(@a))
+ -> sizeof(@a)
+}
+
+generic puthost64 = {buf, v; -> puthost(buf, (v : uint64))}
generic putle64 = {buf, v; -> putle(buf, (v : uint64), 8)}
generic putbe64 = {buf, v; -> putbe(buf, (v : uint64), 8)}
-generic puthost32 = {buf, v; -> puthost(buf, (v : uint32), 4)}
+generic puthost32 = {buf, v; -> puthost(buf, (v : uint32))}
generic putle32 = {buf, v; -> putle(buf, (v : uint64), 4)}
generic putbe32 = {buf, v; -> putbe(buf, (v : uint64), 4)}
-generic puthost16 = {buf, v; -> puthost(buf, (v : uint16), 2)}
+generic puthost16 = {buf, v; -> puthost(buf, (v : uint16))}
generic putle16 = {buf, v; -> putle(buf, (v : uint64), 2)}
generic putbe16 = {buf, v; -> putbe(buf, (v : uint64), 2)}
-generic puthost8 = {buf, v; -> buf[0] = (v : uint8)}
+generic puthost8 = {buf, v; -> puthost(buf, (v : uint8))}
generic putle8 = {buf, v; -> putle(buf, (v : uint64), 1)}
generic putbe8 = {buf, v; -> putbe(buf, (v : uint64), 1)}
@@ -50,8 +56,3 @@ const putle = {buf, val, n
-> (n : size)
}
-generic puthost = {buf, val : @a::(integral, numeric)
- iassert(buf.len >= n, "buffer too small")
- memblit((buf : byte#), (&val : byte#), sizeof(@a))
- -> (n : size)
-}