Mercurial > hg > CbC > old > device
changeset 887:b519139c25e2
fix examples
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 05 Apr 2014 23:42:08 +0900 |
parents | 9a4b92984cf1 |
children | 2466ac7c1287 |
files | mc-inline.c test/strinit.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-inline.c Sat Apr 05 23:04:38 2014 +0900 +++ b/mc-inline.c Sat Apr 05 23:42:08 2014 +0900 @@ -896,6 +896,7 @@ if (init==0) { // empty declaration // it can happen like a = (struct hoge){}; + // offset = passign_data(var,EMPTY,list2(CONST,size(target_type)),EMPTY,offset); return offset; } e = cadr(init);
--- a/test/strinit.c Sat Apr 05 23:04:38 2014 +0900 +++ b/test/strinit.c Sat Apr 05 23:42:08 2014 +0900 @@ -225,10 +225,17 @@ INLINE int main8() { struct arg a = {11,22,33}; struct arg b = {.fuga=44,.aho=55}; + struct arg c; + struct arg d = {}; + struct arg e = (struct arg){}; f(a); f(b); + f(c); + f(d); + f(e); f((struct arg){.fuga = 3,.aho=5}); f((struct arg){.hage = 3}); + f((struct arg){}); printf("#0226:%d %d\n",a.aho,((struct arg){.aho=120, .hage=55}).aho); return 0; }