diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-14 19:20:46 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-14 19:20:46 -0400 |
commit | 089b01e0849b9eb01b5ab542b0baabe2d6ce1865 (patch) | |
tree | cb0d28c62763e18a25bef683d08a6cd0a29bd96a /out.c | |
parent | c687651c6d6ece2db2afe6ad0083bfec6c497e52 (diff) |
made parameters immutable; fixed other things involving immutability
Diffstat (limited to 'out.c')
-rw-r--r-- | out.c | 45 |
1 files changed, 11 insertions, 34 deletions
@@ -16,8 +16,8 @@ typedef unsigned char bool; /* declarations */ -void puti(i64 i); -void asdf(i64 i, i64( (*ret__)[3])); +i64 puti(i64 i); +void dbl(i64((* x)[3])); void main__(); /* code */ int main() { @@ -25,43 +25,20 @@ int main() { return 0; } -void puti(i64 i) { +i64 puti(i64 i) { printf("%ld\n", i); } -void asdf(i64 i, i64( (*ret__)[3])) { -i64( ret[3]) = {0}; -i64( asdf[3]) = {0}; -(ret[0]) = (0*i);; -(ret[1]) = (1*i);; -(ret[2]) = (2*i);; -{ -size_t i;i64(*arr__in) = asdf; i64(*arr__out) = ret; -for (i = 0; i < 3; i++) arr__out[i] = arr__in[i]; -}; -{ -size_t i;i64(*arr__in) = *ret__; i64(*arr__out) = asdf; -for (i = 0; i < 3; i++) arr__out[i] = arr__in[i]; -}return; +void dbl(i64((* x)[3])) { +((*x)[0]) = (((*x)[0])*2);; +((*x)[1]) = (((*x)[1])*2);; +((*x)[2]) = (((*x)[2])*2);; } void main__() { -i64(* x); { -i64(*expr__); expr__ = ((i64(*))calloc(1, sizeof(i64)));x = expr__;} -(*x) = 17;; -if (((*x)==0)) { -(*x) = ((1+2)+(3-(5/62)));; -} else { -(*x) = ((4+5)+6);; -}; -(puti((*x))); -(free(x)); -void (* fptr)(i64, i64((*)[3])); { -void (*expr__)(i64, i64((*)[3])); expr__ = asdf;fptr = expr__;} +i64( a[3]) = {0}; +(a[0]) = 1;; +(dbl((&a))); +(puti((a[0]))); } -i64 foo = 5; -char( bar[5]) = "\x48\x65\x6c\x6c\x6f"; -i64 a = 123; i64 b = 123; -char x = ((char)97); -i64 sadkfj = (-1293812); |