diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-11 14:40:33 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-11 14:40:33 -0400 |
commit | bfc7a22d0674371995c21fde5463bf08edbaabe2 (patch) | |
tree | 27201080c9a2c54202f57b275e6cbf6f0c9e0da3 /out.c | |
parent | 3498c55279ade0a0f5fe9e2fad1c983e8328db72 (diff) |
stating to make returns work for out param fns
Diffstat (limited to 'out.c')
-rw-r--r-- | out.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |