summaryrefslogtreecommitdiff
path: root/out.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-10-11 14:40:33 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-10-11 14:40:33 -0400
commitbfc7a22d0674371995c21fde5463bf08edbaabe2 (patch)
tree27201080c9a2c54202f57b275e6cbf6f0c9e0da3 /out.c
parent3498c55279ade0a0f5fe9e2fad1c983e8328db72 (diff)
stating to make returns work for out param fns
Diffstat (limited to 'out.c')
-rw-r--r--out.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/out.c b/out.c
index 1e45b85..2426dd0 100644
--- a/out.c
+++ b/out.c
@@ -17,6 +17,7 @@ typedef unsigned char bool;
/* declarations */
void puti(i64 i);
+void asdf(i64 i, i64( (*ret__)[3]));
void main__();
/* code */
int main() {
@@ -28,6 +29,14 @@ void puti(i64 i) {
printf("%ld\n", i);
}
+void asdf(i64 i, i64( (*ret__)[3])) {
+i64( ret[3]) = {0};
+((ret[0])=(0*i));
+((ret[1])=(1*i));
+((ret[2])=(2*i));
+return;
+}
+
void main__() {
i64(* x); x = ((i64(*))calloc(1, sizeof(i64)));
((*x)=17);
@@ -38,6 +47,7 @@ if (((*x)==0)) {
};
(puti((*x)));
(free(x));
+void (* fptr)(i64, i64((*)[3])); fptr = asdf;
}
i64 foo = 5;