From 4b8cc1b6132f179caa25d808808e63f014131f13 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 21 Mar 2020 13:39:05 -0400 Subject: fixed casting to #C type at runtime --- tests/mem.toc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') 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 +} -- cgit v1.2.3