summaryrefslogtreecommitdiff
path: root/tests/mem.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-21 13:39:05 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-21 13:39:05 -0400
commit4b8cc1b6132f179caa25d808808e63f014131f13 (patch)
tree2827ac2445a9fa3feaf8a1a559d31ec38c7b5b98 /tests/mem.toc
parent5d4fa960a020f40aa8a5d24225c81e5c467ce197 (diff)
fixed casting to #C type at runtime
Diffstat (limited to 'tests/mem.toc')
-rw-r--r--tests/mem.toc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/mem.toc b/tests/mem.toc
index 5e8c5fa..6d16895 100644
--- a/tests/mem.toc
+++ b/tests/mem.toc
@@ -3,12 +3,12 @@ calloc ::= #foreign("calloc", "libc.so.6") fn(#C size_t, #C size_t) #C &"void";
free ::= #foreign("free", "libc.so.6") fn(#C &"void");
new ::= fn(t :: Type) &t {
- calloc(1, (sizeof t) as u64)
+ calloc(1, (sizeof t) as #C size_t)
}
news ::= fn(t :: Type, n : int) []t {
s: []t;
- s.data = calloc(n as u64, (sizeof t) as u64);
+ s.data = calloc(n as #C size_t, (sizeof t) as #C size_t);
s.len = n;
s
}
@@ -20,4 +20,4 @@ del ::= fn(t::=, x: &t) {
dels ::= fn(t::=, x: []t) {
free(x.data);
-} \ No newline at end of file
+}