From 89f00af3cf25d594f10aebaa7048a17bdd520c4b Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sun, 20 Oct 2019 11:39:21 -0400 Subject: improved new; new slices --- out.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'out.c') diff --git a/out.c b/out.c index 450acad..d165db8 100644 --- a/out.c +++ b/out.c @@ -18,7 +18,6 @@ typedef struct { void *data; u64 n; } slice_; /* declarations */ void puti(i64 x); -void asdf(i64( (*x)[3]), i64 y, i64(*ret0_), i64((*ret1_)[3])); void main__(void); /* code */ int main() { @@ -26,35 +25,17 @@ int main() { return 0; } -#include -; void puti(i64 x) { -{ - printf("%ld\n", (long)x); -}} - - -void asdf(i64( (*x)[3]), i64 y, i64(*ret0_), i64((*ret1_)[3])) { -{ -}(*ret0_) = y;{ -size_t i;i64(*arr__in) = (*x); i64(*arr__out) = (*ret1_); -for (i = 0; i < 3; i++) arr__out[i] = arr__in[i]; -}return; -} + { + }} void main__(void) { -{ - i64( a[3]) = {0}; - i64 b = 0; - (a[0]) = 17;; - b = 5489;; - i64 c; i64( d[3]); asdf(&a, b, &c, &d); - - (puti(c)); - (puti((d[0]))); - void (* asdfasdf)(i64((*)[3]), i64, i64(*), i64((*)[3])); { - void (* expr__)(i64((*)[3]), i64, i64(*), i64((*)[3])); expr__ = asdf;asdfasdf = expr__;} -}} + { + i64((* Ar)[5]); { + i64((* expr__)[5]); expr__ = ((i64((*)[5]))calloc(1, sizeof(i64([5]))));Ar = expr__;} + slice_ A; { + slice_ expr__; slice_ a0_; a0_.data = calloc(100, sizeof(i64)); a0_.n = 100;expr__ = a0_;A = expr__;} + }} -- cgit v1.2.3