Mercurial > hg > CbC > old > device
changeset 831:a22aabb27786
pdecl_data type
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 03 Dec 2010 11:32:50 +0900 |
parents | ff5dfee80829 |
children | bc919d849346 |
files | mc-inline.c test/cext.c |
diffstat | 2 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-inline.c Fri Dec 03 09:18:29 2010 +0900 +++ b/mc-inline.c Fri Dec 03 11:32:50 2010 +0900 @@ -553,7 +553,7 @@ //int lvar; //if (car(lvar=cadr(e))==IVAR) // lvar=p_lvar(cadr(e)); // can be anything.... -#if 0 +#if 1 return pexpr(cadr(e)); #else return list3(car(e),pexpr(cadr(e)),caddr(e)); @@ -931,6 +931,8 @@ offset = pdecl_data_array(var,e,target_type,offset); break; default: + type = caddr(init); + e = rvalue(e); e = pexpr(e); t = caddr(init); // type of source offset = passign_data(var,target_type,e,t,offset); @@ -1286,7 +1288,7 @@ return pexpr(e2); case LABEL: return p_label_var(e2); - case LVAR: + case LVAR: case URLVAR: case RLVAR: case CRLVAR: case CURLVAR: case SRLVAR: case SURLVAR: case FRLVAR: case DRLVAR: case LRLVAR: case LURLVAR:
--- a/test/cext.c Fri Dec 03 09:18:29 2010 +0900 +++ b/test/cext.c Fri Dec 03 11:32:50 2010 +0900 @@ -1,6 +1,15 @@ int printf(const char *format, ...); unsigned int u; +static char current_file_dir[1024] ; + +void +f(char *name) +{ + char *s = name; + char *q = current_file_dir; + printf("%s and %s\n",s,q); +} main() { @@ -20,6 +29,13 @@ u = (unsigned) -23432; printf("#0018:%d\n",u/(8048+5)); + + current_file_dir[0] = 'k'; + current_file_dir[1] = 'a'; + current_file_dir[2] = 't'; + current_file_dir[3] = 'e'; + current_file_dir[4] = 0; + f("john"); return 0; }