summaryrefslogtreecommitdiff
path: root/libstd/varargs.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-06 15:53:27 -0700
committerOri Bernstein <ori@eigenstate.org>2015-06-06 15:53:27 -0700
commit4ca93982fdef1ddb426b5595f814f3099adfdc65 (patch)
tree8c25ee4c98b26fa0f1bff66b4ae512c1a4aa1d2d /libstd/varargs.myr
parentea50af981b8a0472e2e3588c31c51ae927098949 (diff)
downloadmc-4ca93982fdef1ddb426b5595f814f3099adfdc65.tar.gz
First cut at formatting.
Diffstat (limited to 'libstd/varargs.myr')
-rw-r--r--libstd/varargs.myr14
1 files changed, 7 insertions, 7 deletions
diff --git a/libstd/varargs.myr b/libstd/varargs.myr
index 939f42d..06e6644 100644
--- a/libstd/varargs.myr
+++ b/libstd/varargs.myr
@@ -7,6 +7,7 @@ pkg std =
type valist
const vastart : (args : ...# -> valist)
+ const vatype : (ap : valist -> byte[:])
generic vanext : (ap : valist -> (@a, valist))
;;
@@ -49,6 +50,10 @@ const vastart = {args
-> [.args = a, .tc = tc]
}
+const vatype = {ap
+ -> tcpeek(&ap.tc)
+}
+
generic vanext = {ap -> (@a, valist)
var v : @a
var align
@@ -72,13 +77,8 @@ generic vanext = {ap -> (@a, valist)
ap.args = p castto(byte#)
v = (ap.args castto(@a#))#
- /* TODO: checked.
-
- Right now, too much is broken with named types.
- if !sleq(typeof(v), tcnext(&ap.tc))
- std.die("wrong type from valist\n")
- ;;
- */
+ /* TODO: check for type mismatch */
+ tcnext(&ap.tc)
/* only move on after we read through the value */
ap.args = ((p castto(intptr)) + sizeof(@a)) castto(byte#)